1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" -S -scalar-evolution-classify-expressions=0 < %s 2>&1 | FileCheck %s
5 ; - starting at 0, 1, or %x
7 ; - stopping at %n or ptr2
10 ; Some of these represent missed opportunities.
12 define void @foo(i4 %n) {
14 ; CHECK-NEXT: Determining loop execution counts for: @foo
15 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %n)
16 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 6
17 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + %n)
18 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + %n)
19 ; CHECK-NEXT: Predicates:
20 ; CHECK: Loop %loop: Trip multiple is 1
23 %s = icmp sgt i4 %n, 0
24 br i1 %s, label %loop, label %exit
26 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
27 %i.next = add i4 %i, 1
28 %t = icmp slt i4 %i.next, %n
29 br i1 %t, label %loop, label %exit
34 define void @step2(i4 %n) {
35 ; CHECK-LABEL: 'step2'
36 ; CHECK-NEXT: Determining loop execution counts for: @step2
37 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
38 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
39 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
40 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
43 %s = icmp sgt i4 %n, 0
44 br i1 %s, label %loop, label %exit
46 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
47 %i.next = add i4 %i, 2
48 %t = icmp slt i4 %i.next, %n
49 br i1 %t, label %loop, label %exit
54 define void @start1(i4 %n) {
55 ; CHECK-LABEL: 'start1'
56 ; CHECK-NEXT: Determining loop execution counts for: @start1
57 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-2 + (2 smax %n))<nsw>
58 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 5
59 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-2 + (2 smax %n))<nsw>
60 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-2 + (2 smax %n))<nsw>
61 ; CHECK-NEXT: Predicates:
62 ; CHECK: Loop %loop: Trip multiple is 1
65 %s = icmp sgt i4 %n, 0
66 br i1 %s, label %loop, label %exit
68 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
69 %i.next = add i4 %i, 1
70 %t = icmp slt i4 %i.next, %n
71 br i1 %t, label %loop, label %exit
76 define void @start1_step2(i4 %n) {
77 ; CHECK-LABEL: 'start1_step2'
78 ; CHECK-NEXT: Determining loop execution counts for: @start1_step2
79 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
80 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
81 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
82 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
85 %s = icmp sgt i4 %n, 0
86 br i1 %s, label %loop, label %exit
88 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
89 %i.next = add i4 %i, 2
90 %t = icmp slt i4 %i.next, %n
91 br i1 %t, label %loop, label %exit
96 define void @startx(i4 %n, i4 %x) {
97 ; CHECK-LABEL: 'startx'
98 ; CHECK-NEXT: Determining loop execution counts for: @startx
99 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
100 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
101 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
102 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
103 ; CHECK-NEXT: Predicates:
104 ; CHECK: Loop %loop: Trip multiple is 1
107 %s = icmp sgt i4 %n, 0
108 br i1 %s, label %loop, label %exit
110 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
111 %i.next = add i4 %i, 1
112 %t = icmp slt i4 %i.next, %n
113 br i1 %t, label %loop, label %exit
118 define void @startx_step2(i4 %n, i4 %x) {
119 ; CHECK-LABEL: 'startx_step2'
120 ; CHECK-NEXT: Determining loop execution counts for: @startx_step2
121 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
122 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
123 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
124 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
127 %s = icmp sgt i4 %n, 0
128 br i1 %s, label %loop, label %exit
130 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
131 %i.next = add i4 %i, 2
132 %t = icmp slt i4 %i.next, %n
133 br i1 %t, label %loop, label %exit
138 define void @nsw(i4 %n) {
140 ; CHECK-NEXT: Determining loop execution counts for: @nsw
141 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %n)
142 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 6
143 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + %n)
144 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + %n)
145 ; CHECK-NEXT: Predicates:
146 ; CHECK: Loop %loop: Trip multiple is 1
149 %s = icmp sgt i4 %n, 0
150 br i1 %s, label %loop, label %exit
152 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
153 %i.next = add nsw i4 %i, 1
154 %t = icmp slt i4 %i.next, %n
155 br i1 %t, label %loop, label %exit
160 ; If %n is INT4_MAX, %i.next will wrap. The nsw bit says that the
161 ; result is undefined. Therefore, after the loop's second iteration,
162 ; we are free to assume that the loop exits. This is valid because:
163 ; (a) %i.next is a poison value after the second iteration, which can
164 ; also be considered an undef value.
165 ; (b) the return instruction enacts a side effect that is control
166 ; dependent on the poison value.
168 define void @nsw_step2(i4 %n) {
169 ; CHECK-LABEL: 'nsw_step2'
170 ; CHECK-NEXT: Determining loop execution counts for: @nsw_step2
171 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + %n) /u 2)
172 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 2
173 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-1 + %n) /u 2)
174 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-1 + %n) /u 2)
175 ; CHECK-NEXT: Predicates:
176 ; CHECK: Loop %loop: Trip multiple is 1
179 %s = icmp sgt i4 %n, 0
180 br i1 %s, label %loop, label %exit
182 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
183 %i.next = add nsw i4 %i, 2
184 %t = icmp slt i4 %i.next, %n
185 br i1 %t, label %loop, label %exit
190 define void @nsw_start1(i4 %n) {
191 ; CHECK-LABEL: 'nsw_start1'
192 ; CHECK-NEXT: Determining loop execution counts for: @nsw_start1
193 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-2 + (2 smax %n))<nsw>
194 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 5
195 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-2 + (2 smax %n))<nsw>
196 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-2 + (2 smax %n))<nsw>
197 ; CHECK-NEXT: Predicates:
198 ; CHECK: Loop %loop: Trip multiple is 1
201 %s = icmp sgt i4 %n, 0
202 br i1 %s, label %loop, label %exit
204 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
205 %i.next = add nsw i4 %i, 1
206 %t = icmp slt i4 %i.next, %n
207 br i1 %t, label %loop, label %exit
212 define void @nsw_start1_step2(i4 %n) {
213 ; CHECK-LABEL: 'nsw_start1_step2'
214 ; CHECK-NEXT: Determining loop execution counts for: @nsw_start1_step2
215 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-2 + (3 smax %n))<nsw> /u 2)
216 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 2
217 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-2 + (3 smax %n))<nsw> /u 2)
218 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-2 + (3 smax %n))<nsw> /u 2)
219 ; CHECK-NEXT: Predicates:
220 ; CHECK: Loop %loop: Trip multiple is 1
223 %s = icmp sgt i4 %n, 0
224 br i1 %s, label %loop, label %exit
226 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
227 %i.next = add nsw i4 %i, 2
228 %t = icmp slt i4 %i.next, %n
229 br i1 %t, label %loop, label %exit
234 define void @nsw_startx(i4 %n, i4 %x) {
235 ; CHECK-LABEL: 'nsw_startx'
236 ; CHECK-NEXT: Determining loop execution counts for: @nsw_startx
237 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
238 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
239 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
240 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
241 ; CHECK-NEXT: Predicates:
242 ; CHECK: Loop %loop: Trip multiple is 1
245 %s = icmp sgt i4 %n, 0
246 br i1 %s, label %loop, label %exit
248 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
249 %i.next = add nsw i4 %i, 1
250 %t = icmp slt i4 %i.next, %n
251 br i1 %t, label %loop, label %exit
256 define void @nsw_startx_step2(i4 %n, i4 %x) {
257 ; CHECK-LABEL: 'nsw_startx_step2'
258 ; CHECK-NEXT: Determining loop execution counts for: @nsw_startx_step2
259 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax %n)) /u 2)
260 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 7
261 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax %n)) /u 2)
262 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax %n)) /u 2)
263 ; CHECK-NEXT: Predicates:
264 ; CHECK: Loop %loop: Trip multiple is 1
267 %s = icmp sgt i4 %n, 0
268 br i1 %s, label %loop, label %exit
270 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
271 %i.next = add nsw i4 %i, 2
272 %t = icmp slt i4 %i.next, %n
273 br i1 %t, label %loop, label %exit
278 define void @even(i4 %n) {
279 ; CHECK-LABEL: 'even'
280 ; CHECK-NEXT: Determining loop execution counts for: @even
281 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (2 * %n))
282 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 5
283 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (2 * %n))
284 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (2 * %n))
285 ; CHECK-NEXT: Predicates:
286 ; CHECK: Loop %loop: Trip multiple is 2
290 %s = icmp sgt i4 %m, 0
291 br i1 %s, label %loop, label %exit
293 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
294 %i.next = add i4 %i, 1
295 %t = icmp slt i4 %i.next, %m
296 br i1 %t, label %loop, label %exit
301 define void @even_step2(i4 %n) {
302 ; CHECK-LABEL: 'even_step2'
303 ; CHECK-NEXT: Determining loop execution counts for: @even_step2
304 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + (2 * %n)) /u 2)
305 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 2
306 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-1 + (2 * %n)) /u 2)
307 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-1 + (2 * %n)) /u 2)
308 ; CHECK-NEXT: Predicates:
309 ; CHECK: Loop %loop: Trip multiple is 1
313 %s = icmp sgt i4 %m, 0
314 br i1 %s, label %loop, label %exit
316 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
317 %i.next = add i4 %i, 2
318 %t = icmp slt i4 %i.next, %m
319 br i1 %t, label %loop, label %exit
324 define void @even_start1(i4 %n) {
325 ; CHECK-LABEL: 'even_start1'
326 ; CHECK-NEXT: Determining loop execution counts for: @even_start1
327 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-2 + (2 * %n))
328 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4
329 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-2 + (2 * %n))
330 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-2 + (2 * %n))
331 ; CHECK-NEXT: Predicates:
332 ; CHECK: Loop %loop: Trip multiple is 1
336 %s = icmp sgt i4 %m, 0
337 br i1 %s, label %loop, label %exit
339 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
340 %i.next = add i4 %i, 1
341 %t = icmp slt i4 %i.next, %m
342 br i1 %t, label %loop, label %exit
347 define void @even_start1_step2(i4 %n) {
348 ; CHECK-LABEL: 'even_start1_step2'
349 ; CHECK-NEXT: Determining loop execution counts for: @even_start1_step2
350 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-2 + (2 * %n)) /u 2)
351 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 2
352 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-2 + (2 * %n)) /u 2)
353 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-2 + (2 * %n)) /u 2)
354 ; CHECK-NEXT: Predicates:
355 ; CHECK: Loop %loop: Trip multiple is 1
359 %s = icmp sgt i4 %m, 0
360 br i1 %s, label %loop, label %exit
362 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
363 %i.next = add i4 %i, 2
364 %t = icmp slt i4 %i.next, %m
365 br i1 %t, label %loop, label %exit
370 define void @even_startx(i4 %n, i4 %x) {
371 ; CHECK-LABEL: 'even_startx'
372 ; CHECK-NEXT: Determining loop execution counts for: @even_startx
373 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
374 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -2
375 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
376 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
377 ; CHECK-NEXT: Predicates:
378 ; CHECK: Loop %loop: Trip multiple is 1
382 %s = icmp sgt i4 %m, 0
383 br i1 %s, label %loop, label %exit
385 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
386 %i.next = add i4 %i, 1
387 %t = icmp slt i4 %i.next, %m
388 br i1 %t, label %loop, label %exit
393 define void @even_startx_step2(i4 %n, i4 %x) {
394 ; CHECK-LABEL: 'even_startx_step2'
395 ; CHECK-NEXT: Determining loop execution counts for: @even_startx_step2
396 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
397 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 7
398 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
399 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
400 ; CHECK-NEXT: Predicates:
401 ; CHECK: Loop %loop: Trip multiple is 1
405 %s = icmp sgt i4 %m, 0
406 br i1 %s, label %loop, label %exit
408 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
409 %i.next = add i4 %i, 2
410 %t = icmp slt i4 %i.next, %m
411 br i1 %t, label %loop, label %exit
416 define void @even_nsw(i4 %n) {
417 ; CHECK-LABEL: 'even_nsw'
418 ; CHECK-NEXT: Determining loop execution counts for: @even_nsw
419 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (2 * %n))
420 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 5
421 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (2 * %n))
422 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (2 * %n))
423 ; CHECK-NEXT: Predicates:
424 ; CHECK: Loop %loop: Trip multiple is 2
428 %s = icmp sgt i4 %m, 0
429 br i1 %s, label %loop, label %exit
431 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
432 %i.next = add nsw i4 %i, 1
433 %t = icmp slt i4 %i.next, %m
434 br i1 %t, label %loop, label %exit
439 define void @even_nsw_step2(i4 %n) {
440 ; CHECK-LABEL: 'even_nsw_step2'
441 ; CHECK-NEXT: Determining loop execution counts for: @even_nsw_step2
442 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + (2 * %n)) /u 2)
443 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 2
444 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-1 + (2 * %n)) /u 2)
445 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-1 + (2 * %n)) /u 2)
446 ; CHECK-NEXT: Predicates:
447 ; CHECK: Loop %loop: Trip multiple is 1
451 %s = icmp sgt i4 %m, 0
452 br i1 %s, label %loop, label %exit
454 %i = phi i4 [ 0, %entry ], [ %i.next, %loop ]
455 %i.next = add nsw i4 %i, 2
456 %t = icmp slt i4 %i.next, %m
457 br i1 %t, label %loop, label %exit
462 define void @even_nsw_start1(i4 %n) {
463 ; CHECK-LABEL: 'even_nsw_start1'
464 ; CHECK-NEXT: Determining loop execution counts for: @even_nsw_start1
465 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-2 + (2 * %n))
466 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4
467 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-2 + (2 * %n))
468 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-2 + (2 * %n))
469 ; CHECK-NEXT: Predicates:
470 ; CHECK: Loop %loop: Trip multiple is 1
474 %s = icmp sgt i4 %m, 0
475 br i1 %s, label %loop, label %exit
477 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
478 %i.next = add nsw i4 %i, 1
479 %t = icmp slt i4 %i.next, %m
480 br i1 %t, label %loop, label %exit
485 define void @even_nsw_start1_step2(i4 %n) {
486 ; CHECK-LABEL: 'even_nsw_start1_step2'
487 ; CHECK-NEXT: Determining loop execution counts for: @even_nsw_start1_step2
488 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-2 + (2 * %n)) /u 2)
489 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 2
490 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-2 + (2 * %n)) /u 2)
491 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-2 + (2 * %n)) /u 2)
492 ; CHECK-NEXT: Predicates:
493 ; CHECK: Loop %loop: Trip multiple is 1
497 %s = icmp sgt i4 %m, 0
498 br i1 %s, label %loop, label %exit
500 %i = phi i4 [ 1, %entry ], [ %i.next, %loop ]
501 %i.next = add nsw i4 %i, 2
502 %t = icmp slt i4 %i.next, %m
503 br i1 %t, label %loop, label %exit
508 define void @even_nsw_startx(i4 %n, i4 %x) {
509 ; CHECK-LABEL: 'even_nsw_startx'
510 ; CHECK-NEXT: Determining loop execution counts for: @even_nsw_startx
511 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
512 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -2
513 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
514 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
515 ; CHECK-NEXT: Predicates:
516 ; CHECK: Loop %loop: Trip multiple is 1
520 %s = icmp sgt i4 %m, 0
521 br i1 %s, label %loop, label %exit
523 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
524 %i.next = add nsw i4 %i, 1
525 %t = icmp slt i4 %i.next, %m
526 br i1 %t, label %loop, label %exit
531 define void @even_nsw_startx_step2(i4 %n, i4 %x) {
532 ; CHECK-LABEL: 'even_nsw_startx_step2'
533 ; CHECK-NEXT: Determining loop execution counts for: @even_nsw_startx_step2
534 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
535 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 7
536 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
537 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
538 ; CHECK-NEXT: Predicates:
539 ; CHECK: Loop %loop: Trip multiple is 1
543 %s = icmp sgt i4 %m, 0
544 br i1 %s, label %loop, label %exit
546 %i = phi i4 [ %x, %entry ], [ %i.next, %loop ]
547 %i.next = add nsw i4 %i, 2
548 %t = icmp slt i4 %i.next, %m
549 br i1 %t, label %loop, label %exit