llvm.org GIT mirror llvm / d77254d
[Tests] Autogen and improve test readability git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364156 91177308-0d34-0410-b5e6-96231b3b80d8 Philip Reames 2 months ago
1 changed file(s) with 95 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt < %s -indvars -S | FileCheck %s
2
13 define void @test1() nounwind {
4 ; CHECK-LABEL: @test1(
5 ; CHECK-NEXT: entry:
6 ; CHECK-NEXT: br label [[BB:%.*]]
7 ; CHECK: bb:
8 ; CHECK-NEXT: [[IV_INT:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ]
9 ; CHECK-NEXT: [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double
10 ; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[INDVAR_CONV]]) #0
11 ; CHECK-NEXT: [[DOTINT]] = add nuw nsw i32 [[IV_INT]], 1
12 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[DOTINT]], 10000
13 ; CHECK-NEXT: br i1 [[TMP1]], label [[BB]], label [[RETURN:%.*]]
14 ; CHECK: return:
15 ; CHECK-NEXT: ret void
16 ;
217 entry:
3 br label %bb
18 br label %bb
419
520 bb: ; preds = %bb, %entry
6 %x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ] ; [#uses=2]
7 %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; [#uses=0]
8 %1 = fadd double %x.0.reg2mem.0, 1.000000e+00 ; [#uses=2]
9 %2 = fcmp olt double %1, 1.000000e+04 ; [#uses=1]
10 br i1 %2, label %bb, label %return
21 %iv = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
22 %0 = tail call i32 @foo(double %iv) nounwind
23 %1 = fadd double %iv, 1.000000e+00
24 %2 = fcmp olt double %1, 1.000000e+04
25 br i1 %2, label %bb, label %return
1126
1227 return: ; preds = %bb
13 ret void
14 ; CHECK-LABEL: @test1(
15 ; CHECK: icmp
28 ret void
1629 }
1730
1831 declare i32 @foo(double)
1932
2033 define void @test2() nounwind {
34 ; CHECK-LABEL: @test2(
35 ; CHECK-NEXT: entry:
36 ; CHECK-NEXT: br label [[BB:%.*]]
37 ; CHECK: bb:
38 ; CHECK-NEXT: [[IV_INT:%.*]] = phi i32 [ -10, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ]
39 ; CHECK-NEXT: [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double
40 ; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[INDVAR_CONV]]) #0
41 ; CHECK-NEXT: [[DOTINT]] = add nsw i32 [[IV_INT]], 2
42 ; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[DOTINT]], -1
43 ; CHECK-NEXT: br i1 [[TMP1]], label [[BB]], label [[RETURN:%.*]]
44 ; CHECK: return:
45 ; CHECK-NEXT: ret void
46 ;
2147 entry:
22 br label %bb
48 br label %bb
2349
2450 bb: ; preds = %bb, %entry
25 %x.0.reg2mem.0 = phi double [ -10.000000e+00, %entry ], [ %1, %bb ] ; [#uses=2]
26 %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; [#uses=0]
27 %1 = fadd double %x.0.reg2mem.0, 2.000000e+00 ; [#uses=2]
28 %2 = fcmp olt double %1, -1.000000e+00 ; [#uses=1]
29 br i1 %2, label %bb, label %return
51 %iv = phi double [ -10.000000e+00, %entry ], [ %1, %bb ]
52 %0 = tail call i32 @foo(double %iv) nounwind
53 %1 = fadd double %iv, 2.000000e+00
54 %2 = fcmp olt double %1, -1.000000e+00
55 br i1 %2, label %bb, label %return
3056
3157 return: ; preds = %bb
32 ret void
33 ; CHECK-LABEL: @test2(
34 ; CHECK: icmp
58 ret void
3559 }
3660
3761
3862 define void @test3() nounwind {
63 ; CHECK-LABEL: @test3(
64 ; CHECK-NEXT: entry:
65 ; CHECK-NEXT: br label [[BB:%.*]]
66 ; CHECK: bb:
67 ; CHECK-NEXT: [[IV:%.*]] = phi double [ 0.000000e+00, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[BB]] ]
68 ; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[IV]]) #0
69 ; CHECK-NEXT: [[TMP1]] = fadd double [[IV]], 1.000000e+00
70 ; CHECK-NEXT: br i1 false, label [[BB]], label [[RETURN:%.*]]
71 ; CHECK: return:
72 ; CHECK-NEXT: ret void
73 ;
3974 entry:
40 br label %bb
75 br label %bb
4176
4277 bb: ; preds = %bb, %entry
43 %x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
44 %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind
45 %1 = fadd double %x.0.reg2mem.0, 1.000000e+00
46 %2 = fcmp olt double %1, -1.000000e+00
47 br i1 %2, label %bb, label %return
78 %iv = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
79 %0 = tail call i32 @foo(double %iv) nounwind
80 %1 = fadd double %iv, 1.000000e+00
81 %2 = fcmp olt double %1, -1.000000e+00
82 br i1 %2, label %bb, label %return
4883
4984 return:
50 ret void
51 ; CHECK-LABEL: @test3(
52 ; CHECK: br i1 false
85 ret void
5386 }
5487
5588 define void @test4() nounwind {
89 ; CHECK-LABEL: @test4(
90 ; CHECK-NEXT: entry:
91 ; CHECK-NEXT: br label [[BB:%.*]]
92 ; CHECK: bb:
93 ; CHECK-NEXT: [[IV_INT:%.*]] = phi i32 [ 40, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ]
94 ; CHECK-NEXT: [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double
95 ; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @foo(double [[INDVAR_CONV]]) #0
96 ; CHECK-NEXT: [[DOTINT]] = add nsw i32 [[IV_INT]], -1
97 ; CHECK-NEXT: br i1 false, label [[BB]], label [[RETURN:%.*]]
98 ; CHECK: return:
99 ; CHECK-NEXT: ret void
100 ;
56101 entry:
57 br label %bb
102 br label %bb
58103
59104 bb: ; preds = %bb, %entry
60 %x.0.reg2mem.0 = phi double [ 40.000000e+00, %entry ], [ %1, %bb ] ; [#uses=2]
61 %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; [#uses=0]
62 %1 = fadd double %x.0.reg2mem.0, -1.000000e+00 ; [#uses=2]
63 %2 = fcmp olt double %1, 1.000000e+00 ; [#uses=1]
64 br i1 %2, label %bb, label %return
105 %iv = phi double [ 40.000000e+00, %entry ], [ %1, %bb ]
106 %0 = tail call i32 @foo(double %iv) nounwind
107 %1 = fadd double %iv, -1.000000e+00
108 %2 = fcmp olt double %1, 1.000000e+00
109 br i1 %2, label %bb, label %return
65110
66111 return:
67 ret void
68 ; CHECK-LABEL: @test4(
69 ; CHECK-NOT: cmp
70 ; CHECK: br i1 false
112 ret void
71113 }
72114
73115 ; PR6761
74116 define void @test5() nounwind {
75117 ;
118 ; CHECK-LABEL: @test5(
119 ; CHECK-NEXT: br label [[TMP1:%.*]]
120 ; CHECK: 1:
121 ; CHECK-NEXT: [[DOTINT:%.*]] = phi i32 [ 9, [[TMP0:%.*]] ], [ [[DOTINT1:%.*]], [[TMP1]] ]
122 ; CHECK-NEXT: [[TMP2:%.*]] = tail call i32 @foo(double 0.000000e+00)
123 ; CHECK-NEXT: [[DOTINT1]] = add nsw i32 [[DOTINT]], -1
124 ; CHECK-NEXT: [[TMP3:%.*]] = icmp slt i32 [[DOTINT1]], 0
125 ; CHECK-NEXT: br i1 [[TMP3]], label [[EXIT:%.*]], label [[TMP1]]
126 ; CHECK: exit:
127 ; CHECK-NEXT: ret void
128 ;
76129 br label %1
77130
78 ;
79 %2 = phi double [ 9.000000e+00, %0 ], [ %4, %1 ] ; [#uses=1]
80 %3 = tail call i32 @foo(double 0.0) ; [#uses=0]
81 %4 = fadd double %2, -1.000000e+00 ; [#uses=2]
82 %5 = fcmp ult double %4, 0.000000e+00 ; [#uses=1]
131 ;
132 %2 = phi double [ 9.000000e+00, %0 ], [ %4, %1 ]
133 %3 = tail call i32 @foo(double 0.0)
134 %4 = fadd double %2, -1.000000e+00
135 %5 = fcmp ult double %4, 0.000000e+00
83136 br i1 %5, label %exit, label %1
84137
85138 exit:
86139 ret void
87
88 ; CHECK-LABEL: @test5(
89 ; CHECK: icmp slt i32 {{.*}}, 0
90 ; CHECK-NEXT: br i1
91140 }