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 int i = 0; i < 50; i++) {
11 ;; *B++ = A[i + 10][i + 9];
13 define void @couple0([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
17 ; CHECK-LABEL: couple0
18 ; CHECK: da analyze - none!
19 ; CHECK: da analyze - none!
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 %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
30 store i32 %conv, i32* %arrayidx1, align 4
31 %add = add nsw i64 %i.02, 9
32 %add2 = add nsw i64 %i.02, 10
33 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add2, i64 %add
34 %0 = load i32, i32* %arrayidx4, align 4
35 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
36 store i32 %0, i32* %B.addr.01, align 4
37 %inc = add nsw i64 %i.02, 1
38 %exitcond = icmp ne i64 %inc, 50
39 br i1 %exitcond, label %for.body, label %for.end
41 for.end: ; preds = %for.body
46 ;; for (long int i = 0; i < 50; i++) {
48 ;; *B++ = A[i + 9][i + 9];
50 define void @couple1([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
54 ; CHECK-LABEL: couple1
55 ; CHECK: da analyze - none!
56 ; CHECK: da analyze - consistent flow [-9]!
57 ; CHECK: da analyze - confused!
58 ; CHECK: da analyze - none!
59 ; CHECK: da analyze - confused!
60 ; CHECK: da analyze - none!
62 for.body: ; preds = %entry, %for.body
63 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
64 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
65 %conv = trunc i64 %i.02 to i32
66 %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
67 store i32 %conv, i32* %arrayidx1, align 4
68 %add = add nsw i64 %i.02, 9
69 %add2 = add nsw i64 %i.02, 9
70 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add2, i64 %add
71 %0 = load i32, i32* %arrayidx4, align 4
72 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
73 store i32 %0, i32* %B.addr.01, align 4
74 %inc = add nsw i64 %i.02, 1
75 %exitcond = icmp ne i64 %inc, 50
76 br i1 %exitcond, label %for.body, label %for.end
78 for.end: ; preds = %for.body
83 ;; for (long int i = 0; i < 50; i++) {
84 ;; A[3*i - 6][3*i - 6] = i;
87 define void @couple2([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
91 ; CHECK-LABEL: couple2
92 ; CHECK: da analyze - none!
93 ; CHECK: da analyze - flow [<]!
94 ; CHECK: da analyze - confused!
95 ; CHECK: da analyze - none!
96 ; CHECK: da analyze - confused!
97 ; CHECK: da analyze - none!
99 for.body: ; preds = %entry, %for.body
100 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
101 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
102 %conv = trunc i64 %i.02 to i32
103 %mul = mul nsw i64 %i.02, 3
104 %sub = add nsw i64 %mul, -6
105 %mul1 = mul nsw i64 %i.02, 3
106 %sub2 = add nsw i64 %mul1, -6
107 %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub2, i64 %sub
108 store i32 %conv, i32* %arrayidx3, align 4
109 %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
110 %0 = load i32, i32* %arrayidx5, align 4
111 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
112 store i32 %0, i32* %B.addr.01, align 4
113 %inc = add nsw i64 %i.02, 1
114 %exitcond = icmp ne i64 %inc, 50
115 br i1 %exitcond, label %for.body, label %for.end
117 for.end: ; preds = %for.body
122 ;; for (long int i = 0; i < 50; i++) {
123 ;; A[3*i - 6][3*i - 5] = i;
126 define void @couple3([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
130 ; CHECK-LABEL: couple3
131 ; CHECK: da analyze - none!
132 ; CHECK: da analyze - none!
133 ; CHECK: da analyze - confused!
134 ; CHECK: da analyze - none!
135 ; CHECK: da analyze - confused!
136 ; CHECK: da analyze - none!
138 for.body: ; preds = %entry, %for.body
139 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
140 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
141 %conv = trunc i64 %i.02 to i32
142 %mul = mul nsw i64 %i.02, 3
143 %sub = add nsw i64 %mul, -5
144 %mul1 = mul nsw i64 %i.02, 3
145 %sub2 = add nsw i64 %mul1, -6
146 %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub2, i64 %sub
147 store i32 %conv, i32* %arrayidx3, align 4
148 %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
149 %0 = load i32, i32* %arrayidx5, align 4
150 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
151 store i32 %0, i32* %B.addr.01, align 4
152 %inc = add nsw i64 %i.02, 1
153 %exitcond = icmp ne i64 %inc, 50
154 br i1 %exitcond, label %for.body, label %for.end
156 for.end: ; preds = %for.body
161 ;; for (long int i = 0; i < 50; i++) {
162 ;; A[3*i - 6][3*i - n] = i;
165 define void @couple4([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
169 ; CHECK-LABEL: couple4
170 ; CHECK: da analyze - none!
171 ; CHECK: da analyze - flow [*|<]!
172 ; CHECK: da analyze - confused!
173 ; CHECK: da analyze - none!
174 ; CHECK: da analyze - confused!
175 ; CHECK: da analyze - none!
177 for.body: ; preds = %entry, %for.body
178 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
179 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
180 %conv = trunc i64 %i.02 to i32
181 %mul = mul nsw i64 %i.02, 3
182 %conv1 = sext i32 %n to i64
183 %sub = sub nsw i64 %mul, %conv1
184 %mul2 = mul nsw i64 %i.02, 3
185 %sub3 = add nsw i64 %mul2, -6
186 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub3, i64 %sub
187 store i32 %conv, i32* %arrayidx4, align 4
188 %arrayidx6 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
189 %0 = load i32, i32* %arrayidx6, align 4
190 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
191 store i32 %0, i32* %B.addr.01, align 4
192 %inc = add nsw i64 %i.02, 1
193 %exitcond = icmp ne i64 %inc, 50
194 br i1 %exitcond, label %for.body, label %for.end
196 for.end: ; preds = %for.body
201 ;; for (long int i = 0; i < 50; i++) {
202 ;; A[3*i - n + 1][3*i - n] = i;
205 define void @couple5([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
209 ; CHECK-LABEL: couple5
210 ; CHECK: da analyze - none!
211 ; CHECK: da analyze - none!
212 ; CHECK: da analyze - confused!
213 ; CHECK: da analyze - none!
214 ; CHECK: da analyze - confused!
215 ; CHECK: da analyze - none!
217 for.body: ; preds = %entry, %for.body
218 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
219 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
220 %conv = trunc i64 %i.02 to i32
221 %mul = mul nsw i64 %i.02, 3
222 %conv1 = sext i32 %n to i64
223 %sub = sub nsw i64 %mul, %conv1
224 %mul2 = mul nsw i64 %i.02, 3
225 %conv3 = sext i32 %n to i64
226 %sub4 = sub nsw i64 %mul2, %conv3
227 %add = add nsw i64 %sub4, 1
228 %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add, i64 %sub
229 store i32 %conv, i32* %arrayidx5, align 4
230 %arrayidx7 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
231 %0 = load i32, i32* %arrayidx7, align 4
232 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
233 store i32 %0, i32* %B.addr.01, align 4
234 %inc = add nsw i64 %i.02, 1
235 %exitcond = icmp ne i64 %inc, 50
236 br i1 %exitcond, label %for.body, label %for.end
238 for.end: ; preds = %for.body
243 ;; for (long int i = 0; i < 50; i++) {
244 ;; A[i][3*i - 6] = i;
247 define void @couple6([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
251 ; CHECK-LABEL: couple6
252 ; CHECK: da analyze - none!
253 ; CHECK: da analyze - flow [<]!
254 ; CHECK: da analyze - confused!
255 ; CHECK: da analyze - none!
256 ; CHECK: da analyze - confused!
257 ; CHECK: da analyze - none!
259 for.body: ; preds = %entry, %for.body
260 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
261 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
262 %conv = trunc i64 %i.02 to i32
263 %mul = mul nsw i64 %i.02, 3
264 %sub = add nsw i64 %mul, -6
265 %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %sub
266 store i32 %conv, i32* %arrayidx1, align 4
267 %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
268 %0 = load i32, i32* %arrayidx3, align 4
269 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
270 store i32 %0, i32* %B.addr.01, align 4
271 %inc = add nsw i64 %i.02, 1
272 %exitcond = icmp ne i64 %inc, 50
273 br i1 %exitcond, label %for.body, label %for.end
275 for.end: ; preds = %for.body
280 ;; for (long int i = 0; i < 50; i++) {
281 ;; A[i][3*i - 5] = i;
284 define void @couple7([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
288 ; CHECK-LABEL: couple7
289 ; CHECK: da analyze - none!
290 ; CHECK: da analyze - none!
291 ; CHECK: da analyze - confused!
292 ; CHECK: da analyze - none!
293 ; CHECK: da analyze - confused!
294 ; CHECK: da analyze - none!
296 for.body: ; preds = %entry, %for.body
297 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
298 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
299 %conv = trunc i64 %i.02 to i32
300 %mul = mul nsw i64 %i.02, 3
301 %sub = add nsw i64 %mul, -5
302 %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %sub
303 store i32 %conv, i32* %arrayidx1, align 4
304 %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
305 %0 = load i32, i32* %arrayidx3, align 4
306 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
307 store i32 %0, i32* %B.addr.01, align 4
308 %inc = add nsw i64 %i.02, 1
309 %exitcond = icmp ne i64 %inc, 50
310 br i1 %exitcond, label %for.body, label %for.end
312 for.end: ; preds = %for.body
317 ;; for (long int i = 0; i <= 15; i++) {
318 ;; A[3*i - 18][3 - i] = i;
321 define void @couple8([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
325 ; CHECK-LABEL: couple8
326 ; CHECK: da analyze - none!
327 ; CHECK: da analyze - none!
328 ; CHECK: da analyze - confused!
329 ; CHECK: da analyze - none!
330 ; CHECK: da analyze - confused!
331 ; CHECK: da analyze - none!
333 for.body: ; preds = %entry, %for.body
334 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
335 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
336 %conv = trunc i64 %i.02 to i32
337 %sub = sub nsw i64 3, %i.02
338 %mul = mul nsw i64 %i.02, 3
339 %sub1 = add nsw i64 %mul, -18
340 %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub1, i64 %sub
341 store i32 %conv, i32* %arrayidx2, align 4
342 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
343 %0 = load i32, i32* %arrayidx4, align 4
344 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
345 store i32 %0, i32* %B.addr.01, align 4
346 %inc = add nsw i64 %i.02, 1
347 %exitcond = icmp ne i64 %inc, 16
348 br i1 %exitcond, label %for.body, label %for.end
350 for.end: ; preds = %for.body
355 ;; for (long int i = 0; i <= 15; i++) {
356 ;; A[3*i - 18][2 - i] = i;
359 define void @couple9([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
363 ; CHECK-LABEL: couple9
364 ; CHECK: da analyze - none!
365 ; CHECK: da analyze - none!
366 ; CHECK: da analyze - confused!
367 ; CHECK: da analyze - none!
368 ; CHECK: da analyze - confused!
369 ; CHECK: da analyze - none!
371 for.body: ; preds = %entry, %for.body
372 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
373 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
374 %conv = trunc i64 %i.02 to i32
375 %sub = sub nsw i64 2, %i.02
376 %mul = mul nsw i64 %i.02, 3
377 %sub1 = add nsw i64 %mul, -18
378 %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub1, i64 %sub
379 store i32 %conv, i32* %arrayidx2, align 4
380 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
381 %0 = load i32, i32* %arrayidx4, align 4
382 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
383 store i32 %0, i32* %B.addr.01, align 4
384 %inc = add nsw i64 %i.02, 1
385 %exitcond = icmp ne i64 %inc, 16
386 br i1 %exitcond, label %for.body, label %for.end
388 for.end: ; preds = %for.body
393 ;; for (long int i = 0; i <= 15; i++) {
394 ;; A[3*i - 18][6 - i] = i;
397 define void @couple10([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
401 ; CHECK-LABEL: couple10
402 ; CHECK: da analyze - none!
403 ; CHECK: da analyze - flow [>]!
404 ; CHECK: da analyze - confused!
405 ; CHECK: da analyze - none!
406 ; CHECK: da analyze - confused!
407 ; CHECK: da analyze - none!
409 for.body: ; preds = %entry, %for.body
410 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
411 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
412 %conv = trunc i64 %i.02 to i32
413 %sub = sub nsw i64 6, %i.02
414 %mul = mul nsw i64 %i.02, 3
415 %sub1 = add nsw i64 %mul, -18
416 %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub1, i64 %sub
417 store i32 %conv, i32* %arrayidx2, align 4
418 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
419 %0 = load i32, i32* %arrayidx4, align 4
420 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
421 store i32 %0, i32* %B.addr.01, align 4
422 %inc = add nsw i64 %i.02, 1
423 %exitcond = icmp ne i64 %inc, 16
424 br i1 %exitcond, label %for.body, label %for.end
426 for.end: ; preds = %for.body
431 ;; for (long int i = 0; i <= 15; i++) {
432 ;; A[3*i - 18][18 - i] = i;
435 define void @couple11([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
439 ; CHECK-LABEL: couple11
440 ; CHECK: da analyze - none!
441 ; CHECK: da analyze - flow [>]!
442 ; CHECK: da analyze - confused!
443 ; CHECK: da analyze - none!
444 ; CHECK: da analyze - confused!
445 ; CHECK: da analyze - none!
447 for.body: ; preds = %entry, %for.body
448 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
449 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
450 %conv = trunc i64 %i.02 to i32
451 %sub = sub nsw i64 18, %i.02
452 %mul = mul nsw i64 %i.02, 3
453 %sub1 = add nsw i64 %mul, -18
454 %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub1, i64 %sub
455 store i32 %conv, i32* %arrayidx2, align 4
456 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
457 %0 = load i32, i32* %arrayidx4, align 4
458 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
459 store i32 %0, i32* %B.addr.01, align 4
460 %inc = add nsw i64 %i.02, 1
461 %exitcond = icmp ne i64 %inc, 16
462 br i1 %exitcond, label %for.body, label %for.end
464 for.end: ; preds = %for.body
469 ;; for (long int i = 0; i <= 12; i++) {
470 ;; A[3*i - 18][22 - i] = i;
473 define void @couple12([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
477 ; CHECK-LABEL: couple12
478 ; CHECK: da analyze - none!
479 ; CHECK: da analyze - flow [>]!
480 ; CHECK: da analyze - confused!
481 ; CHECK: da analyze - none!
482 ; CHECK: da analyze - confused!
483 ; CHECK: da analyze - none!
485 for.body: ; preds = %entry, %for.body
486 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
487 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
488 %conv = trunc i64 %i.02 to i32
489 %sub = sub nsw i64 22, %i.02
490 %mul = mul nsw i64 %i.02, 3
491 %sub1 = add nsw i64 %mul, -18
492 %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub1, i64 %sub
493 store i32 %conv, i32* %arrayidx2, align 4
494 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
495 %0 = load i32, i32* %arrayidx4, align 4
496 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
497 store i32 %0, i32* %B.addr.01, align 4
498 %inc = add nsw i64 %i.02, 1
499 %exitcond = icmp ne i64 %inc, 13
500 br i1 %exitcond, label %for.body, label %for.end
502 for.end: ; preds = %for.body
507 ;; for (long int i = 0; i < 12; i++) {
508 ;; A[3*i - 18][22 - i] = i;
511 define void @couple13([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
515 ; CHECK-LABEL: couple13
516 ; CHECK: da analyze - none!
517 ; CHECK: da analyze - none!
518 ; CHECK: da analyze - confused!
519 ; CHECK: da analyze - none!
520 ; CHECK: da analyze - confused!
521 ; CHECK: da analyze - none!
523 for.body: ; preds = %entry, %for.body
524 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
525 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
526 %conv = trunc i64 %i.02 to i32
527 %sub = sub nsw i64 22, %i.02
528 %mul = mul nsw i64 %i.02, 3
529 %sub1 = add nsw i64 %mul, -18
530 %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub1, i64 %sub
531 store i32 %conv, i32* %arrayidx2, align 4
532 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.02, i64 %i.02
533 %0 = load i32, i32* %arrayidx4, align 4
534 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
535 store i32 %0, i32* %B.addr.01, align 4
536 %inc = add nsw i64 %i.02, 1
537 %exitcond = icmp ne i64 %inc, 12
538 br i1 %exitcond, label %for.body, label %for.end
540 for.end: ; preds = %for.body
544 ;; for (long int i = 0; i < 100; i++) {
545 ;; A[3*i - 18][18 - i][i] = i;
546 ;; *B++ = A[i][i][i];
548 define void @couple14([100 x [100 x i32]]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
552 ; CHECK-LABEL: couple14
553 ; CHECK: da analyze - none!
554 ; CHECK: da analyze - flow [<]!
555 ; CHECK: da analyze - confused!
556 ; CHECK: da analyze - none!
557 ; CHECK: da analyze - confused!
558 ; CHECK: da analyze - none!
560 for.body: ; preds = %entry, %for.body
561 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
562 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
563 %conv = trunc i64 %i.02 to i32
564 %sub = sub nsw i64 18, %i.02
565 %mul = mul nsw i64 %i.02, 3
566 %sub1 = add nsw i64 %mul, -18
567 %arrayidx3 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %sub1, i64 %sub, i64 %i.02
568 store i32 %conv, i32* %arrayidx3, align 4
569 %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %i.02, i64 %i.02, i64 %i.02
570 %0 = load i32, i32* %arrayidx6, align 4
571 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
572 store i32 %0, i32* %B.addr.01, align 4
573 %inc = add nsw i64 %i.02, 1
574 %exitcond = icmp ne i64 %inc, 100
575 br i1 %exitcond, label %for.body, label %for.end
577 for.end: ; preds = %for.body
582 ;; for (long int i = 0; i < 100; i++) {
583 ;; A[3*i - 18][22 - i][i] = i;
584 ;; *B++ = A[i][i][i];
586 define void @couple15([100 x [100 x i32]]* %A, i32* %B, i32 %n) nounwind uwtable ssp {
590 ; CHECK-LABEL: couple15
591 ; CHECK: da analyze - none!
592 ; CHECK: da analyze - none!
593 ; CHECK: da analyze - confused!
594 ; CHECK: da analyze - none!
595 ; CHECK: da analyze - confused!
596 ; CHECK: da analyze - none!
598 for.body: ; preds = %entry, %for.body
599 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
600 %B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
601 %conv = trunc i64 %i.02 to i32
602 %sub = sub nsw i64 22, %i.02
603 %mul = mul nsw i64 %i.02, 3
604 %sub1 = add nsw i64 %mul, -18
605 %arrayidx3 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %sub1, i64 %sub, i64 %i.02
606 store i32 %conv, i32* %arrayidx3, align 4
607 %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %i.02, i64 %i.02, i64 %i.02
608 %0 = load i32, i32* %arrayidx6, align 4
609 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
610 store i32 %0, i32* %B.addr.01, align 4
611 %inc = add nsw i64 %i.02, 1
612 %exitcond = icmp ne i64 %inc, 100
613 br i1 %exitcond, label %for.body, label %for.end
615 for.end: ; preds = %for.body
619 ;; for(int i = 0; i < N; i+=1) {
621 ;; for(int j = 0; j < M; j+=1)
622 ;; A[M*N + M*i + j] = 2;
624 define void @couple_weakzerosiv(i32* noalias nocapture %A, i64 %N, i64 %M) {
626 %cmp29 = icmp sgt i64 %N, 0
627 br i1 %cmp29, label %for.body.lr.ph, label %for.cond.cleanup
629 ; CHECK-LABEL: couple_weakzerosiv
630 ; CHECK: da analyze - none!
631 ; CHECK: da analyze - output [p>]!
632 ; CHECK: da analyze - none!
634 for.body.lr.ph: ; preds = %entry
635 %mul = mul nsw i64 %M, %N
636 br label %for.body.us
638 for.body.us: ; preds = %for.body.lr.ph, %for.cond.cleanup4.loopexit.us
639 %i.030.us = phi i64 [ %add12.us, %for.cond.cleanup4.loopexit.us ], [ 0, %for.body.lr.ph ]
640 %mul1.us = mul nsw i64 %i.030.us, %mul
641 %arrayidx.us = getelementptr inbounds i32, i32* %A, i64 %mul1.us
642 store i32 1, i32* %arrayidx.us, align 4
643 %mul6.us = mul nsw i64 %i.030.us, %M
644 %add.us = add i64 %mul6.us, %mul
645 br label %for.body5.us
647 for.body5.us: ; preds = %for.body5.us, %for.body.us
648 %j.028.us = phi i64 [ 0, %for.body.us ], [ %add10.us, %for.body5.us ]
649 %add8.us = add i64 %add.us, %j.028.us
650 %arrayidx9.us = getelementptr inbounds i32, i32* %A, i64 %add8.us
651 store i32 2, i32* %arrayidx9.us, align 4
652 %add10.us = add nuw nsw i64 %j.028.us, 1
653 %exitcond.us = icmp eq i64 %add10.us, %M
654 br i1 %exitcond.us, label %for.cond.cleanup4.loopexit.us, label %for.body5.us
656 for.cond.cleanup4.loopexit.us: ; preds = %for.body5.us
657 %add12.us = add nuw nsw i64 %i.030.us, 1
658 %exitcond31.us = icmp eq i64 %add12.us, %N
659 br i1 %exitcond31.us, label %for.cond.cleanup, label %for.body.us
661 for.cond.cleanup: ; preds = %for.cond.cleanup4.loopexit.us, %entry