1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-classify-expressions=0 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: max backedge-taken count is -1
12 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
13 ; CHECK-NEXT: Predicates:
14 ; CHECK: Loop %loop: Trip multiple is 1
20 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
21 %iv.inc = add nsw i32 %iv, 1
22 %becond = icmp ule i32 %iv.inc, %n
23 %and = and i1 %becond, true
24 br i1 %and, label %loop, label %leave
30 define void @unsimplified_and2(i32 %n) {
31 ; CHECK-LABEL: 'unsimplified_and2'
32 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and2
33 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
34 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
35 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
36 ; CHECK-NEXT: Predicates:
37 ; CHECK: Loop %loop: Trip multiple is 1
43 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
44 %iv.inc = add nsw i32 %iv, 1
45 %becond = icmp ule i32 %iv.inc, %n
46 %and = and i1 true, %becond
47 br i1 %and, label %loop, label %leave
53 define void @unsimplified_and3(i32 %n) {
54 ; CHECK-LABEL: 'unsimplified_and3'
55 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and3
56 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
57 ; CHECK-NEXT: Loop %loop: max backedge-taken count is false
58 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
59 ; CHECK-NEXT: Predicates:
60 ; CHECK: Loop %loop: Trip multiple is 1
66 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
67 %iv.inc = add nsw i32 %iv, 1
68 %becond = icmp ule i32 %iv.inc, %n
69 %and = and i1 false, %becond
70 br i1 %and, label %loop, label %leave
76 define void @unsimplified_and4(i32 %n) {
77 ; CHECK-LABEL: 'unsimplified_and4'
78 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and4
79 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
80 ; CHECK-NEXT: Loop %loop: max backedge-taken count is false
81 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
82 ; CHECK-NEXT: Predicates:
83 ; CHECK: Loop %loop: Trip multiple is 1
89 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
90 %iv.inc = add nsw i32 %iv, 1
91 %becond = icmp ule i32 %iv.inc, %n
92 %and = and i1 %becond, false
93 br i1 %and, label %loop, label %leave
99 define void @unsimplified_or1(i32 %n) {
100 ; CHECK-LABEL: 'unsimplified_or1'
101 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or1
102 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
103 ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count.
104 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
110 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
111 %iv.inc = add nsw i32 %iv, 1
112 %becond = icmp ule i32 %iv.inc, %n
113 %or = or i1 %becond, true
114 br i1 %or, label %loop, label %leave
120 define void @unsimplified_or2(i32 %n) {
121 ; CHECK-LABEL: 'unsimplified_or2'
122 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or2
123 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
124 ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count.
125 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
131 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
132 %iv.inc = add nsw i32 %iv, 1
133 %becond = icmp ule i32 %iv.inc, %n
134 %or = or i1 true, %becond
135 br i1 %or, label %loop, label %leave
141 define void @unsimplified_or3(i32 %n) {
142 ; CHECK-LABEL: 'unsimplified_or3'
143 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or3
144 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
145 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
146 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
147 ; CHECK-NEXT: Predicates:
148 ; CHECK: Loop %loop: Trip multiple is 1
154 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
155 %iv.inc = add nsw i32 %iv, 1
156 %becond = icmp ule i32 %iv.inc, %n
157 %or = or i1 false, %becond
158 br i1 %or, label %loop, label %leave
164 define void @unsimplified_or4(i32 %n) {
165 ; CHECK-LABEL: 'unsimplified_or4'
166 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or4
167 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
168 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
169 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
170 ; CHECK-NEXT: Predicates:
171 ; CHECK: Loop %loop: Trip multiple is 1
177 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
178 %iv.inc = add nsw i32 %iv, 1
179 %becond = icmp ule i32 %iv.inc, %n
180 %or = or i1 %becond, false
181 br i1 %or, label %loop, label %leave
187 define void @reversed_and1(i32 %n) {
188 ; CHECK-LABEL: 'reversed_and1'
189 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and1
190 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
191 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
192 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
193 ; CHECK-NEXT: Predicates:
194 ; CHECK: Loop %loop: Trip multiple is 1
200 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
201 %iv.inc = add nsw i32 %iv, 1
202 %becond = icmp ugt i32 %iv.inc, %n
203 %and = and i1 %becond, true
204 br i1 %and, label %leave, label %loop
210 define void @reversed_and2(i32 %n) {
211 ; CHECK-LABEL: 'reversed_and2'
212 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and2
213 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
214 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
215 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
216 ; CHECK-NEXT: Predicates:
217 ; CHECK: Loop %loop: Trip multiple is 1
223 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
224 %iv.inc = add nsw i32 %iv, 1
225 %becond = icmp ugt i32 %iv.inc, %n
226 %and = and i1 true, %becond
227 br i1 %and, label %leave, label %loop
233 define void @reversed_and3(i32 %n) {
234 ; CHECK-LABEL: 'reversed_and3'
235 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and3
236 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
237 ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count.
238 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
244 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
245 %iv.inc = add nsw i32 %iv, 1
246 %becond = icmp ugt i32 %iv.inc, %n
247 %and = and i1 false, %becond
248 br i1 %and, label %leave, label %loop
254 define void @reversed_and4(i32 %n) {
255 ; CHECK-LABEL: 'reversed_and4'
256 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and4
257 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
258 ; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count.
259 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
265 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
266 %iv.inc = add nsw i32 %iv, 1
267 %becond = icmp ugt i32 %iv.inc, %n
268 %and = and i1 %becond, false
269 br i1 %and, label %leave, label %loop
275 define void @reversed_or1(i32 %n) {
276 ; CHECK-LABEL: 'reversed_or1'
277 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or1
278 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
279 ; CHECK-NEXT: Loop %loop: max backedge-taken count is false
280 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
281 ; CHECK-NEXT: Predicates:
282 ; CHECK: Loop %loop: Trip multiple is 1
288 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
289 %iv.inc = add nsw i32 %iv, 1
290 %becond = icmp ugt i32 %iv.inc, %n
291 %or = or i1 %becond, true
292 br i1 %or, label %leave, label %loop
298 define void @reversed_or2(i32 %n) {
299 ; CHECK-LABEL: 'reversed_or2'
300 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or2
301 ; CHECK-NEXT: Loop %loop: backedge-taken count is false
302 ; CHECK-NEXT: Loop %loop: max backedge-taken count is false
303 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is false
304 ; CHECK-NEXT: Predicates:
305 ; CHECK: Loop %loop: Trip multiple is 1
311 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
312 %iv.inc = add nsw i32 %iv, 1
313 %becond = icmp ugt i32 %iv.inc, %n
314 %or = or i1 true, %becond
315 br i1 %or, label %leave, label %loop
321 define void @reversed_or3(i32 %n) {
322 ; CHECK-LABEL: 'reversed_or3'
323 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or3
324 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
325 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
326 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
327 ; CHECK-NEXT: Predicates:
328 ; CHECK: Loop %loop: Trip multiple is 1
334 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
335 %iv.inc = add nsw i32 %iv, 1
336 %becond = icmp ugt i32 %iv.inc, %n
337 %or = or i1 false, %becond
338 br i1 %or, label %leave, label %loop
344 define void @reversed_or4(i32 %n) {
345 ; CHECK-LABEL: 'reversed_or4'
346 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or4
347 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
348 ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
349 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %n
350 ; CHECK-NEXT: Predicates:
351 ; CHECK: Loop %loop: Trip multiple is 1
357 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
358 %iv.inc = add nsw i32 %iv, 1
359 %becond = icmp ugt i32 %iv.inc, %n
360 %or = or i1 %becond, false
361 br i1 %or, label %leave, label %loop