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 ;;int p0(int n, int *A, int *B) {
12 define i32 @p0(i32 %n, ptr %A, ptr %B) nounwind uwtable ssp {
14 store i32 %n, ptr %A, align 4
17 ; CHECK: da analyze - none!
18 ; CHECK: da analyze - confused!
19 ; CHECK: da analyze - none!
21 %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 1
22 %0 = load i32, ptr %arrayidx1, align 4
27 ;;int p1(int n, int *restrict A, int *restrict B) {
31 define i32 @p1(i32 %n, ptr noalias %A, ptr noalias %B) nounwind uwtable ssp {
33 store i32 %n, ptr %A, align 4
36 ; CHECK: da analyze - none!
37 ; CHECK: da analyze - none!
38 ; CHECK: da analyze - none!
40 %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 1
41 %0 = load i32, ptr %arrayidx1, align 4
46 ;; for (long int i = 0; i < n; i++) {
47 ;; for (long int j = 0; j < n; j++) {
48 ;; for (long int k = 0; k < n; k++) {
51 ;; for (long int k = 0; k < n; k++) {
52 ;; *B++ = A[i + 3][j + 2][k + 1];
54 define void @p2(i64 %n, ptr %A, ptr %B) nounwind uwtable ssp {
56 %cmp10 = icmp sgt i64 %n, 0
57 br i1 %cmp10, label %for.cond1.preheader.preheader, label %for.end26
60 ; CHECK: da analyze - output [* * *]!
61 ; CHECK: da analyze - flow [* *|<]!
62 ; CHECK: da analyze - confused!
63 ; CHECK: da analyze - input [* * *]!
64 ; CHECK: da analyze - confused!
65 ; CHECK: da analyze - output [* * *]!
67 for.cond1.preheader.preheader: ; preds = %entry
68 br label %for.cond1.preheader
70 for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc24
71 %B.addr.012 = phi ptr [ %B.addr.1.lcssa, %for.inc24 ], [ %B, %for.cond1.preheader.preheader ]
72 %i.011 = phi i64 [ %inc25, %for.inc24 ], [ 0, %for.cond1.preheader.preheader ]
73 %cmp26 = icmp sgt i64 %n, 0
74 br i1 %cmp26, label %for.cond4.preheader.preheader, label %for.inc24
76 for.cond4.preheader.preheader: ; preds = %for.cond1.preheader
77 br label %for.cond4.preheader
79 for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.inc21
80 %B.addr.18 = phi ptr [ %B.addr.2.lcssa, %for.inc21 ], [ %B.addr.012, %for.cond4.preheader.preheader ]
81 %j.07 = phi i64 [ %inc22, %for.inc21 ], [ 0, %for.cond4.preheader.preheader ]
82 %cmp51 = icmp sgt i64 %n, 0
83 br i1 %cmp51, label %for.body6.preheader, label %for.cond10.loopexit
85 for.body6.preheader: ; preds = %for.cond4.preheader
88 for.body6: ; preds = %for.body6.preheader, %for.body6
89 %k.02 = phi i64 [ %inc, %for.body6 ], [ 0, %for.body6.preheader ]
90 %arrayidx8 = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 %i.011, i64 %j.07, i64 %k.02
91 store i64 %i.011, ptr %arrayidx8, align 8
92 %inc = add nsw i64 %k.02, 1
93 %exitcond13 = icmp ne i64 %inc, %n
94 br i1 %exitcond13, label %for.body6, label %for.cond10.loopexit.loopexit
96 for.cond10.loopexit.loopexit: ; preds = %for.body6
97 br label %for.cond10.loopexit
99 for.cond10.loopexit: ; preds = %for.cond10.loopexit.loopexit, %for.cond4.preheader
100 %cmp113 = icmp sgt i64 %n, 0
101 br i1 %cmp113, label %for.body12.preheader, label %for.inc21
103 for.body12.preheader: ; preds = %for.cond10.loopexit
106 for.body12: ; preds = %for.body12.preheader, %for.body12
107 %k9.05 = phi i64 [ %inc19, %for.body12 ], [ 0, %for.body12.preheader ]
108 %B.addr.24 = phi ptr [ %incdec.ptr, %for.body12 ], [ %B.addr.18, %for.body12.preheader ]
109 %add = add nsw i64 %k9.05, 1
110 %add13 = add nsw i64 %j.07, 2
111 %add14 = add nsw i64 %i.011, 3
112 %arrayidx17 = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 %add14, i64 %add13, i64 %add
113 %0 = load i64, ptr %arrayidx17, align 8
114 %incdec.ptr = getelementptr inbounds i64, ptr %B.addr.24, i64 1
115 store i64 %0, ptr %B.addr.24, align 8
116 %inc19 = add nsw i64 %k9.05, 1
117 %exitcond = icmp ne i64 %inc19, %n
118 br i1 %exitcond, label %for.body12, label %for.inc21.loopexit
120 for.inc21.loopexit: ; preds = %for.body12
121 %scevgep = getelementptr i64, ptr %B.addr.18, i64 %n
124 for.inc21: ; preds = %for.inc21.loopexit, %for.cond10.loopexit
125 %B.addr.2.lcssa = phi ptr [ %B.addr.18, %for.cond10.loopexit ], [ %scevgep, %for.inc21.loopexit ]
126 %inc22 = add nsw i64 %j.07, 1
127 %exitcond14 = icmp ne i64 %inc22, %n
128 br i1 %exitcond14, label %for.cond4.preheader, label %for.inc24.loopexit
130 for.inc24.loopexit: ; preds = %for.inc21
131 %B.addr.2.lcssa.lcssa = phi ptr [ %B.addr.2.lcssa, %for.inc21 ]
134 for.inc24: ; preds = %for.inc24.loopexit, %for.cond1.preheader
135 %B.addr.1.lcssa = phi ptr [ %B.addr.012, %for.cond1.preheader ], [ %B.addr.2.lcssa.lcssa, %for.inc24.loopexit ]
136 %inc25 = add nsw i64 %i.011, 1
137 %exitcond15 = icmp ne i64 %inc25, %n
138 br i1 %exitcond15, label %for.cond1.preheader, label %for.end26.loopexit
140 for.end26.loopexit: ; preds = %for.inc24
143 for.end26: ; preds = %for.end26.loopexit, %entry
148 ; This ridiculous example is disabled: it does not make sense to keep it.
149 ;; for (long int i = 0; i < n; i++)
150 ;; for (long int j = 0; j < n; j++)
151 ;; for (long int k = 0; k < n; k++)
152 ;; for (long int l = 0; l < n; l++)
153 ;; for (long int m = 0; m < n; m++)
154 ;; for (long int o = 0; o < n; o++)
155 ;; for (long int p = 0; p < n; p++)
156 ;; for (long int q = 0; q < n; q++)
157 ;; for (long int r = 0; r < n; r++)
158 ;; for (long int s = 0; s < n; s++)
159 ;; for (long int u = 0; u < n; u++)
160 ;; for (long int t = 0; t < n; t++) {
161 ;; A[i - 3] [j] [2] [k-1] [2*l + 1] [m] [p + q] [r + s] = i;
162 ;; *B++ = A[i + 3] [2] [u] [1-k] [3*l - 1] [o] [1 + n] [t + 2];
164 ;define void @p3(i64 %n, ptr %A, ptr %B) nounwind uwtable ssp {
166 ; %cmp44 = icmp sgt i64 %n, 0
167 ; br i1 %cmp44, label %for.cond1.preheader.preheader, label %for.end90
169 ;; DONT-CHECK-LABEL: p3
170 ;; DONT-CHECK: da analyze - output [* * * * * S * * * * S S]!
171 ;; DONT-CHECK: da analyze - flow [* * * * * * * * * * * *|<]!
172 ;; DONT-CHECK: da analyze - confused!
173 ;; DONT-CHECK: da analyze - input [* S * * S * S S S S * *]!
174 ;; DONT-CHECK: da analyze - confused!
175 ;; DONT-CHECK: da analyze - output [* * * * * * * * * * * *]!
177 ;for.cond1.preheader.preheader: ; preds = %entry
178 ; br label %for.cond1.preheader
180 ;for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc88
181 ; %B.addr.046 = phi ptr [ %B.addr.1.lcssa, %for.inc88 ], [ %B, %for.cond1.preheader.preheader ]
182 ; %i.045 = phi i64 [ %inc89, %for.inc88 ], [ 0, %for.cond1.preheader.preheader ]
183 ; %cmp240 = icmp sgt i64 %n, 0
184 ; br i1 %cmp240, label %for.cond4.preheader.preheader, label %for.inc88
186 ;for.cond4.preheader.preheader: ; preds = %for.cond1.preheader
187 ; br label %for.cond4.preheader
189 ;for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.inc85
190 ; %B.addr.142 = phi ptr [ %B.addr.2.lcssa, %for.inc85 ], [ %B.addr.046, %for.cond4.preheader.preheader ]
191 ; %j.041 = phi i64 [ %inc86, %for.inc85 ], [ 0, %for.cond4.preheader.preheader ]
192 ; %cmp536 = icmp sgt i64 %n, 0
193 ; br i1 %cmp536, label %for.cond7.preheader.preheader, label %for.inc85
195 ;for.cond7.preheader.preheader: ; preds = %for.cond4.preheader
196 ; br label %for.cond7.preheader
198 ;for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.inc82
199 ; %B.addr.238 = phi ptr [ %B.addr.3.lcssa, %for.inc82 ], [ %B.addr.142, %for.cond7.preheader.preheader ]
200 ; %k.037 = phi i64 [ %inc83, %for.inc82 ], [ 0, %for.cond7.preheader.preheader ]
201 ; %cmp832 = icmp sgt i64 %n, 0
202 ; br i1 %cmp832, label %for.cond10.preheader.preheader, label %for.inc82
204 ;for.cond10.preheader.preheader: ; preds = %for.cond7.preheader
205 ; br label %for.cond10.preheader
207 ;for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.inc79
208 ; %B.addr.334 = phi ptr [ %B.addr.4.lcssa, %for.inc79 ], [ %B.addr.238, %for.cond10.preheader.preheader ]
209 ; %l.033 = phi i64 [ %inc80, %for.inc79 ], [ 0, %for.cond10.preheader.preheader ]
210 ; %cmp1128 = icmp sgt i64 %n, 0
211 ; br i1 %cmp1128, label %for.cond13.preheader.preheader, label %for.inc79
213 ;for.cond13.preheader.preheader: ; preds = %for.cond10.preheader
214 ; br label %for.cond13.preheader
216 ;for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.inc76
217 ; %B.addr.430 = phi ptr [ %B.addr.5.lcssa, %for.inc76 ], [ %B.addr.334, %for.cond13.preheader.preheader ]
218 ; %m.029 = phi i64 [ %inc77, %for.inc76 ], [ 0, %for.cond13.preheader.preheader ]
219 ; %cmp1424 = icmp sgt i64 %n, 0
220 ; br i1 %cmp1424, label %for.cond16.preheader.preheader, label %for.inc76
222 ;for.cond16.preheader.preheader: ; preds = %for.cond13.preheader
223 ; br label %for.cond16.preheader
225 ;for.cond16.preheader: ; preds = %for.cond16.preheader.preheader, %for.inc73
226 ; %B.addr.526 = phi ptr [ %B.addr.6.lcssa, %for.inc73 ], [ %B.addr.430, %for.cond16.preheader.preheader ]
227 ; %o.025 = phi i64 [ %inc74, %for.inc73 ], [ 0, %for.cond16.preheader.preheader ]
228 ; %cmp1720 = icmp sgt i64 %n, 0
229 ; br i1 %cmp1720, label %for.cond19.preheader.preheader, label %for.inc73
231 ;for.cond19.preheader.preheader: ; preds = %for.cond16.preheader
232 ; br label %for.cond19.preheader
234 ;for.cond19.preheader: ; preds = %for.cond19.preheader.preheader, %for.inc70
235 ; %B.addr.622 = phi ptr [ %B.addr.7.lcssa, %for.inc70 ], [ %B.addr.526, %for.cond19.preheader.preheader ]
236 ; %p.021 = phi i64 [ %inc71, %for.inc70 ], [ 0, %for.cond19.preheader.preheader ]
237 ; %cmp2016 = icmp sgt i64 %n, 0
238 ; br i1 %cmp2016, label %for.cond22.preheader.preheader, label %for.inc70
240 ;for.cond22.preheader.preheader: ; preds = %for.cond19.preheader
241 ; br label %for.cond22.preheader
243 ;for.cond22.preheader: ; preds = %for.cond22.preheader.preheader, %for.inc67
244 ; %B.addr.718 = phi ptr [ %B.addr.8.lcssa, %for.inc67 ], [ %B.addr.622, %for.cond22.preheader.preheader ]
245 ; %q.017 = phi i64 [ %inc68, %for.inc67 ], [ 0, %for.cond22.preheader.preheader ]
246 ; %cmp2312 = icmp sgt i64 %n, 0
247 ; br i1 %cmp2312, label %for.cond25.preheader.preheader, label %for.inc67
249 ;for.cond25.preheader.preheader: ; preds = %for.cond22.preheader
250 ; br label %for.cond25.preheader
252 ;for.cond25.preheader: ; preds = %for.cond25.preheader.preheader, %for.inc64
253 ; %B.addr.814 = phi ptr [ %B.addr.9.lcssa, %for.inc64 ], [ %B.addr.718, %for.cond25.preheader.preheader ]
254 ; %r.013 = phi i64 [ %inc65, %for.inc64 ], [ 0, %for.cond25.preheader.preheader ]
255 ; %cmp268 = icmp sgt i64 %n, 0
256 ; br i1 %cmp268, label %for.cond28.preheader.preheader, label %for.inc64
258 ;for.cond28.preheader.preheader: ; preds = %for.cond25.preheader
259 ; br label %for.cond28.preheader
261 ;for.cond28.preheader: ; preds = %for.cond28.preheader.preheader, %for.inc61
262 ; %B.addr.910 = phi ptr [ %B.addr.10.lcssa, %for.inc61 ], [ %B.addr.814, %for.cond28.preheader.preheader ]
263 ; %s.09 = phi i64 [ %inc62, %for.inc61 ], [ 0, %for.cond28.preheader.preheader ]
264 ; %cmp294 = icmp sgt i64 %n, 0
265 ; br i1 %cmp294, label %for.cond31.preheader.preheader, label %for.inc61
267 ;for.cond31.preheader.preheader: ; preds = %for.cond28.preheader
268 ; br label %for.cond31.preheader
270 ;for.cond31.preheader: ; preds = %for.cond31.preheader.preheader, %for.inc58
271 ; %u.06 = phi i64 [ %inc59, %for.inc58 ], [ 0, %for.cond31.preheader.preheader ]
272 ; %B.addr.105 = phi ptr [ %B.addr.11.lcssa, %for.inc58 ], [ %B.addr.910, %for.cond31.preheader.preheader ]
273 ; %cmp321 = icmp sgt i64 %n, 0
274 ; br i1 %cmp321, label %for.body33.preheader, label %for.inc58
276 ;for.body33.preheader: ; preds = %for.cond31.preheader
277 ; br label %for.body33
279 ;for.body33: ; preds = %for.body33.preheader, %for.body33
280 ; %t.03 = phi i64 [ %inc, %for.body33 ], [ 0, %for.body33.preheader ]
281 ; %B.addr.112 = phi ptr [ %incdec.ptr, %for.body33 ], [ %B.addr.105, %for.body33.preheader ]
282 ; %add = add nsw i64 %r.013, %s.09
283 ; %add34 = add nsw i64 %p.021, %q.017
284 ; %mul = shl nsw i64 %l.033, 1
285 ; %add3547 = or i64 %mul, 1
286 ; %sub = add nsw i64 %k.037, -1
287 ; %sub36 = add nsw i64 %i.045, -3
288 ; %arrayidx43 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]], ptr %A, i64 %sub36, i64 %j.041, i64 2, i64 %sub, i64 %add3547, i64 %m.029, i64 %add34, i64 %add
289 ; store i64 %i.045, ptr %arrayidx43, align 8
290 ; %add44 = add nsw i64 %t.03, 2
291 ; %add45 = add nsw i64 %n, 1
292 ; %mul46 = mul nsw i64 %l.033, 3
293 ; %sub47 = add nsw i64 %mul46, -1
294 ; %sub48 = sub nsw i64 1, %k.037
295 ; %add49 = add nsw i64 %i.045, 3
296 ; %arrayidx57 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]], ptr %A, i64 %add49, i64 2, i64 %u.06, i64 %sub48, i64 %sub47, i64 %o.025, i64 %add45, i64 %add44
297 ; %0 = load i64, ptr %arrayidx57, align 8
298 ; %incdec.ptr = getelementptr inbounds i64, ptr %B.addr.112, i64 1
299 ; store i64 %0, ptr %B.addr.112, align 8
300 ; %inc = add nsw i64 %t.03, 1
301 ; %exitcond = icmp ne i64 %inc, %n
302 ; br i1 %exitcond, label %for.body33, label %for.inc58.loopexit
304 ;for.inc58.loopexit: ; preds = %for.body33
305 ; %scevgep = getelementptr i64, ptr %B.addr.105, i64 %n
306 ; br label %for.inc58
308 ;for.inc58: ; preds = %for.inc58.loopexit, %for.cond31.preheader
309 ; %B.addr.11.lcssa = phi ptr [ %B.addr.105, %for.cond31.preheader ], [ %scevgep, %for.inc58.loopexit ]
310 ; %inc59 = add nsw i64 %u.06, 1
311 ; %exitcond48 = icmp ne i64 %inc59, %n
312 ; br i1 %exitcond48, label %for.cond31.preheader, label %for.inc61.loopexit
314 ;for.inc61.loopexit: ; preds = %for.inc58
315 ; %B.addr.11.lcssa.lcssa = phi ptr [ %B.addr.11.lcssa, %for.inc58 ]
316 ; br label %for.inc61
318 ;for.inc61: ; preds = %for.inc61.loopexit, %for.cond28.preheader
319 ; %B.addr.10.lcssa = phi ptr [ %B.addr.910, %for.cond28.preheader ], [ %B.addr.11.lcssa.lcssa, %for.inc61.loopexit ]
320 ; %inc62 = add nsw i64 %s.09, 1
321 ; %exitcond49 = icmp ne i64 %inc62, %n
322 ; br i1 %exitcond49, label %for.cond28.preheader, label %for.inc64.loopexit
324 ;for.inc64.loopexit: ; preds = %for.inc61
325 ; %B.addr.10.lcssa.lcssa = phi ptr [ %B.addr.10.lcssa, %for.inc61 ]
326 ; br label %for.inc64
328 ;for.inc64: ; preds = %for.inc64.loopexit, %for.cond25.preheader
329 ; %B.addr.9.lcssa = phi ptr [ %B.addr.814, %for.cond25.preheader ], [ %B.addr.10.lcssa.lcssa, %for.inc64.loopexit ]
330 ; %inc65 = add nsw i64 %r.013, 1
331 ; %exitcond50 = icmp ne i64 %inc65, %n
332 ; br i1 %exitcond50, label %for.cond25.preheader, label %for.inc67.loopexit
334 ;for.inc67.loopexit: ; preds = %for.inc64
335 ; %B.addr.9.lcssa.lcssa = phi ptr [ %B.addr.9.lcssa, %for.inc64 ]
336 ; br label %for.inc67
338 ;for.inc67: ; preds = %for.inc67.loopexit, %for.cond22.preheader
339 ; %B.addr.8.lcssa = phi ptr [ %B.addr.718, %for.cond22.preheader ], [ %B.addr.9.lcssa.lcssa, %for.inc67.loopexit ]
340 ; %inc68 = add nsw i64 %q.017, 1
341 ; %exitcond51 = icmp ne i64 %inc68, %n
342 ; br i1 %exitcond51, label %for.cond22.preheader, label %for.inc70.loopexit
344 ;for.inc70.loopexit: ; preds = %for.inc67
345 ; %B.addr.8.lcssa.lcssa = phi ptr [ %B.addr.8.lcssa, %for.inc67 ]
346 ; br label %for.inc70
348 ;for.inc70: ; preds = %for.inc70.loopexit, %for.cond19.preheader
349 ; %B.addr.7.lcssa = phi ptr [ %B.addr.622, %for.cond19.preheader ], [ %B.addr.8.lcssa.lcssa, %for.inc70.loopexit ]
350 ; %inc71 = add nsw i64 %p.021, 1
351 ; %exitcond52 = icmp ne i64 %inc71, %n
352 ; br i1 %exitcond52, label %for.cond19.preheader, label %for.inc73.loopexit
354 ;for.inc73.loopexit: ; preds = %for.inc70
355 ; %B.addr.7.lcssa.lcssa = phi ptr [ %B.addr.7.lcssa, %for.inc70 ]
356 ; br label %for.inc73
358 ;for.inc73: ; preds = %for.inc73.loopexit, %for.cond16.preheader
359 ; %B.addr.6.lcssa = phi ptr [ %B.addr.526, %for.cond16.preheader ], [ %B.addr.7.lcssa.lcssa, %for.inc73.loopexit ]
360 ; %inc74 = add nsw i64 %o.025, 1
361 ; %exitcond53 = icmp ne i64 %inc74, %n
362 ; br i1 %exitcond53, label %for.cond16.preheader, label %for.inc76.loopexit
364 ;for.inc76.loopexit: ; preds = %for.inc73
365 ; %B.addr.6.lcssa.lcssa = phi ptr [ %B.addr.6.lcssa, %for.inc73 ]
366 ; br label %for.inc76
368 ;for.inc76: ; preds = %for.inc76.loopexit, %for.cond13.preheader
369 ; %B.addr.5.lcssa = phi ptr [ %B.addr.430, %for.cond13.preheader ], [ %B.addr.6.lcssa.lcssa, %for.inc76.loopexit ]
370 ; %inc77 = add nsw i64 %m.029, 1
371 ; %exitcond54 = icmp ne i64 %inc77, %n
372 ; br i1 %exitcond54, label %for.cond13.preheader, label %for.inc79.loopexit
374 ;for.inc79.loopexit: ; preds = %for.inc76
375 ; %B.addr.5.lcssa.lcssa = phi ptr [ %B.addr.5.lcssa, %for.inc76 ]
376 ; br label %for.inc79
378 ;for.inc79: ; preds = %for.inc79.loopexit, %for.cond10.preheader
379 ; %B.addr.4.lcssa = phi ptr [ %B.addr.334, %for.cond10.preheader ], [ %B.addr.5.lcssa.lcssa, %for.inc79.loopexit ]
380 ; %inc80 = add nsw i64 %l.033, 1
381 ; %exitcond55 = icmp ne i64 %inc80, %n
382 ; br i1 %exitcond55, label %for.cond10.preheader, label %for.inc82.loopexit
384 ;for.inc82.loopexit: ; preds = %for.inc79
385 ; %B.addr.4.lcssa.lcssa = phi ptr [ %B.addr.4.lcssa, %for.inc79 ]
386 ; br label %for.inc82
388 ;for.inc82: ; preds = %for.inc82.loopexit, %for.cond7.preheader
389 ; %B.addr.3.lcssa = phi ptr [ %B.addr.238, %for.cond7.preheader ], [ %B.addr.4.lcssa.lcssa, %for.inc82.loopexit ]
390 ; %inc83 = add nsw i64 %k.037, 1
391 ; %exitcond56 = icmp ne i64 %inc83, %n
392 ; br i1 %exitcond56, label %for.cond7.preheader, label %for.inc85.loopexit
394 ;for.inc85.loopexit: ; preds = %for.inc82
395 ; %B.addr.3.lcssa.lcssa = phi ptr [ %B.addr.3.lcssa, %for.inc82 ]
396 ; br label %for.inc85
398 ;for.inc85: ; preds = %for.inc85.loopexit, %for.cond4.preheader
399 ; %B.addr.2.lcssa = phi ptr [ %B.addr.142, %for.cond4.preheader ], [ %B.addr.3.lcssa.lcssa, %for.inc85.loopexit ]
400 ; %inc86 = add nsw i64 %j.041, 1
401 ; %exitcond57 = icmp ne i64 %inc86, %n
402 ; br i1 %exitcond57, label %for.cond4.preheader, label %for.inc88.loopexit
404 ;for.inc88.loopexit: ; preds = %for.inc85
405 ; %B.addr.2.lcssa.lcssa = phi ptr [ %B.addr.2.lcssa, %for.inc85 ]
406 ; br label %for.inc88
408 ;for.inc88: ; preds = %for.inc88.loopexit, %for.cond1.preheader
409 ; %B.addr.1.lcssa = phi ptr [ %B.addr.046, %for.cond1.preheader ], [ %B.addr.2.lcssa.lcssa, %for.inc88.loopexit ]
410 ; %inc89 = add nsw i64 %i.045, 1
411 ; %exitcond58 = icmp ne i64 %inc89, %n
412 ; br i1 %exitcond58, label %for.cond1.preheader, label %for.end90.loopexit
414 ;for.end90.loopexit: ; preds = %for.inc88
415 ; br label %for.end90
417 ;for.end90: ; preds = %for.end90.loopexit, %entry
422 ;;void p4(int *A, int *B, long int n) {
423 ;; for (char i = 0; i < n; i++) {
427 define void @p4(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
429 %cmp1 = icmp sgt i64 %n, 0
430 br i1 %cmp1, label %for.body.preheader, label %for.end
433 ; CHECK: da analyze - output [*]!
434 ; CHECK: da analyze - flow [*|<]!
435 ; CHECK: da analyze - confused!
436 ; CHECK: da analyze - input [*]!
437 ; CHECK: da analyze - confused!
438 ; CHECK: da analyze - none!
440 for.body.preheader: ; preds = %entry
443 for.body: ; preds = %for.body.preheader, %for.body
444 %i.03 = phi i8 [ %inc, %for.body ], [ 0, %for.body.preheader ]
445 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
446 %conv2 = sext i8 %i.03 to i32
447 %conv3 = sext i8 %i.03 to i64
448 %add = add i64 %conv3, 2
449 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
450 store i32 %conv2, ptr %arrayidx, align 4
451 %idxprom4 = sext i8 %i.03 to i64
452 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
453 %0 = load i32, ptr %arrayidx5, align 4
454 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
455 store i32 %0, ptr %B.addr.02, align 4
456 %inc = add i8 %i.03, 1
457 %conv = sext i8 %inc to i64
458 %cmp = icmp slt i64 %conv, %n
459 br i1 %cmp, label %for.body, label %for.end.loopexit
461 for.end.loopexit: ; preds = %for.body
464 for.end: ; preds = %for.end.loopexit, %entry
469 ;;void p5(int *A, int *B, long int n) {
470 ;; for (short i = 0; i < n; i++) {
474 define void @p5(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
476 %cmp1 = icmp sgt i64 %n, 0
477 br i1 %cmp1, label %for.body.preheader, label %for.end
480 ; CHECK: da analyze - output [*]!
481 ; CHECK: da analyze - flow [*|<]!
482 ; CHECK: da analyze - confused!
483 ; CHECK: da analyze - input [*]!
484 ; CHECK: da analyze - confused!
485 ; CHECK: da analyze - none!
487 for.body.preheader: ; preds = %entry
490 for.body: ; preds = %for.body.preheader, %for.body
491 %i.03 = phi i16 [ %inc, %for.body ], [ 0, %for.body.preheader ]
492 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
493 %conv2 = sext i16 %i.03 to i32
494 %conv3 = sext i16 %i.03 to i64
495 %add = add i64 %conv3, 2
496 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
497 store i32 %conv2, ptr %arrayidx, align 4
498 %idxprom4 = sext i16 %i.03 to i64
499 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
500 %0 = load i32, ptr %arrayidx5, align 4
501 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
502 store i32 %0, ptr %B.addr.02, align 4
503 %inc = add i16 %i.03, 1
504 %conv = sext i16 %inc to i64
505 %cmp = icmp slt i64 %conv, %n
506 br i1 %cmp, label %for.body, label %for.end.loopexit
508 for.end.loopexit: ; preds = %for.body
511 for.end: ; preds = %for.end.loopexit, %entry
516 ;;void p6(int *A, int *B, long int n) {
517 ;; for (int i = 0; i < n; i++) {
521 define void @p6(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
523 %cmp1 = icmp sgt i64 %n, 0
524 br i1 %cmp1, label %for.body.preheader, label %for.end
527 ; CHECK: da analyze - none!
528 ; CHECK: da analyze - consistent flow [2]!
529 ; CHECK: da analyze - confused!
530 ; CHECK: da analyze - none!
531 ; CHECK: da analyze - confused!
532 ; CHECK: da analyze - none!
534 for.body.preheader: ; preds = %entry
537 for.body: ; preds = %for.body.preheader, %for.body
538 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
539 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
540 %0 = add nsw i64 %indvars.iv, 2
541 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %0
542 %1 = trunc i64 %indvars.iv to i32
543 store i32 %1, ptr %arrayidx, align 4
544 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
545 %2 = load i32, ptr %arrayidx3, align 4
546 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
547 store i32 %2, ptr %B.addr.02, align 4
548 %indvars.iv.next = add i64 %indvars.iv, 1
549 %exitcond = icmp ne i64 %indvars.iv.next, %n
550 br i1 %exitcond, label %for.body, label %for.end.loopexit
552 for.end.loopexit: ; preds = %for.body
555 for.end: ; preds = %for.end.loopexit, %entry
560 ;;void p7(unsigned *A, unsigned *B, char n) {
564 define void @p7(ptr %A, ptr %B, i8 signext %n) nounwind uwtable ssp {
566 %idxprom = sext i8 %n to i64
567 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
570 ; CHECK: da analyze - none!
571 ; CHECK: da analyze - none!
572 ; CHECK: da analyze - confused!
573 ; CHECK: da analyze - none!
574 ; CHECK: da analyze - confused!
575 ; CHECK: da analyze - none!
577 store i32 0, ptr %arrayidx, align 4
578 %conv = sext i8 %n to i64
579 %add = add i64 %conv, 1
580 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %add
581 %0 = load i32, ptr %arrayidx2, align 4
582 store i32 %0, ptr %B, align 4
587 ;;void p8(unsigned *A, unsigned *B, short n) {
591 define void @p8(ptr %A, ptr %B, i16 signext %n) nounwind uwtable ssp {
593 %idxprom = sext i16 %n to i64
594 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
595 store i32 0, ptr %arrayidx, align 4
598 ; CHECK: da analyze - none!
599 ; CHECK: da analyze - none!
600 ; CHECK: da analyze - confused!
601 ; CHECK: da analyze - none!
602 ; CHECK: da analyze - confused!
603 ; CHECK: da analyze - none!
605 %conv = sext i16 %n to i64
606 %add = add i64 %conv, 1
607 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %add
608 %0 = load i32, ptr %arrayidx2, align 4
609 store i32 %0, ptr %B, align 4
614 ;;void p9(unsigned *A, unsigned *B, int n) {
618 define void @p9(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
620 %idxprom = sext i32 %n to i64
621 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
622 store i32 0, ptr %arrayidx, align 4
625 ; CHECK: da analyze - none!
626 ; CHECK: da analyze - none!
627 ; CHECK: da analyze - confused!
628 ; CHECK: da analyze - none!
629 ; CHECK: da analyze - confused!
630 ; CHECK: da analyze - none!
632 %add = add nsw i32 %n, 1
633 %idxprom1 = sext i32 %add to i64
634 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %idxprom1
635 %0 = load i32, ptr %arrayidx2, align 4
636 store i32 %0, ptr %B, align 4
641 ;;void p10(unsigned *A, unsigned *B, unsigned n) {
645 define void @p10(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
647 %idxprom = zext i32 %n to i64
648 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
649 store i32 0, ptr %arrayidx, align 4
652 ; CHECK: da analyze - none!
653 ; CHECK: da analyze - flow [|<]!
654 ; CHECK: da analyze - confused!
655 ; CHECK: da analyze - none!
656 ; CHECK: da analyze - confused!
657 ; CHECK: da analyze - none!
660 %idxprom1 = zext i32 %add to i64
661 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %idxprom1
662 %0 = load i32, ptr %arrayidx2, align 4
663 store i32 %0, ptr %B, align 4
668 ;;typedef struct { int v; } S;
670 ;;void f(S *s, unsigned size) {
671 ;; S *i = s, *e = s + size - 1;
676 %struct.S = type { i32 }
678 define void @foo(ptr %s, i32 %size) nounwind uwtable ssp {
680 %idx.ext = zext i32 %size to i64
681 %add.ptr.sum = add i64 %idx.ext, -1
682 %add.ptr1 = getelementptr inbounds %struct.S, ptr %s, i64 %add.ptr.sum
683 %cmp1 = icmp eq i64 %add.ptr.sum, 0
684 br i1 %cmp1, label %while.end, label %while.body.preheader
687 ; CHECK: da analyze - none!
688 ; CHECK: da analyze - consistent anti [1]!
689 ; CHECK: da analyze - none!
691 while.body.preheader: ; preds = %entry
694 while.body: ; preds = %while.body.preheader, %while.body
695 %i.02 = phi ptr [ %incdec.ptr, %while.body ], [ %s, %while.body.preheader ]
696 %0 = getelementptr inbounds %struct.S, ptr %i.02, i64 1, i32 0
697 %1 = load i32, ptr %0, align 4
698 store i32 %1, ptr %i.02, align 4
699 %incdec.ptr = getelementptr inbounds %struct.S, ptr %i.02, i64 1
700 %cmp = icmp eq ptr %incdec.ptr, %add.ptr1
701 br i1 %cmp, label %while.end.loopexit, label %while.body
703 while.end.loopexit: ; preds = %while.body
706 while.end: ; preds = %while.end.loopexit, %entry
710 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind