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 i32 -1
12 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
13 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
19 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
20 %iv.inc = add nsw i32 %iv, 1
21 %becond = icmp ule i32 %iv.inc, %n
22 %and = and i1 %becond, true
23 br i1 %and, label %loop, label %leave
29 define void @unsimplified_and2(i32 %n) {
30 ; CHECK-LABEL: 'unsimplified_and2'
31 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and2
32 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
33 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
34 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
35 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
41 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
42 %iv.inc = add nsw i32 %iv, 1
43 %becond = icmp ule i32 %iv.inc, %n
44 %and = and i1 true, %becond
45 br i1 %and, label %loop, label %leave
51 define void @unsimplified_and3(i32 %n) {
52 ; CHECK-LABEL: 'unsimplified_and3'
53 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and3
54 ; CHECK-NEXT: Loop %loop: backedge-taken count is i1 false
55 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i1 false
56 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is i1 false
57 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
63 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
64 %iv.inc = add nsw i32 %iv, 1
65 %becond = icmp ule i32 %iv.inc, %n
66 %and = and i1 false, %becond
67 br i1 %and, label %loop, label %leave
73 define void @unsimplified_and4(i32 %n) {
74 ; CHECK-LABEL: 'unsimplified_and4'
75 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_and4
76 ; CHECK-NEXT: Loop %loop: backedge-taken count is i1 false
77 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i1 false
78 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is i1 false
79 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
85 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
86 %iv.inc = add nsw i32 %iv, 1
87 %becond = icmp ule i32 %iv.inc, %n
88 %and = and i1 %becond, false
89 br i1 %and, label %loop, label %leave
95 define void @unsimplified_or1(i32 %n) {
96 ; CHECK-LABEL: 'unsimplified_or1'
97 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or1
98 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
99 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
100 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
106 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
107 %iv.inc = add nsw i32 %iv, 1
108 %becond = icmp ule i32 %iv.inc, %n
109 %or = or i1 %becond, true
110 br i1 %or, label %loop, label %leave
116 define void @unsimplified_or2(i32 %n) {
117 ; CHECK-LABEL: 'unsimplified_or2'
118 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or2
119 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
120 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
121 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
127 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
128 %iv.inc = add nsw i32 %iv, 1
129 %becond = icmp ule i32 %iv.inc, %n
130 %or = or i1 true, %becond
131 br i1 %or, label %loop, label %leave
137 define void @unsimplified_or3(i32 %n) {
138 ; CHECK-LABEL: 'unsimplified_or3'
139 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or3
140 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
141 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
142 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
143 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
149 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
150 %iv.inc = add nsw i32 %iv, 1
151 %becond = icmp ule i32 %iv.inc, %n
152 %or = or i1 false, %becond
153 br i1 %or, label %loop, label %leave
159 define void @unsimplified_or4(i32 %n) {
160 ; CHECK-LABEL: 'unsimplified_or4'
161 ; CHECK-NEXT: Determining loop execution counts for: @unsimplified_or4
162 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
163 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
164 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
165 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
171 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
172 %iv.inc = add nsw i32 %iv, 1
173 %becond = icmp ule i32 %iv.inc, %n
174 %or = or i1 %becond, false
175 br i1 %or, label %loop, label %leave
181 define void @reversed_and1(i32 %n) {
182 ; CHECK-LABEL: 'reversed_and1'
183 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and1
184 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
185 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
186 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
187 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
193 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
194 %iv.inc = add nsw i32 %iv, 1
195 %becond = icmp ugt i32 %iv.inc, %n
196 %and = and i1 %becond, true
197 br i1 %and, label %leave, label %loop
203 define void @reversed_and2(i32 %n) {
204 ; CHECK-LABEL: 'reversed_and2'
205 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and2
206 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
207 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
208 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
209 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
215 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
216 %iv.inc = add nsw i32 %iv, 1
217 %becond = icmp ugt i32 %iv.inc, %n
218 %and = and i1 true, %becond
219 br i1 %and, label %leave, label %loop
225 define void @reversed_and3(i32 %n) {
226 ; CHECK-LABEL: 'reversed_and3'
227 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and3
228 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
229 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
230 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
236 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
237 %iv.inc = add nsw i32 %iv, 1
238 %becond = icmp ugt i32 %iv.inc, %n
239 %and = and i1 false, %becond
240 br i1 %and, label %leave, label %loop
246 define void @reversed_and4(i32 %n) {
247 ; CHECK-LABEL: 'reversed_and4'
248 ; CHECK-NEXT: Determining loop execution counts for: @reversed_and4
249 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
250 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
251 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
257 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
258 %iv.inc = add nsw i32 %iv, 1
259 %becond = icmp ugt i32 %iv.inc, %n
260 %and = and i1 %becond, false
261 br i1 %and, label %leave, label %loop
267 define void @reversed_or1(i32 %n) {
268 ; CHECK-LABEL: 'reversed_or1'
269 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or1
270 ; CHECK-NEXT: Loop %loop: backedge-taken count is i1 false
271 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i1 false
272 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is i1 false
273 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
279 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
280 %iv.inc = add nsw i32 %iv, 1
281 %becond = icmp ugt i32 %iv.inc, %n
282 %or = or i1 %becond, true
283 br i1 %or, label %leave, label %loop
289 define void @reversed_or2(i32 %n) {
290 ; CHECK-LABEL: 'reversed_or2'
291 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or2
292 ; CHECK-NEXT: Loop %loop: backedge-taken count is i1 false
293 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i1 false
294 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is i1 false
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 true, %becond
305 br i1 %or, label %leave, label %loop
311 define void @reversed_or3(i32 %n) {
312 ; CHECK-LABEL: 'reversed_or3'
313 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or3
314 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
315 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
316 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
317 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
323 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
324 %iv.inc = add nsw i32 %iv, 1
325 %becond = icmp ugt i32 %iv.inc, %n
326 %or = or i1 false, %becond
327 br i1 %or, label %leave, label %loop
333 define void @reversed_or4(i32 %n) {
334 ; CHECK-LABEL: 'reversed_or4'
335 ; CHECK-NEXT: Determining loop execution counts for: @reversed_or4
336 ; CHECK-NEXT: Loop %loop: backedge-taken count is %n
337 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 -1
338 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is %n
339 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
345 %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
346 %iv.inc = add nsw i32 %iv, 1
347 %becond = icmp ugt i32 %iv.inc, %n
348 %or = or i1 %becond, false
349 br i1 %or, label %leave, label %loop