1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
3 ; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
5 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
6 target triple = "x86_64-apple-macosx10.6.0"
9 ;; for (long unsigned i = 0; i < 10; i++) {
13 define void @exact0(i32* %A, i32* %B) nounwind uwtable ssp {
18 ; CHECK: da analyze - none!
19 ; CHECK: da analyze - flow [>]!
20 ; CHECK: da analyze - confused!
21 ; CHECK: da analyze - none!
22 ; CHECK: da analyze - confused!
23 ; CHECK: da analyze - none!
25 for.body: ; preds = %entry, %for.body
26 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
27 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
28 %conv = trunc i64 %i.02 to i32
29 %add = add i64 %i.02, 10
30 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
31 store i32 %conv, i32* %arrayidx, align 4
32 %mul = shl i64 %i.02, 1
33 %add13 = or i64 %mul, 1
34 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %add13
35 %0 = load i32, i32* %arrayidx2, align 4
36 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
37 store i32 %0, i32* %B.addr.01, align 4
38 %inc = add i64 %i.02, 1
39 %exitcond = icmp ne i64 %inc, 10
40 br i1 %exitcond, label %for.body, label %for.end
42 for.end: ; preds = %for.body
47 ;; for (long unsigned i = 0; i < 10; i++) {
51 define void @exact1(i32* %A, i32* %B) nounwind uwtable ssp {
56 ; CHECK: da analyze - none!
57 ; CHECK: da analyze - none!
58 ; CHECK: da analyze - confused!
59 ; CHECK: da analyze - none!
60 ; CHECK: da analyze - confused!
61 ; CHECK: da analyze - none!
63 for.body: ; preds = %entry, %for.body
64 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
65 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
66 %conv = trunc i64 %i.02 to i32
67 %mul = shl i64 %i.02, 2
68 %add = add i64 %mul, 10
69 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
70 store i32 %conv, i32* %arrayidx, align 4
71 %mul1 = shl i64 %i.02, 1
72 %add23 = or i64 %mul1, 1
73 %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %add23
74 %0 = load i32, i32* %arrayidx3, align 4
75 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
76 store i32 %0, i32* %B.addr.01, align 4
77 %inc = add i64 %i.02, 1
78 %exitcond = icmp ne i64 %inc, 10
79 br i1 %exitcond, label %for.body, label %for.end
81 for.end: ; preds = %for.body
86 ;; for (long unsigned i = 0; i < 10; i++) {
90 define void @exact2(i32* %A, i32* %B) nounwind uwtable ssp {
95 ; CHECK: da analyze - none!
96 ; CHECK: da analyze - none!
97 ; CHECK: da analyze - confused!
98 ; CHECK: da analyze - none!
99 ; CHECK: da analyze - confused!
100 ; CHECK: da analyze - none!
102 for.body: ; preds = %entry, %for.body
103 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
104 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
105 %conv = trunc i64 %i.02 to i32
106 %mul = mul i64 %i.02, 6
107 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
108 store i32 %conv, i32* %arrayidx, align 4
109 %add = add i64 %i.02, 60
110 %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %add
111 %0 = load i32, i32* %arrayidx1, align 4
112 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
113 store i32 %0, i32* %B.addr.01, align 4
114 %inc = add i64 %i.02, 1
115 %exitcond = icmp ne i64 %inc, 10
116 br i1 %exitcond, label %for.body, label %for.end
118 for.end: ; preds = %for.body
123 ;; for (long unsigned i = 0; i <= 10; i++) {
127 define void @exact3(i32* %A, i32* %B) nounwind uwtable ssp {
131 ; CHECK-LABEL: exact3
132 ; CHECK: da analyze - none!
133 ; CHECK: da analyze - flow [<]!
134 ; CHECK: da analyze - confused!
135 ; CHECK: da analyze - none!
136 ; CHECK: da analyze - confused!
137 ; CHECK: da analyze - none!
139 for.body: ; preds = %entry, %for.body
140 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
141 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
142 %conv = trunc i64 %i.02 to i32
143 %mul = mul i64 %i.02, 6
144 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
145 store i32 %conv, i32* %arrayidx, align 4
146 %add = add i64 %i.02, 60
147 %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %add
148 %0 = load i32, i32* %arrayidx1, align 4
149 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
150 store i32 %0, i32* %B.addr.01, align 4
151 %inc = add i64 %i.02, 1
152 %exitcond = icmp ne i64 %inc, 11
153 br i1 %exitcond, label %for.body, label %for.end
155 for.end: ; preds = %for.body
160 ;; for (long unsigned i = 0; i < 12; i++) {
164 define void @exact4(i32* %A, i32* %B) nounwind uwtable ssp {
168 ; CHECK-LABEL: exact4
169 ; CHECK: da analyze - none!
170 ; CHECK: da analyze - flow [<]!
171 ; CHECK: da analyze - confused!
172 ; CHECK: da analyze - none!
173 ; CHECK: da analyze - confused!
174 ; CHECK: da analyze - none!
176 for.body: ; preds = %entry, %for.body
177 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
178 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
179 %conv = trunc i64 %i.02 to i32
180 %mul = mul i64 %i.02, 6
181 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
182 store i32 %conv, i32* %arrayidx, align 4
183 %add = add i64 %i.02, 60
184 %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %add
185 %0 = load i32, i32* %arrayidx1, align 4
186 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
187 store i32 %0, i32* %B.addr.01, align 4
188 %inc = add i64 %i.02, 1
189 %exitcond = icmp ne i64 %inc, 12
190 br i1 %exitcond, label %for.body, label %for.end
192 for.end: ; preds = %for.body
197 ;; for (long unsigned i = 0; i <= 12; i++) {
201 define void @exact5(i32* %A, i32* %B) nounwind uwtable ssp {
205 ; CHECK-LABEL: exact5
206 ; CHECK: da analyze - none!
207 ; CHECK: da analyze - flow [<]!
208 ; CHECK: da analyze - confused!
209 ; CHECK: da analyze - none!
210 ; CHECK: da analyze - confused!
211 ; CHECK: da analyze - none!
213 for.body: ; preds = %entry, %for.body
214 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
215 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
216 %conv = trunc i64 %i.02 to i32
217 %mul = mul i64 %i.02, 6
218 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
219 store i32 %conv, i32* %arrayidx, align 4
220 %add = add i64 %i.02, 60
221 %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %add
222 %0 = load i32, i32* %arrayidx1, align 4
223 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
224 store i32 %0, i32* %B.addr.01, align 4
225 %inc = add i64 %i.02, 1
226 %exitcond = icmp ne i64 %inc, 13
227 br i1 %exitcond, label %for.body, label %for.end
229 for.end: ; preds = %for.body
234 ;; for (long unsigned i = 0; i < 18; i++) {
238 define void @exact6(i32* %A, i32* %B) nounwind uwtable ssp {
242 ; CHECK-LABEL: exact6
243 ; CHECK: da analyze - none!
244 ; CHECK: da analyze - flow [<]!
245 ; CHECK: da analyze - confused!
246 ; CHECK: da analyze - none!
247 ; CHECK: da analyze - confused!
248 ; CHECK: da analyze - none!
250 for.body: ; preds = %entry, %for.body
251 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
252 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
253 %conv = trunc i64 %i.02 to i32
254 %mul = mul i64 %i.02, 6
255 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
256 store i32 %conv, i32* %arrayidx, align 4
257 %add = add i64 %i.02, 60
258 %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %add
259 %0 = load i32, i32* %arrayidx1, align 4
260 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
261 store i32 %0, i32* %B.addr.01, align 4
262 %inc = add i64 %i.02, 1
263 %exitcond = icmp ne i64 %inc, 18
264 br i1 %exitcond, label %for.body, label %for.end
266 for.end: ; preds = %for.body
271 ;; for (long unsigned i = 0; i <= 18; i++) {
275 define void @exact7(i32* %A, i32* %B) nounwind uwtable ssp {
279 ; CHECK-LABEL: exact7
280 ; CHECK: da analyze - none!
281 ; CHECK: da analyze - flow [<]!
282 ; CHECK: da analyze - confused!
283 ; CHECK: da analyze - none!
284 ; CHECK: da analyze - confused!
285 ; CHECK: da analyze - none!
287 for.body: ; preds = %entry, %for.body
288 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
289 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
290 %conv = trunc i64 %i.02 to i32
291 %mul = mul i64 %i.02, 6
292 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
293 store i32 %conv, i32* %arrayidx, align 4
294 %add = add i64 %i.02, 60
295 %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %add
296 %0 = load i32, i32* %arrayidx1, align 4
297 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
298 store i32 %0, i32* %B.addr.01, align 4
299 %inc = add i64 %i.02, 1
300 %exitcond = icmp ne i64 %inc, 19
301 br i1 %exitcond, label %for.body, label %for.end
303 for.end: ; preds = %for.body
308 ;; for (long unsigned i = 0; i < 10; i++) {
310 ;; *B++ = A[-i - 60];
312 define void @exact8(i32* %A, i32* %B) nounwind uwtable ssp {
316 ; CHECK-LABEL: exact8
317 ; CHECK: da analyze - none!
318 ; CHECK: da analyze - none!
319 ; CHECK: da analyze - confused!
320 ; CHECK: da analyze - none!
321 ; CHECK: da analyze - confused!
322 ; CHECK: da analyze - none!
324 for.body: ; preds = %entry, %for.body
325 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
326 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
327 %conv = trunc i64 %i.02 to i32
328 %mul = mul i64 %i.02, -6
329 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
330 store i32 %conv, i32* %arrayidx, align 4
331 %sub1 = sub i64 -60, %i.02
332 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub1
333 %0 = load i32, i32* %arrayidx2, align 4
334 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
335 store i32 %0, i32* %B.addr.01, align 4
336 %inc = add i64 %i.02, 1
337 %exitcond = icmp ne i64 %inc, 10
338 br i1 %exitcond, label %for.body, label %for.end
340 for.end: ; preds = %for.body
345 ;; for (long unsigned i = 0; i <= 10; i++) {
347 ;; *B++ = A[-i - 60];
349 define void @exact9(i32* %A, i32* %B) nounwind uwtable ssp {
353 ; CHECK-LABEL: exact9
354 ; CHECK: da analyze - none!
355 ; CHECK: da analyze - flow [<]!
356 ; CHECK: da analyze - confused!
357 ; CHECK: da analyze - none!
358 ; CHECK: da analyze - confused!
359 ; CHECK: da analyze - none!
361 for.body: ; preds = %entry, %for.body
362 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
363 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
364 %conv = trunc i64 %i.02 to i32
365 %mul = mul i64 %i.02, -6
366 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
367 store i32 %conv, i32* %arrayidx, align 4
368 %sub1 = sub i64 -60, %i.02
369 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub1
370 %0 = load i32, i32* %arrayidx2, align 4
371 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
372 store i32 %0, i32* %B.addr.01, align 4
373 %inc = add i64 %i.02, 1
374 %exitcond = icmp ne i64 %inc, 11
375 br i1 %exitcond, label %for.body, label %for.end
377 for.end: ; preds = %for.body
382 ;; for (long unsigned i = 0; i < 12; i++) {
384 ;; *B++ = A[-i - 60];
386 define void @exact10(i32* %A, i32* %B) nounwind uwtable ssp {
390 ; CHECK-LABEL: exact10
391 ; CHECK: da analyze - none!
392 ; CHECK: da analyze - flow [<]!
393 ; CHECK: da analyze - confused!
394 ; CHECK: da analyze - none!
395 ; CHECK: da analyze - confused!
396 ; CHECK: da analyze - none!
398 for.body: ; preds = %entry, %for.body
399 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
400 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
401 %conv = trunc i64 %i.02 to i32
402 %mul = mul i64 %i.02, -6
403 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
404 store i32 %conv, i32* %arrayidx, align 4
405 %sub1 = sub i64 -60, %i.02
406 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub1
407 %0 = load i32, i32* %arrayidx2, align 4
408 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
409 store i32 %0, i32* %B.addr.01, align 4
410 %inc = add i64 %i.02, 1
411 %exitcond = icmp ne i64 %inc, 12
412 br i1 %exitcond, label %for.body, label %for.end
414 for.end: ; preds = %for.body
419 ;; for (long unsigned i = 0; i <= 12; i++) {
421 ;; *B++ = A[-i - 60];
423 define void @exact11(i32* %A, i32* %B) nounwind uwtable ssp {
427 ; CHECK-LABEL: exact11
428 ; CHECK: da analyze - none!
429 ; CHECK: da analyze - flow [<]!
430 ; CHECK: da analyze - confused!
431 ; CHECK: da analyze - none!
432 ; CHECK: da analyze - confused!
433 ; CHECK: da analyze - none!
435 for.body: ; preds = %entry, %for.body
436 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
437 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
438 %conv = trunc i64 %i.02 to i32
439 %mul = mul i64 %i.02, -6
440 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
441 store i32 %conv, i32* %arrayidx, align 4
442 %sub1 = sub i64 -60, %i.02
443 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub1
444 %0 = load i32, i32* %arrayidx2, align 4
445 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
446 store i32 %0, i32* %B.addr.01, align 4
447 %inc = add i64 %i.02, 1
448 %exitcond = icmp ne i64 %inc, 13
449 br i1 %exitcond, label %for.body, label %for.end
451 for.end: ; preds = %for.body
456 ;; for (long unsigned i = 0; i < 18; i++) {
458 ;; *B++ = A[-i - 60];
460 define void @exact12(i32* %A, i32* %B) nounwind uwtable ssp {
464 ; CHECK-LABEL: exact12
465 ; CHECK: da analyze - none!
466 ; CHECK: da analyze - flow [<]!
467 ; CHECK: da analyze - confused!
468 ; CHECK: da analyze - none!
469 ; CHECK: da analyze - confused!
470 ; CHECK: da analyze - none!
472 for.body: ; preds = %entry, %for.body
473 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
474 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
475 %conv = trunc i64 %i.02 to i32
476 %mul = mul i64 %i.02, -6
477 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
478 store i32 %conv, i32* %arrayidx, align 4
479 %sub1 = sub i64 -60, %i.02
480 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub1
481 %0 = load i32, i32* %arrayidx2, align 4
482 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
483 store i32 %0, i32* %B.addr.01, align 4
484 %inc = add i64 %i.02, 1
485 %exitcond = icmp ne i64 %inc, 18
486 br i1 %exitcond, label %for.body, label %for.end
488 for.end: ; preds = %for.body
493 ;; for (long unsigned i = 0; i <= 18; i++) {
495 ;; *B++ = A[-i - 60];
497 define void @exact13(i32* %A, i32* %B) nounwind uwtable ssp {
501 ; CHECK-LABEL: exact13
502 ; CHECK: da analyze - none!
503 ; CHECK: da analyze - flow [<]!
504 ; CHECK: da analyze - confused!
505 ; CHECK: da analyze - none!
506 ; CHECK: da analyze - confused!
507 ; CHECK: da analyze - none!
509 for.body: ; preds = %entry, %for.body
510 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
511 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
512 %conv = trunc i64 %i.02 to i32
513 %mul = mul i64 %i.02, -6
514 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
515 store i32 %conv, i32* %arrayidx, align 4
516 %sub1 = sub i64 -60, %i.02
517 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub1
518 %0 = load i32, i32* %arrayidx2, align 4
519 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
520 store i32 %0, i32* %B.addr.01, align 4
521 %inc = add i64 %i.02, 1
522 %exitcond = icmp ne i64 %inc, 19
523 br i1 %exitcond, label %for.body, label %for.end
525 for.end: ; preds = %for.body