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
2
4
3
5
declare void @llvm.experimental.guard (i1 , ...)
4
6
5
7
define void @test_1 (i32 %n ) nounwind {
6
8
; 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
+ ;
9
16
entry:
10
17
%cmp1 = icmp sgt i32 %n , 1
11
18
%n.div.2 = sdiv i32 %n , 2
24
31
25
32
define void @test_1neg (i32 %n ) nounwind {
26
33
; 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
+ ;
29
41
entry:
30
42
%cmp1 = icmp sgt i32 %n , 0
31
43
%n.div.2 = sdiv i32 %n , 2
44
56
45
57
define void @test_2 (i32 %n ) nounwind {
46
58
; 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
+ ;
49
66
entry:
50
67
%cmp1 = icmp sge i32 %n , 2
51
68
%n.div.2 = sdiv i32 %n , 2
64
81
65
82
define void @test_2neg (i32 %n ) nounwind {
66
83
; 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
+ ;
69
91
entry:
70
92
%cmp1 = icmp sge i32 %n , 1
71
93
%n.div.2 = sdiv i32 %n , 2
@@ -84,8 +106,13 @@ exit:
84
106
85
107
define void @test_3 (i32 %n ) nounwind {
86
108
; 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
+ ;
89
116
entry:
90
117
%cmp1 = icmp sgt i32 %n , -2
91
118
%n.div.2 = sdiv i32 %n , 2
@@ -104,8 +131,13 @@ exit:
104
131
105
132
define void @test_3neg (i32 %n ) nounwind {
106
133
; 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
+ ;
109
141
entry:
110
142
%cmp1 = icmp sgt i32 %n , -3
111
143
%n.div.2 = sdiv i32 %n , 2
@@ -124,8 +156,13 @@ exit:
124
156
125
157
define void @test_4 (i32 %n ) nounwind {
126
158
; 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
+ ;
129
166
entry:
130
167
%cmp1 = icmp sge i32 %n , -1
131
168
%n.div.2 = sdiv i32 %n , 2
@@ -144,8 +181,13 @@ exit:
144
181
145
182
define void @test_4neg (i32 %n ) nounwind {
146
183
; 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
+ ;
149
191
entry:
150
192
%cmp1 = icmp sge i32 %n , -2
151
193
%n.div.2 = sdiv i32 %n , 2
@@ -164,8 +206,13 @@ exit:
164
206
165
207
define void @test_ext_01 (i32 %n ) nounwind {
166
208
; 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
+ ;
169
216
entry:
170
217
%cmp1 = icmp sgt i32 %n , 1
171
218
%n.div.2 = sdiv i32 %n , 2
@@ -185,8 +232,13 @@ exit:
185
232
186
233
define void @test_ext_01neg (i32 %n ) nounwind {
187
234
; 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
+ ;
190
242
entry:
191
243
%cmp1 = icmp sgt i32 %n , 0
192
244
%n.div.2 = sdiv i32 %n , 2
@@ -206,8 +258,13 @@ exit:
206
258
207
259
define void @test_ext_02 (i32 %n ) nounwind {
208
260
; 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
+ ;
211
268
entry:
212
269
%cmp1 = icmp sge i32 %n , 2
213
270
%n.div.2 = sdiv i32 %n , 2
@@ -227,8 +284,13 @@ exit:
227
284
228
285
define void @test_ext_02neg (i32 %n ) nounwind {
229
286
; 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
+ ;
232
294
entry:
233
295
%cmp1 = icmp sge i32 %n , 1
234
296
%n.div.2 = sdiv i32 %n , 2
@@ -248,8 +310,13 @@ exit:
248
310
249
311
define void @test_ext_03 (i32 %n ) nounwind {
250
312
; 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
+ ;
253
320
entry:
254
321
%cmp1 = icmp sgt i32 %n , -2
255
322
%n.div.2 = sdiv i32 %n , 2
@@ -269,8 +336,13 @@ exit:
269
336
270
337
define void @test_ext_03neg (i32 %n ) nounwind {
271
338
; 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
+ ;
274
346
entry:
275
347
%cmp1 = icmp sgt i32 %n , -3
276
348
%n.div.2 = sdiv i32 %n , 2
@@ -290,8 +362,13 @@ exit:
290
362
291
363
define void @test_ext_04 (i32 %n ) nounwind {
292
364
; 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
+ ;
295
372
entry:
296
373
%cmp1 = icmp sge i32 %n , -1
297
374
%n.div.2 = sdiv i32 %n , 2
@@ -311,8 +388,13 @@ exit:
311
388
312
389
define void @test_ext_04neg (i32 %n ) nounwind {
313
390
; 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
+ ;
316
398
entry:
317
399
%cmp1 = icmp sge i32 %n , -2
318
400
%n.div.2 = sdiv i32 %n , 2
0 commit comments