1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
4 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"
5 target triple = "x86_64-apple-macosx10.6.0"
8 ;; for (long int i = 0; i < 50; i++)
9 ;; for (long int j = 0; j < 50; j++)
10 ;; for (long int k = 0; k < 50; k++)
11 ;; for (long int l = 0; l < 50; l++) {
12 ;; A[n][i][j + k] = i;
13 ;; *B++ = A[10][i + 10][2*j - l];
15 define void @sep0(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
17 br label %for.cond1.preheader
19 ; CHECK: da analyze - output [0 * * S]!
20 ; CHECK: da analyze - flow [* * * *|<]!
21 ; CHECK: da analyze - confused!
22 ; CHECK: da analyze - input [* * S *]!
23 ; CHECK: da analyze - confused!
24 ; CHECK: da analyze - none!
26 for.cond1.preheader: ; preds = %entry, %for.inc22
27 %B.addr.08 = phi ptr [ %B, %entry ], [ %scevgep11, %for.inc22 ]
28 %i.07 = phi i64 [ 0, %entry ], [ %inc23, %for.inc22 ]
29 br label %for.cond4.preheader
31 for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc19
32 %B.addr.16 = phi ptr [ %B.addr.08, %for.cond1.preheader ], [ %scevgep9, %for.inc19 ]
33 %j.05 = phi i64 [ 0, %for.cond1.preheader ], [ %inc20, %for.inc19 ]
34 br label %for.cond7.preheader
36 for.cond7.preheader: ; preds = %for.cond4.preheader, %for.inc16
37 %B.addr.24 = phi ptr [ %B.addr.16, %for.cond4.preheader ], [ %scevgep, %for.inc16 ]
38 %k.03 = phi i64 [ 0, %for.cond4.preheader ], [ %inc17, %for.inc16 ]
41 for.body9: ; preds = %for.cond7.preheader, %for.body9
42 %l.02 = phi i64 [ 0, %for.cond7.preheader ], [ %inc, %for.body9 ]
43 %B.addr.31 = phi ptr [ %B.addr.24, %for.cond7.preheader ], [ %incdec.ptr, %for.body9 ]
44 %conv = trunc i64 %i.07 to i32
45 %add = add nsw i64 %j.05, %k.03
46 %idxprom = sext i32 %n to i64
47 %arrayidx11 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %idxprom, i64 %i.07, i64 %add
48 store i32 %conv, ptr %arrayidx11, align 4
49 %mul = shl nsw i64 %j.05, 1
50 %sub = sub nsw i64 %mul, %l.02
51 %add12 = add nsw i64 %i.07, 10
52 %arrayidx15 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 10, i64 %add12, i64 %sub
53 %0 = load i32, ptr %arrayidx15, align 4
54 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.31, i64 1
55 store i32 %0, ptr %B.addr.31, align 4
56 %inc = add nsw i64 %l.02, 1
57 %exitcond = icmp ne i64 %inc, 50
58 br i1 %exitcond, label %for.body9, label %for.inc16
60 for.inc16: ; preds = %for.body9
61 %scevgep = getelementptr i32, ptr %B.addr.24, i64 50
62 %inc17 = add nsw i64 %k.03, 1
63 %exitcond10 = icmp ne i64 %inc17, 50
64 br i1 %exitcond10, label %for.cond7.preheader, label %for.inc19
66 for.inc19: ; preds = %for.inc16
67 %scevgep9 = getelementptr i32, ptr %B.addr.16, i64 2500
68 %inc20 = add nsw i64 %j.05, 1
69 %exitcond12 = icmp ne i64 %inc20, 50
70 br i1 %exitcond12, label %for.cond4.preheader, label %for.inc22
72 for.inc22: ; preds = %for.inc19
73 %scevgep11 = getelementptr i32, ptr %B.addr.08, i64 125000
74 %inc23 = add nsw i64 %i.07, 1
75 %exitcond13 = icmp ne i64 %inc23, 50
76 br i1 %exitcond13, label %for.cond1.preheader, label %for.end24
78 for.end24: ; preds = %for.inc22
83 ;; for (long int i = 0; i < 50; i++)
84 ;; for (long int j = 0; j < 50; j++)
85 ;; for (long int k = 0; k < 50; k++)
86 ;; for (long int l = 0; l < 50; l++) {
87 ;; A[i][i][j + k] = i;
88 ;; *B++ = A[10][i + 10][2*j - l];
90 define void @sep1(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
92 br label %for.cond1.preheader
94 ; CHECK: da analyze - output [0 * * S]!
95 ; CHECK: da analyze - flow [* * * *|<]!
96 ; CHECK: da analyze - confused!
97 ; CHECK: da analyze - input [* * S *]!
98 ; CHECK: da analyze - confused!
99 ; CHECK: da analyze - none!
101 for.cond1.preheader: ; preds = %entry, %for.inc22
102 %B.addr.08 = phi ptr [ %B, %entry ], [ %scevgep11, %for.inc22 ]
103 %i.07 = phi i64 [ 0, %entry ], [ %inc23, %for.inc22 ]
104 br label %for.cond4.preheader
106 for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc19
107 %B.addr.16 = phi ptr [ %B.addr.08, %for.cond1.preheader ], [ %scevgep9, %for.inc19 ]
108 %j.05 = phi i64 [ 0, %for.cond1.preheader ], [ %inc20, %for.inc19 ]
109 br label %for.cond7.preheader
111 for.cond7.preheader: ; preds = %for.cond4.preheader, %for.inc16
112 %B.addr.24 = phi ptr [ %B.addr.16, %for.cond4.preheader ], [ %scevgep, %for.inc16 ]
113 %k.03 = phi i64 [ 0, %for.cond4.preheader ], [ %inc17, %for.inc16 ]
116 for.body9: ; preds = %for.cond7.preheader, %for.body9
117 %l.02 = phi i64 [ 0, %for.cond7.preheader ], [ %inc, %for.body9 ]
118 %B.addr.31 = phi ptr [ %B.addr.24, %for.cond7.preheader ], [ %incdec.ptr, %for.body9 ]
119 %conv = trunc i64 %i.07 to i32
120 %add = add nsw i64 %j.05, %k.03
121 %arrayidx11 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %i.07, i64 %i.07, i64 %add
122 store i32 %conv, ptr %arrayidx11, align 4
123 %mul = shl nsw i64 %j.05, 1
124 %sub = sub nsw i64 %mul, %l.02
125 %add12 = add nsw i64 %i.07, 10
126 %arrayidx15 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 10, i64 %add12, i64 %sub
127 %0 = load i32, ptr %arrayidx15, align 4
128 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.31, i64 1
129 store i32 %0, ptr %B.addr.31, align 4
130 %inc = add nsw i64 %l.02, 1
131 %exitcond = icmp ne i64 %inc, 50
132 br i1 %exitcond, label %for.body9, label %for.inc16
134 for.inc16: ; preds = %for.body9
135 %scevgep = getelementptr i32, ptr %B.addr.24, i64 50
136 %inc17 = add nsw i64 %k.03, 1
137 %exitcond10 = icmp ne i64 %inc17, 50
138 br i1 %exitcond10, label %for.cond7.preheader, label %for.inc19
140 for.inc19: ; preds = %for.inc16
141 %scevgep9 = getelementptr i32, ptr %B.addr.16, i64 2500
142 %inc20 = add nsw i64 %j.05, 1
143 %exitcond12 = icmp ne i64 %inc20, 50
144 br i1 %exitcond12, label %for.cond4.preheader, label %for.inc22
146 for.inc22: ; preds = %for.inc19
147 %scevgep11 = getelementptr i32, ptr %B.addr.08, i64 125000
148 %inc23 = add nsw i64 %i.07, 1
149 %exitcond13 = icmp ne i64 %inc23, 50
150 br i1 %exitcond13, label %for.cond1.preheader, label %for.end24
152 for.end24: ; preds = %for.inc22
157 ;; for (long int i = 0; i < 50; i++)
158 ;; for (long int j = 0; j < 50; j++)
159 ;; for (long int k = 0; k < 50; k++)
160 ;; for (long int l = 0; l ptr -10]!
161 ;; for (long int l = 0; l < 50; l++) {
162 ;; A[i][i][i + k][l] = i;
163 ;; *B++ = A[10][i + 10][j + k][l + 10];
165 define void @sep2(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
167 br label %for.cond1.preheader
169 ; CHECK: da analyze - consistent output [0 S 0 0]!
170 ; CHECK: da analyze - flow [> * * -10]!
171 ; CHECK: da analyze - confused!
172 ; CHECK: da analyze - input [0 * * 0]!
173 ; CHECK: da analyze - confused!
174 ; CHECK: da analyze - none!
176 for.cond1.preheader: ; preds = %entry, %for.inc26
177 %B.addr.08 = phi ptr [ %B, %entry ], [ %scevgep11, %for.inc26 ]
178 %i.07 = phi i64 [ 0, %entry ], [ %inc27, %for.inc26 ]
179 br label %for.cond4.preheader
181 for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc23
182 %B.addr.16 = phi ptr [ %B.addr.08, %for.cond1.preheader ], [ %scevgep9, %for.inc23 ]
183 %j.05 = phi i64 [ 0, %for.cond1.preheader ], [ %inc24, %for.inc23 ]
184 br label %for.cond7.preheader
186 for.cond7.preheader: ; preds = %for.cond4.preheader, %for.inc20
187 %B.addr.24 = phi ptr [ %B.addr.16, %for.cond4.preheader ], [ %scevgep, %for.inc20 ]
188 %k.03 = phi i64 [ 0, %for.cond4.preheader ], [ %inc21, %for.inc20 ]
191 for.body9: ; preds = %for.cond7.preheader, %for.body9
192 %l.02 = phi i64 [ 0, %for.cond7.preheader ], [ %inc, %for.body9 ]
193 %B.addr.31 = phi ptr [ %B.addr.24, %for.cond7.preheader ], [ %incdec.ptr, %for.body9 ]
194 %conv = trunc i64 %i.07 to i32
195 %add = add nsw i64 %i.07, %k.03
196 %arrayidx12 = getelementptr inbounds [100 x [100 x [100 x i32]]], ptr %A, i64 %i.07, i64 %i.07, i64 %add, i64 %l.02
197 store i32 %conv, ptr %arrayidx12, align 4
198 %add13 = add nsw i64 %l.02, 10
199 %add14 = add nsw i64 %j.05, %k.03
200 %add15 = add nsw i64 %i.07, 10
201 %arrayidx19 = getelementptr inbounds [100 x [100 x [100 x i32]]], ptr %A, i64 10, i64 %add15, i64 %add14, i64 %add13
202 %0 = load i32, ptr %arrayidx19, align 4
203 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.31, i64 1
204 store i32 %0, ptr %B.addr.31, align 4
205 %inc = add nsw i64 %l.02, 1
206 %exitcond = icmp ne i64 %inc, 50
207 br i1 %exitcond, label %for.body9, label %for.inc20
209 for.inc20: ; preds = %for.body9
210 %scevgep = getelementptr i32, ptr %B.addr.24, i64 50
211 %inc21 = add nsw i64 %k.03, 1
212 %exitcond10 = icmp ne i64 %inc21, 50
213 br i1 %exitcond10, label %for.cond7.preheader, label %for.inc23
215 for.inc23: ; preds = %for.inc20
216 %scevgep9 = getelementptr i32, ptr %B.addr.16, i64 2500
217 %inc24 = add nsw i64 %j.05, 1
218 %exitcond12 = icmp ne i64 %inc24, 50
219 br i1 %exitcond12, label %for.cond4.preheader, label %for.inc26
221 for.inc26: ; preds = %for.inc23
222 %scevgep11 = getelementptr i32, ptr %B.addr.08, i64 125000
223 %inc27 = add nsw i64 %i.07, 1
224 %exitcond13 = icmp ne i64 %inc27, 50
225 br i1 %exitcond13, label %for.cond1.preheader, label %for.end28
227 for.end28: ; preds = %for.inc26
232 ;; for (long int i = 0; i < 50; i++)
233 ;; for (long int j = 0; j < 50; j++)
234 ;; for (long int k = 0; k < 50; k++)
235 ;; for (long int l = 0; l ptr]!
236 ;; for (long int l = 0; l < 50; l++) {
237 ;; A[i][i][i + k][l + k] = i;
238 ;; *B++ = A[10][i + 10][j + k][l + 10];
240 define void @sep3(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
242 br label %for.cond1.preheader
244 ; CHECK: da analyze - consistent output [0 S 0 0]!
245 ; CHECK: da analyze - flow [> * * *]!
246 ; CHECK: da analyze - confused!
247 ; CHECK: da analyze - input [0 * * 0]!
248 ; CHECK: da analyze - confused!
249 ; CHECK: da analyze - none!
251 for.cond1.preheader: ; preds = %entry, %for.inc27
252 %B.addr.08 = phi ptr [ %B, %entry ], [ %scevgep11, %for.inc27 ]
253 %i.07 = phi i64 [ 0, %entry ], [ %inc28, %for.inc27 ]
254 br label %for.cond4.preheader
256 for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc24
257 %B.addr.16 = phi ptr [ %B.addr.08, %for.cond1.preheader ], [ %scevgep9, %for.inc24 ]
258 %j.05 = phi i64 [ 0, %for.cond1.preheader ], [ %inc25, %for.inc24 ]
259 br label %for.cond7.preheader
261 for.cond7.preheader: ; preds = %for.cond4.preheader, %for.inc21
262 %B.addr.24 = phi ptr [ %B.addr.16, %for.cond4.preheader ], [ %scevgep, %for.inc21 ]
263 %k.03 = phi i64 [ 0, %for.cond4.preheader ], [ %inc22, %for.inc21 ]
266 for.body9: ; preds = %for.cond7.preheader, %for.body9
267 %l.02 = phi i64 [ 0, %for.cond7.preheader ], [ %inc, %for.body9 ]
268 %B.addr.31 = phi ptr [ %B.addr.24, %for.cond7.preheader ], [ %incdec.ptr, %for.body9 ]
269 %conv = trunc i64 %i.07 to i32
270 %add = add nsw i64 %l.02, %k.03
271 %add10 = add nsw i64 %i.07, %k.03
272 %arrayidx13 = getelementptr inbounds [100 x [100 x [100 x i32]]], ptr %A, i64 %i.07, i64 %i.07, i64 %add10, i64 %add
273 store i32 %conv, ptr %arrayidx13, align 4
274 %add14 = add nsw i64 %l.02, 10
275 %add15 = add nsw i64 %j.05, %k.03
276 %add16 = add nsw i64 %i.07, 10
277 %arrayidx20 = getelementptr inbounds [100 x [100 x [100 x i32]]], ptr %A, i64 10, i64 %add16, i64 %add15, i64 %add14
278 %0 = load i32, ptr %arrayidx20, align 4
279 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.31, i64 1
280 store i32 %0, ptr %B.addr.31, align 4
281 %inc = add nsw i64 %l.02, 1
282 %exitcond = icmp ne i64 %inc, 50
283 br i1 %exitcond, label %for.body9, label %for.inc21
285 for.inc21: ; preds = %for.body9
286 %scevgep = getelementptr i32, ptr %B.addr.24, i64 50
287 %inc22 = add nsw i64 %k.03, 1
288 %exitcond10 = icmp ne i64 %inc22, 50
289 br i1 %exitcond10, label %for.cond7.preheader, label %for.inc24
291 for.inc24: ; preds = %for.inc21
292 %scevgep9 = getelementptr i32, ptr %B.addr.16, i64 2500
293 %inc25 = add nsw i64 %j.05, 1
294 %exitcond12 = icmp ne i64 %inc25, 50
295 br i1 %exitcond12, label %for.cond4.preheader, label %for.inc27
297 for.inc27: ; preds = %for.inc24
298 %scevgep11 = getelementptr i32, ptr %B.addr.08, i64 125000
299 %inc28 = add nsw i64 %i.07, 1
300 %exitcond13 = icmp ne i64 %inc28, 50
301 br i1 %exitcond13, label %for.cond1.preheader, label %for.end29
303 for.end29: ; preds = %for.inc27