1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 2>&1 2>&1 | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @unsimplified_and1(i32 %n) {
8 ; CHECK-LABEL: 'unsimplified_and1'
9 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and1
10 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
11 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
12 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
13 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
14 ; CHECK-NEXT: Predicates:
15 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
21 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
22 %iv.inc = add nsw i32 %iv, 1
23 %becond = icmp ule i32 %iv.inc, %n
24 %and = and i1 %becond, true
25 br i1 %and, label %loop, label %leave
31 define void @unsimplified_and2(i32 %n) {
32 ; CHECK-LABEL: 'unsimplified_and2'
33 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and2
34 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
35 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
36 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
37 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
38 ; CHECK-NEXT: Predicates:
39 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
45 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
46 %iv.inc = add nsw i32 %iv, 1
47 %becond = icmp ule i32 %iv.inc, %n
48 %and = and i1 true, %becond
49 br i1 %and, label %loop, label %leave
55 define void @unsimplified_and3(i32 %n) {
56 ; CHECK-LABEL: 'unsimplified_and3'
57 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and3
58 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
59 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is false
60 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is false
61 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
62 ; CHECK-NEXT: Predicates:
63 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
69 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
70 %iv.inc = add nsw i32 %iv, 1
71 %becond = icmp ule i32 %iv.inc, %n
72 %and = and i1 false, %becond
73 br i1 %and, label %loop, label %leave
79 define void @unsimplified_and4(i32 %n) {
80 ; CHECK-LABEL: 'unsimplified_and4'
81 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and4
82 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
83 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is false
84 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is false
85 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
86 ; CHECK-NEXT: Predicates:
87 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
93 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
94 %iv.inc = add nsw i32 %iv, 1
95 %becond = icmp ule i32 %iv.inc, %n
96 %and = and i1 %becond, false
97 br i1 %and, label %loop, label %leave
103 define void @unsimplified_or1(i32 %n) {
104 ; CHECK-LABEL: 'unsimplified_or1'
105 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or1
106 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
107 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
108 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
109 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
115 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
116 %iv.inc = add nsw i32 %iv, 1
117 %becond = icmp ule i32 %iv.inc, %n
118 %or = or i1 %becond, true
119 br i1 %or, label %loop, label %leave
125 define void @unsimplified_or2(i32 %n) {
126 ; CHECK-LABEL: 'unsimplified_or2'
127 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or2
128 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
129 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
130 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
131 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
137 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
138 %iv.inc = add nsw i32 %iv, 1
139 %becond = icmp ule i32 %iv.inc, %n
140 %or = or i1 true, %becond
141 br i1 %or, label %loop, label %leave
147 define void @unsimplified_or3(i32 %n) {
148 ; CHECK-LABEL: 'unsimplified_or3'
149 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or3
150 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
151 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
152 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
153 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
154 ; CHECK-NEXT: Predicates:
155 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
161 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
162 %iv.inc = add nsw i32 %iv, 1
163 %becond = icmp ule i32 %iv.inc, %n
164 %or = or i1 false, %becond
165 br i1 %or, label %loop, label %leave
171 define void @unsimplified_or4(i32 %n) {
172 ; CHECK-LABEL: 'unsimplified_or4'
173 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or4
174 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
175 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
176 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
177 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
178 ; CHECK-NEXT: Predicates:
179 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
185 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
186 %iv.inc = add nsw i32 %iv, 1
187 %becond = icmp ule i32 %iv.inc, %n
188 %or = or i1 %becond, false
189 br i1 %or, label %loop, label %leave
195 define void @reversed_and1(i32 %n) {
196 ; CHECK-LABEL: 'reversed_and1'
197 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and1
198 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
199 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
200 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
201 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
202 ; CHECK-NEXT: Predicates:
203 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
209 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
210 %iv.inc = add nsw i32 %iv, 1
211 %becond = icmp ugt i32 %iv.inc, %n
212 %and = and i1 %becond, true
213 br i1 %and, label %leave, label %loop
219 define void @reversed_and2(i32 %n) {
220 ; CHECK-LABEL: 'reversed_and2'
221 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and2
222 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
223 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
224 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
225 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
226 ; CHECK-NEXT: Predicates:
227 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
233 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
234 %iv.inc = add nsw i32 %iv, 1
235 %becond = icmp ugt i32 %iv.inc, %n
236 %and = and i1 true, %becond
237 br i1 %and, label %leave, label %loop
243 define void @reversed_and3(i32 %n) {
244 ; CHECK-LABEL: 'reversed_and3'
245 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and3
246 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
247 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
248 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
249 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
255 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
256 %iv.inc = add nsw i32 %iv, 1
257 %becond = icmp ugt i32 %iv.inc, %n
258 %and = and i1 false, %becond
259 br i1 %and, label %leave, label %loop
265 define void @reversed_and4(i32 %n) {
266 ; CHECK-LABEL: 'reversed_and4'
267 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and4
268 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
269 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
270 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
271 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
277 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
278 %iv.inc = add nsw i32 %iv, 1
279 %becond = icmp ugt i32 %iv.inc, %n
280 %and = and i1 %becond, false
281 br i1 %and, label %leave, label %loop
287 define void @reversed_or1(i32 %n) {
288 ; CHECK-LABEL: 'reversed_or1'
289 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or1
290 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
291 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is false
292 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is false
293 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
294 ; CHECK-NEXT: Predicates:
295 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
301 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
302 %iv.inc = add nsw i32 %iv, 1
303 %becond = icmp ugt i32 %iv.inc, %n
304 %or = or i1 %becond, true
305 br i1 %or, label %leave, label %loop
311 define void @reversed_or2(i32 %n) {
312 ; CHECK-LABEL: 'reversed_or2'
313 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or2
314 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
315 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is false
316 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is false
317 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
318 ; CHECK-NEXT: Predicates:
319 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
325 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
326 %iv.inc = add nsw i32 %iv, 1
327 %becond = icmp ugt i32 %iv.inc, %n
328 %or = or i1 true, %becond
329 br i1 %or, label %leave, label %loop
335 define void @reversed_or3(i32 %n) {
336 ; CHECK-LABEL: 'reversed_or3'
337 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or3
338 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
339 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
340 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
341 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
342 ; CHECK-NEXT: Predicates:
343 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
349 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
350 %iv.inc = add nsw i32 %iv, 1
351 %becond = icmp ugt i32 %iv.inc, %n
352 %or = or i1 false, %becond
353 br i1 %or, label %leave, label %loop
359 define void @reversed_or4(i32 %n) {
360 ; CHECK-LABEL: 'reversed_or4'
361 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or4
362 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
363 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
364 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
365 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
366 ; CHECK-NEXT: Predicates:
367 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
373 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
374 %iv.inc = add nsw i32 %iv, 1
375 %becond = icmp ugt i32 %iv.inc, %n
376 %or = or i1 %becond, false
377 br i1 %or, label %leave, label %loop