llvm.org GIT mirror llvm / fff44ae
This commit is a 4x squash commit consisting of 4x functions converted to use FileCheck instead of grep. Messages: Converted test case trivial_codegen_tailcall.ll to use FileCheck. Converted test return_constant.ll to use FileCheck instead of grep. Converted test reorder_load.ll to use FileCheck instead of grep. Converted test intervening-inst.ll to use FileCheck instead of grep. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172171 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Gottesman 6 years ago
4 changed file(s) with 12 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 ; This function contains intervening instructions which should be moved out of the way
1 ; RUN: opt < %s -tailcallelim -S | not grep call
1 ; RUN: opt < %s -tailcallelim -S | FileCheck %s
22
33 define i32 @Test(i32 %X) {
44 entry:
99 ret i32 %tmp.4
1010 endif.0: ; preds = %entry
1111 %tmp.10 = add i32 %X, -1 ; [#uses=1]
12 ; CHECK-NOT: call
1213 %tmp.8 = call i32 @Test( i32 %tmp.10 ) ; [#uses=1]
1314 %DUMMY = add i32 %X, 1 ; [#uses=0]
1415 ret i32 %tmp.8
None ; RUN: opt < %s -tailcallelim -S | not grep call
0 ; RUN: opt < %s -tailcallelim -S | FileCheck %s
11 ; PR4323
22
33 ; Several cases where tail call elimination should move the load above the call,
2020
2121 else: ; preds = %entry
2222 %tmp7 = add i32 %start_arg, 1 ; [#uses=1]
23 ; CHECK-NOT: call
2324 %tmp8 = call fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; [#uses=1]
2425 %tmp9 = load i32* %a_arg ; [#uses=1]
2526 %tmp10 = add i32 %tmp9, %tmp8 ; [#uses=1]
4647
4748 recurse: ; preds = %else
4849 %tmp7 = add i32 %start_arg, 1 ; [#uses=1]
50 ; CHECK-NOT: call
4951 %tmp8 = call fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; [#uses=1]
5052 %tmp9 = load i32* @global ; [#uses=1]
5153 %tmp10 = add i32 %tmp9, %tmp8 ; [#uses=1]
6567
6668 else: ; preds = %entry
6769 %tmp7 = add i32 %start_arg, 1 ; [#uses=1]
70 ; CHECK-NOT: call
6871 %tmp8 = call fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; [#uses=1]
6972 %tmp9 = load i32* @extern_weak_global ; [#uses=1]
7073 %tmp10 = add i32 %tmp9, %tmp8 ; [#uses=1]
9396 recurse: ; preds = %else
9497 %tmp7 = add i32 %start_arg, 1 ; [#uses=1]
9598 %first = load i32* %a_arg ; [#uses=1]
99 ; CHECK-NOT: call
96100 %tmp8 = call fastcc i32 @raise_load_4(i32* %a_arg, i32 %first, i32 %tmp7) ; [#uses=1]
97101 %second = load i32* %a_arg ; [#uses=1]
98102 %tmp10 = add i32 %second, %tmp8 ; [#uses=1]
0 ; Though this case seems to be fairly unlikely to occur in the wild, someone
11 ; plunked it into the demo script, so maybe they care about it.
22 ;
3 ; RUN: opt < %s -tailcallelim -S | not grep call
3 ; RUN: opt < %s -tailcallelim -S | FileCheck %s
44
55 define i32 @aaa(i32 %c) {
66 entry:
88 br i1 %tmp.1, label %return, label %else
99 else: ; preds = %entry
1010 %tmp.5 = add i32 %c, -1 ; [#uses=1]
11 ; CHECK-NOT: call
1112 %tmp.3 = call i32 @aaa( i32 %tmp.5 ) ; [#uses=0]
1213 ret i32 0
1314 return: ; preds = %entry
None ; RUN: opt < %s -tailcallelim -S | \
1 ; RUN: grep "tail call void @foo"
0 ; RUN: opt < %s -tailcallelim -S | FileCheck %s
21
32
43 declare void @foo()
54
65 define void @bar() {
7 call void @foo( )
6 ; CHECK: tail call void @foo()
7 call void @foo()
88 ret void
99 }
1010