1- ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
1+ ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
2+ ; RUN: opt < %s -disable-output -passes="print<scalar-evolution>" \
3+ ; RUN: -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
24
35declare void @llvm.experimental.guard (i1 , ...)
46
57define void @test_1 (i32 %n ) nounwind {
68; Prove that (n > 1) ===> (n / 2 > 0).
7- ; CHECK: Determining loop execution counts for: @test_1
8- ; CHECK: Loop %header: backedge-taken count is (-1 + %n.div.2)<nsw>
9+ ; CHECK-LABEL: 'test_1'
10+ ; CHECK-NEXT: Determining loop execution counts for: @test_1
11+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + %n.div.2)<nsw>
12+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741822
13+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + %n.div.2)<nsw>
14+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
15+ ;
916entry:
1017 %cmp1 = icmp sgt i32 %n , 1
1118 %n.div.2 = sdiv i32 %n , 2
2431
2532define void @test_1neg (i32 %n ) nounwind {
2633; Prove that (n > 0) =\=> (n / 2 > 0).
27- ; CHECK: Determining loop execution counts for: @test_1neg
28- ; CHECK: Loop %header: backedge-taken count is (-1 + (1 smax %n.div.2))<nsw>
34+ ; CHECK-LABEL: 'test_1neg'
35+ ; CHECK-NEXT: Determining loop execution counts for: @test_1neg
36+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + (1 smax %n.div.2))<nsw>
37+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741822
38+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + (1 smax %n.div.2))<nsw>
39+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
40+ ;
2941entry:
3042 %cmp1 = icmp sgt i32 %n , 0
3143 %n.div.2 = sdiv i32 %n , 2
4456
4557define void @test_2 (i32 %n ) nounwind {
4658; Prove that (n >= 2) ===> (n / 2 > 0).
47- ; CHECK: Determining loop execution counts for: @test_2
48- ; CHECK: Loop %header: backedge-taken count is (-1 + %n.div.2)<nsw>
59+ ; CHECK-LABEL: 'test_2'
60+ ; CHECK-NEXT: Determining loop execution counts for: @test_2
61+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + %n.div.2)<nsw>
62+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741822
63+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + %n.div.2)<nsw>
64+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
65+ ;
4966entry:
5067 %cmp1 = icmp sge i32 %n , 2
5168 %n.div.2 = sdiv i32 %n , 2
6481
6582define void @test_2neg (i32 %n ) nounwind {
6683; Prove that (n >= 1) =\=> (n / 2 > 0).
67- ; CHECK: Determining loop execution counts for: @test_2neg
68- ; CHECK: Loop %header: backedge-taken count is (-1 + (1 smax %n.div.2))<nsw>
84+ ; CHECK-LABEL: 'test_2neg'
85+ ; CHECK-NEXT: Determining loop execution counts for: @test_2neg
86+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + (1 smax %n.div.2))<nsw>
87+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741822
88+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + (1 smax %n.div.2))<nsw>
89+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
90+ ;
6991entry:
7092 %cmp1 = icmp sge i32 %n , 1
7193 %n.div.2 = sdiv i32 %n , 2
@@ -84,8 +106,13 @@ exit:
84106
85107define void @test_3 (i32 %n ) nounwind {
86108; Prove that (n > -2) ===> (n / 2 >= 0).
87- ; CHECK: Determining loop execution counts for: @test_3
88- ; CHECK: Loop %header: backedge-taken count is (1 + %n.div.2)<nsw>
109+ ; CHECK-LABEL: 'test_3'
110+ ; CHECK-NEXT: Determining loop execution counts for: @test_3
111+ ; CHECK-NEXT: Loop %header: backedge-taken count is (1 + %n.div.2)<nsw>
112+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741824
113+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (1 + %n.div.2)<nsw>
114+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
115+ ;
89116entry:
90117 %cmp1 = icmp sgt i32 %n , -2
91118 %n.div.2 = sdiv i32 %n , 2
@@ -104,8 +131,13 @@ exit:
104131
105132define void @test_3neg (i32 %n ) nounwind {
106133; Prove that (n > -3) =\=> (n / 2 >= 0).
107- ; CHECK: Determining loop execution counts for: @test_3neg
108- ; CHECK: Loop %header: backedge-taken count is (0 smax (1 + %n.div.2)<nsw>)
134+ ; CHECK-LABEL: 'test_3neg'
135+ ; CHECK-NEXT: Determining loop execution counts for: @test_3neg
136+ ; CHECK-NEXT: Loop %header: backedge-taken count is (0 smax (1 + %n.div.2)<nsw>)
137+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741824
138+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (0 smax (1 + %n.div.2)<nsw>)
139+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
140+ ;
109141entry:
110142 %cmp1 = icmp sgt i32 %n , -3
111143 %n.div.2 = sdiv i32 %n , 2
@@ -124,8 +156,13 @@ exit:
124156
125157define void @test_4 (i32 %n ) nounwind {
126158; Prove that (n >= -1) ===> (n / 2 >= 0).
127- ; CHECK: Determining loop execution counts for: @test_4
128- ; CHECK: Loop %header: backedge-taken count is (1 + %n.div.2)<nsw>
159+ ; CHECK-LABEL: 'test_4'
160+ ; CHECK-NEXT: Determining loop execution counts for: @test_4
161+ ; CHECK-NEXT: Loop %header: backedge-taken count is (1 + %n.div.2)<nsw>
162+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741824
163+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (1 + %n.div.2)<nsw>
164+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
165+ ;
129166entry:
130167 %cmp1 = icmp sge i32 %n , -1
131168 %n.div.2 = sdiv i32 %n , 2
@@ -144,8 +181,13 @@ exit:
144181
145182define void @test_4neg (i32 %n ) nounwind {
146183; Prove that (n >= -2) =\=> (n / 2 >= 0).
147- ; CHECK: Determining loop execution counts for: @test_4neg
148- ; CHECK: Loop %header: backedge-taken count is (0 smax (1 + %n.div.2)<nsw>)
184+ ; CHECK-LABEL: 'test_4neg'
185+ ; CHECK-NEXT: Determining loop execution counts for: @test_4neg
186+ ; CHECK-NEXT: Loop %header: backedge-taken count is (0 smax (1 + %n.div.2)<nsw>)
187+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i32 1073741824
188+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (0 smax (1 + %n.div.2)<nsw>)
189+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
190+ ;
149191entry:
150192 %cmp1 = icmp sge i32 %n , -2
151193 %n.div.2 = sdiv i32 %n , 2
@@ -164,8 +206,13 @@ exit:
164206
165207define void @test_ext_01 (i32 %n ) nounwind {
166208; Prove that (n > 1) ===> (n / 2 > 0).
167- ; CHECK: Determining loop execution counts for: @test_ext_01
168- ; CHECK: Loop %header: backedge-taken count is (-1 + (sext i32 %n.div.2 to i64))<nsw>
209+ ; CHECK-LABEL: 'test_ext_01'
210+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_01
211+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + (sext i32 %n.div.2 to i64))<nsw>
212+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741822
213+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + (sext i32 %n.div.2 to i64))<nsw>
214+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
215+ ;
169216entry:
170217 %cmp1 = icmp sgt i32 %n , 1
171218 %n.div.2 = sdiv i32 %n , 2
@@ -185,8 +232,13 @@ exit:
185232
186233define void @test_ext_01neg (i32 %n ) nounwind {
187234; Prove that (n > 0) =\=> (n / 2 > 0).
188- ; CHECK: Determining loop execution counts for: @test_ext_01neg
189- ; CHECK: Loop %header: backedge-taken count is (-1 + (1 smax (sext i32 %n.div.2 to i64)))<nsw>
235+ ; CHECK-LABEL: 'test_ext_01neg'
236+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_01neg
237+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + (1 smax (sext i32 %n.div.2 to i64)))<nsw>
238+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741822
239+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + (1 smax (sext i32 %n.div.2 to i64)))<nsw>
240+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
241+ ;
190242entry:
191243 %cmp1 = icmp sgt i32 %n , 0
192244 %n.div.2 = sdiv i32 %n , 2
@@ -206,8 +258,13 @@ exit:
206258
207259define void @test_ext_02 (i32 %n ) nounwind {
208260; Prove that (n >= 2) ===> (n / 2 > 0).
209- ; CHECK: Determining loop execution counts for: @test_ext_02
210- ; CHECK: Loop %header: backedge-taken count is (-1 + (sext i32 %n.div.2 to i64))<nsw>
261+ ; CHECK-LABEL: 'test_ext_02'
262+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_02
263+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + (sext i32 %n.div.2 to i64))<nsw>
264+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741822
265+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + (sext i32 %n.div.2 to i64))<nsw>
266+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
267+ ;
211268entry:
212269 %cmp1 = icmp sge i32 %n , 2
213270 %n.div.2 = sdiv i32 %n , 2
@@ -227,8 +284,13 @@ exit:
227284
228285define void @test_ext_02neg (i32 %n ) nounwind {
229286; Prove that (n >= 1) =\=> (n / 2 > 0).
230- ; CHECK: Determining loop execution counts for: @test_ext_02neg
231- ; CHECK: Loop %header: backedge-taken count is (-1 + (1 smax (sext i32 %n.div.2 to i64)))<nsw>
287+ ; CHECK-LABEL: 'test_ext_02neg'
288+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_02neg
289+ ; CHECK-NEXT: Loop %header: backedge-taken count is (-1 + (1 smax (sext i32 %n.div.2 to i64)))<nsw>
290+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741822
291+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (-1 + (1 smax (sext i32 %n.div.2 to i64)))<nsw>
292+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
293+ ;
232294entry:
233295 %cmp1 = icmp sge i32 %n , 1
234296 %n.div.2 = sdiv i32 %n , 2
@@ -248,8 +310,13 @@ exit:
248310
249311define void @test_ext_03 (i32 %n ) nounwind {
250312; Prove that (n > -2) ===> (n / 2 >= 0).
251- ; CHECK: Determining loop execution counts for: @test_ext_03
252- ; CHECK: Loop %header: backedge-taken count is (1 + (sext i32 %n.div.2 to i64))<nsw>
313+ ; CHECK-LABEL: 'test_ext_03'
314+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_03
315+ ; CHECK-NEXT: Loop %header: backedge-taken count is (1 + (sext i32 %n.div.2 to i64))<nsw>
316+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741824
317+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (1 + (sext i32 %n.div.2 to i64))<nsw>
318+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
319+ ;
253320entry:
254321 %cmp1 = icmp sgt i32 %n , -2
255322 %n.div.2 = sdiv i32 %n , 2
@@ -269,8 +336,13 @@ exit:
269336
270337define void @test_ext_03neg (i32 %n ) nounwind {
271338; Prove that (n > -3) =\=> (n / 2 >= 0).
272- ; CHECK: Determining loop execution counts for: @test_ext_03neg
273- ; CHECK: Loop %header: backedge-taken count is (0 smax (1 + (sext i32 %n.div.2 to i64))<nsw>)
339+ ; CHECK-LABEL: 'test_ext_03neg'
340+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_03neg
341+ ; CHECK-NEXT: Loop %header: backedge-taken count is (0 smax (1 + (sext i32 %n.div.2 to i64))<nsw>)
342+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741824
343+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (0 smax (1 + (sext i32 %n.div.2 to i64))<nsw>)
344+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
345+ ;
274346entry:
275347 %cmp1 = icmp sgt i32 %n , -3
276348 %n.div.2 = sdiv i32 %n , 2
@@ -290,8 +362,13 @@ exit:
290362
291363define void @test_ext_04 (i32 %n ) nounwind {
292364; Prove that (n >= -1) ===> (n / 2 >= 0).
293- ; CHECK: Determining loop execution counts for: @test_ext_04
294- ; CHECK: Loop %header: backedge-taken count is (1 + (sext i32 %n.div.2 to i64))<nsw>
365+ ; CHECK-LABEL: 'test_ext_04'
366+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_04
367+ ; CHECK-NEXT: Loop %header: backedge-taken count is (1 + (sext i32 %n.div.2 to i64))<nsw>
368+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741824
369+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (1 + (sext i32 %n.div.2 to i64))<nsw>
370+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
371+ ;
295372entry:
296373 %cmp1 = icmp sge i32 %n , -1
297374 %n.div.2 = sdiv i32 %n , 2
@@ -311,8 +388,13 @@ exit:
311388
312389define void @test_ext_04neg (i32 %n ) nounwind {
313390; Prove that (n >= -2) =\=> (n / 2 >= 0).
314- ; CHECK: Determining loop execution counts for: @test_ext_04neg
315- ; CHECK: Loop %header: backedge-taken count is (0 smax (1 + (sext i32 %n.div.2 to i64))<nsw>)
391+ ; CHECK-LABEL: 'test_ext_04neg'
392+ ; CHECK-NEXT: Determining loop execution counts for: @test_ext_04neg
393+ ; CHECK-NEXT: Loop %header: backedge-taken count is (0 smax (1 + (sext i32 %n.div.2 to i64))<nsw>)
394+ ; CHECK-NEXT: Loop %header: constant max backedge-taken count is i64 1073741824
395+ ; CHECK-NEXT: Loop %header: symbolic max backedge-taken count is (0 smax (1 + (sext i32 %n.div.2 to i64))<nsw>)
396+ ; CHECK-NEXT: Loop %header: Trip multiple is 1
397+ ;
316398entry:
317399 %cmp1 = icmp sge i32 %n , -2
318400 %n.div.2 = sdiv i32 %n , 2
0 commit comments