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 ;;int p0(int n, int *A, int *B) {
13 define i32 @p0(i32 %n, i32* %A, i32* %B) nounwind uwtable ssp {
15 store i32 %n, i32* %A, align 4
18 ; CHECK: da analyze - none!
19 ; CHECK: da analyze - confused!
20 ; CHECK: da analyze - none!
22 %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 1
23 %0 = load i32, i32* %arrayidx1, align 4
28 ;;int p1(int n, int *restrict A, int *restrict B) {
32 define i32 @p1(i32 %n, i32* noalias %A, i32* noalias %B) nounwind uwtable ssp {
34 store i32 %n, i32* %A, align 4
37 ; CHECK: da analyze - none!
38 ; CHECK: da analyze - none!
39 ; CHECK: da analyze - none!
41 %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 1
42 %0 = load i32, i32* %arrayidx1, align 4
47 ;; for (long int i = 0; i < n; i++) {
48 ;; for (long int j = 0; j < n; j++) {
49 ;; for (long int k = 0; k < n; k++) {
52 ;; for (long int k = 0; k < n; k++) {
53 ;; *B++ = A[i + 3][j + 2][k + 1];
55 define void @p2(i64 %n, [100 x [100 x i64]]* %A, i64* %B) nounwind uwtable ssp {
57 %cmp10 = icmp sgt i64 %n, 0
58 br i1 %cmp10, label %for.cond1.preheader.preheader, label %for.end26
61 ; CHECK: da analyze - output [* * *]!
62 ; CHECK: da analyze - flow [* *|<]!
63 ; CHECK: da analyze - confused!
64 ; CHECK: da analyze - input [* * *]!
65 ; CHECK: da analyze - confused!
66 ; CHECK: da analyze - output [* * *]!
68 for.cond1.preheader.preheader: ; preds = %entry
69 br label %for.cond1.preheader
71 for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc24
72 %B.addr.012 = phi i64* [ %B.addr.1.lcssa, %for.inc24 ], [ %B, %for.cond1.preheader.preheader ]
73 %i.011 = phi i64 [ %inc25, %for.inc24 ], [ 0, %for.cond1.preheader.preheader ]
74 %cmp26 = icmp sgt i64 %n, 0
75 br i1 %cmp26, label %for.cond4.preheader.preheader, label %for.inc24
77 for.cond4.preheader.preheader: ; preds = %for.cond1.preheader
78 br label %for.cond4.preheader
80 for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.inc21
81 %B.addr.18 = phi i64* [ %B.addr.2.lcssa, %for.inc21 ], [ %B.addr.012, %for.cond4.preheader.preheader ]
82 %j.07 = phi i64 [ %inc22, %for.inc21 ], [ 0, %for.cond4.preheader.preheader ]
83 %cmp51 = icmp sgt i64 %n, 0
84 br i1 %cmp51, label %for.body6.preheader, label %for.cond10.loopexit
86 for.body6.preheader: ; preds = %for.cond4.preheader
89 for.body6: ; preds = %for.body6.preheader, %for.body6
90 %k.02 = phi i64 [ %inc, %for.body6 ], [ 0, %for.body6.preheader ]
91 %arrayidx8 = getelementptr inbounds [100 x [100 x i64]], [100 x [100 x i64]]* %A, i64 %i.011, i64 %j.07, i64 %k.02
92 store i64 %i.011, i64* %arrayidx8, align 8
93 %inc = add nsw i64 %k.02, 1
94 %exitcond13 = icmp ne i64 %inc, %n
95 br i1 %exitcond13, label %for.body6, label %for.cond10.loopexit.loopexit
97 for.cond10.loopexit.loopexit: ; preds = %for.body6
98 br label %for.cond10.loopexit
100 for.cond10.loopexit: ; preds = %for.cond10.loopexit.loopexit, %for.cond4.preheader
101 %cmp113 = icmp sgt i64 %n, 0
102 br i1 %cmp113, label %for.body12.preheader, label %for.inc21
104 for.body12.preheader: ; preds = %for.cond10.loopexit
107 for.body12: ; preds = %for.body12.preheader, %for.body12
108 %k9.05 = phi i64 [ %inc19, %for.body12 ], [ 0, %for.body12.preheader ]
109 %B.addr.24 = phi i64* [ %incdec.ptr, %for.body12 ], [ %B.addr.18, %for.body12.preheader ]
110 %add = add nsw i64 %k9.05, 1
111 %add13 = add nsw i64 %j.07, 2
112 %add14 = add nsw i64 %i.011, 3
113 %arrayidx17 = getelementptr inbounds [100 x [100 x i64]], [100 x [100 x i64]]* %A, i64 %add14, i64 %add13, i64 %add
114 %0 = load i64, i64* %arrayidx17, align 8
115 %incdec.ptr = getelementptr inbounds i64, i64* %B.addr.24, i64 1
116 store i64 %0, i64* %B.addr.24, align 8
117 %inc19 = add nsw i64 %k9.05, 1
118 %exitcond = icmp ne i64 %inc19, %n
119 br i1 %exitcond, label %for.body12, label %for.inc21.loopexit
121 for.inc21.loopexit: ; preds = %for.body12
122 %scevgep = getelementptr i64, i64* %B.addr.18, i64 %n
125 for.inc21: ; preds = %for.inc21.loopexit, %for.cond10.loopexit
126 %B.addr.2.lcssa = phi i64* [ %B.addr.18, %for.cond10.loopexit ], [ %scevgep, %for.inc21.loopexit ]
127 %inc22 = add nsw i64 %j.07, 1
128 %exitcond14 = icmp ne i64 %inc22, %n
129 br i1 %exitcond14, label %for.cond4.preheader, label %for.inc24.loopexit
131 for.inc24.loopexit: ; preds = %for.inc21
132 %B.addr.2.lcssa.lcssa = phi i64* [ %B.addr.2.lcssa, %for.inc21 ]
135 for.inc24: ; preds = %for.inc24.loopexit, %for.cond1.preheader
136 %B.addr.1.lcssa = phi i64* [ %B.addr.012, %for.cond1.preheader ], [ %B.addr.2.lcssa.lcssa, %for.inc24.loopexit ]
137 %inc25 = add nsw i64 %i.011, 1
138 %exitcond15 = icmp ne i64 %inc25, %n
139 br i1 %exitcond15, label %for.cond1.preheader, label %for.end26.loopexit
141 for.end26.loopexit: ; preds = %for.inc24
144 for.end26: ; preds = %for.end26.loopexit, %entry
149 ; This ridiculous example is disabled: it does not make sense to keep it.
150 ;; for (long int i = 0; i < n; i++)
151 ;; for (long int j = 0; j < n; j++)
152 ;; for (long int k = 0; k < n; k++)
153 ;; for (long int l = 0; l < n; l++)
154 ;; for (long int m = 0; m < n; m++)
155 ;; for (long int o = 0; o < n; o++)
156 ;; for (long int p = 0; p < n; p++)
157 ;; for (long int q = 0; q < n; q++)
158 ;; for (long int r = 0; r < n; r++)
159 ;; for (long int s = 0; s < n; s++)
160 ;; for (long int u = 0; u < n; u++)
161 ;; for (long int t = 0; t < n; t++) {
162 ;; A[i - 3] [j] [2] [k-1] [2*l + 1] [m] [p + q] [r + s] = i;
163 ;; *B++ = A[i + 3] [2] [u] [1-k] [3*l - 1] [o] [1 + n] [t + 2];
165 ;define void @p3(i64 %n, [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64* %B) nounwind uwtable ssp {
167 ; %cmp44 = icmp sgt i64 %n, 0
168 ; br i1 %cmp44, label %for.cond1.preheader.preheader, label %for.end90
170 ;; DONT-CHECK-LABEL: p3
171 ;; DONT-CHECK: da analyze - output [* * * * * S * * * * S S]!
172 ;; DONT-CHECK: da analyze - flow [* * * * * * * * * * * *|<]!
173 ;; DONT-CHECK: da analyze - confused!
174 ;; DONT-CHECK: da analyze - input [* S * * S * S S S S * *]!
175 ;; DONT-CHECK: da analyze - confused!
176 ;; DONT-CHECK: da analyze - output [* * * * * * * * * * * *]!
178 ;for.cond1.preheader.preheader: ; preds = %entry
179 ; br label %for.cond1.preheader
181 ;for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc88
182 ; %B.addr.046 = phi i64* [ %B.addr.1.lcssa, %for.inc88 ], [ %B, %for.cond1.preheader.preheader ]
183 ; %i.045 = phi i64 [ %inc89, %for.inc88 ], [ 0, %for.cond1.preheader.preheader ]
184 ; %cmp240 = icmp sgt i64 %n, 0
185 ; br i1 %cmp240, label %for.cond4.preheader.preheader, label %for.inc88
187 ;for.cond4.preheader.preheader: ; preds = %for.cond1.preheader
188 ; br label %for.cond4.preheader
190 ;for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.inc85
191 ; %B.addr.142 = phi i64* [ %B.addr.2.lcssa, %for.inc85 ], [ %B.addr.046, %for.cond4.preheader.preheader ]
192 ; %j.041 = phi i64 [ %inc86, %for.inc85 ], [ 0, %for.cond4.preheader.preheader ]
193 ; %cmp536 = icmp sgt i64 %n, 0
194 ; br i1 %cmp536, label %for.cond7.preheader.preheader, label %for.inc85
196 ;for.cond7.preheader.preheader: ; preds = %for.cond4.preheader
197 ; br label %for.cond7.preheader
199 ;for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.inc82
200 ; %B.addr.238 = phi i64* [ %B.addr.3.lcssa, %for.inc82 ], [ %B.addr.142, %for.cond7.preheader.preheader ]
201 ; %k.037 = phi i64 [ %inc83, %for.inc82 ], [ 0, %for.cond7.preheader.preheader ]
202 ; %cmp832 = icmp sgt i64 %n, 0
203 ; br i1 %cmp832, label %for.cond10.preheader.preheader, label %for.inc82
205 ;for.cond10.preheader.preheader: ; preds = %for.cond7.preheader
206 ; br label %for.cond10.preheader
208 ;for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.inc79
209 ; %B.addr.334 = phi i64* [ %B.addr.4.lcssa, %for.inc79 ], [ %B.addr.238, %for.cond10.preheader.preheader ]
210 ; %l.033 = phi i64 [ %inc80, %for.inc79 ], [ 0, %for.cond10.preheader.preheader ]
211 ; %cmp1128 = icmp sgt i64 %n, 0
212 ; br i1 %cmp1128, label %for.cond13.preheader.preheader, label %for.inc79
214 ;for.cond13.preheader.preheader: ; preds = %for.cond10.preheader
215 ; br label %for.cond13.preheader
217 ;for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.inc76
218 ; %B.addr.430 = phi i64* [ %B.addr.5.lcssa, %for.inc76 ], [ %B.addr.334, %for.cond13.preheader.preheader ]
219 ; %m.029 = phi i64 [ %inc77, %for.inc76 ], [ 0, %for.cond13.preheader.preheader ]
220 ; %cmp1424 = icmp sgt i64 %n, 0
221 ; br i1 %cmp1424, label %for.cond16.preheader.preheader, label %for.inc76
223 ;for.cond16.preheader.preheader: ; preds = %for.cond13.preheader
224 ; br label %for.cond16.preheader
226 ;for.cond16.preheader: ; preds = %for.cond16.preheader.preheader, %for.inc73
227 ; %B.addr.526 = phi i64* [ %B.addr.6.lcssa, %for.inc73 ], [ %B.addr.430, %for.cond16.preheader.preheader ]
228 ; %o.025 = phi i64 [ %inc74, %for.inc73 ], [ 0, %for.cond16.preheader.preheader ]
229 ; %cmp1720 = icmp sgt i64 %n, 0
230 ; br i1 %cmp1720, label %for.cond19.preheader.preheader, label %for.inc73
232 ;for.cond19.preheader.preheader: ; preds = %for.cond16.preheader
233 ; br label %for.cond19.preheader
235 ;for.cond19.preheader: ; preds = %for.cond19.preheader.preheader, %for.inc70
236 ; %B.addr.622 = phi i64* [ %B.addr.7.lcssa, %for.inc70 ], [ %B.addr.526, %for.cond19.preheader.preheader ]
237 ; %p.021 = phi i64 [ %inc71, %for.inc70 ], [ 0, %for.cond19.preheader.preheader ]
238 ; %cmp2016 = icmp sgt i64 %n, 0
239 ; br i1 %cmp2016, label %for.cond22.preheader.preheader, label %for.inc70
241 ;for.cond22.preheader.preheader: ; preds = %for.cond19.preheader
242 ; br label %for.cond22.preheader
244 ;for.cond22.preheader: ; preds = %for.cond22.preheader.preheader, %for.inc67
245 ; %B.addr.718 = phi i64* [ %B.addr.8.lcssa, %for.inc67 ], [ %B.addr.622, %for.cond22.preheader.preheader ]
246 ; %q.017 = phi i64 [ %inc68, %for.inc67 ], [ 0, %for.cond22.preheader.preheader ]
247 ; %cmp2312 = icmp sgt i64 %n, 0
248 ; br i1 %cmp2312, label %for.cond25.preheader.preheader, label %for.inc67
250 ;for.cond25.preheader.preheader: ; preds = %for.cond22.preheader
251 ; br label %for.cond25.preheader
253 ;for.cond25.preheader: ; preds = %for.cond25.preheader.preheader, %for.inc64
254 ; %B.addr.814 = phi i64* [ %B.addr.9.lcssa, %for.inc64 ], [ %B.addr.718, %for.cond25.preheader.preheader ]
255 ; %r.013 = phi i64 [ %inc65, %for.inc64 ], [ 0, %for.cond25.preheader.preheader ]
256 ; %cmp268 = icmp sgt i64 %n, 0
257 ; br i1 %cmp268, label %for.cond28.preheader.preheader, label %for.inc64
259 ;for.cond28.preheader.preheader: ; preds = %for.cond25.preheader
260 ; br label %for.cond28.preheader
262 ;for.cond28.preheader: ; preds = %for.cond28.preheader.preheader, %for.inc61
263 ; %B.addr.910 = phi i64* [ %B.addr.10.lcssa, %for.inc61 ], [ %B.addr.814, %for.cond28.preheader.preheader ]
264 ; %s.09 = phi i64 [ %inc62, %for.inc61 ], [ 0, %for.cond28.preheader.preheader ]
265 ; %cmp294 = icmp sgt i64 %n, 0
266 ; br i1 %cmp294, label %for.cond31.preheader.preheader, label %for.inc61
268 ;for.cond31.preheader.preheader: ; preds = %for.cond28.preheader
269 ; br label %for.cond31.preheader
271 ;for.cond31.preheader: ; preds = %for.cond31.preheader.preheader, %for.inc58
272 ; %u.06 = phi i64 [ %inc59, %for.inc58 ], [ 0, %for.cond31.preheader.preheader ]
273 ; %B.addr.105 = phi i64* [ %B.addr.11.lcssa, %for.inc58 ], [ %B.addr.910, %for.cond31.preheader.preheader ]
274 ; %cmp321 = icmp sgt i64 %n, 0
275 ; br i1 %cmp321, label %for.body33.preheader, label %for.inc58
277 ;for.body33.preheader: ; preds = %for.cond31.preheader
278 ; br label %for.body33
280 ;for.body33: ; preds = %for.body33.preheader, %for.body33
281 ; %t.03 = phi i64 [ %inc, %for.body33 ], [ 0, %for.body33.preheader ]
282 ; %B.addr.112 = phi i64* [ %incdec.ptr, %for.body33 ], [ %B.addr.105, %for.body33.preheader ]
283 ; %add = add nsw i64 %r.013, %s.09
284 ; %add34 = add nsw i64 %p.021, %q.017
285 ; %mul = shl nsw i64 %l.033, 1
286 ; %add3547 = or i64 %mul, 1
287 ; %sub = add nsw i64 %k.037, -1
288 ; %sub36 = add nsw i64 %i.045, -3
289 ; %arrayidx43 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]], [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64 %sub36, i64 %j.041, i64 2, i64 %sub, i64 %add3547, i64 %m.029, i64 %add34, i64 %add
290 ; store i64 %i.045, i64* %arrayidx43, align 8
291 ; %add44 = add nsw i64 %t.03, 2
292 ; %add45 = add nsw i64 %n, 1
293 ; %mul46 = mul nsw i64 %l.033, 3
294 ; %sub47 = add nsw i64 %mul46, -1
295 ; %sub48 = sub nsw i64 1, %k.037
296 ; %add49 = add nsw i64 %i.045, 3
297 ; %arrayidx57 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]], [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64 %add49, i64 2, i64 %u.06, i64 %sub48, i64 %sub47, i64 %o.025, i64 %add45, i64 %add44
298 ; %0 = load i64, i64* %arrayidx57, align 8
299 ; %incdec.ptr = getelementptr inbounds i64, i64* %B.addr.112, i64 1
300 ; store i64 %0, i64* %B.addr.112, align 8
301 ; %inc = add nsw i64 %t.03, 1
302 ; %exitcond = icmp ne i64 %inc, %n
303 ; br i1 %exitcond, label %for.body33, label %for.inc58.loopexit
305 ;for.inc58.loopexit: ; preds = %for.body33
306 ; %scevgep = getelementptr i64, i64* %B.addr.105, i64 %n
307 ; br label %for.inc58
309 ;for.inc58: ; preds = %for.inc58.loopexit, %for.cond31.preheader
310 ; %B.addr.11.lcssa = phi i64* [ %B.addr.105, %for.cond31.preheader ], [ %scevgep, %for.inc58.loopexit ]
311 ; %inc59 = add nsw i64 %u.06, 1
312 ; %exitcond48 = icmp ne i64 %inc59, %n
313 ; br i1 %exitcond48, label %for.cond31.preheader, label %for.inc61.loopexit
315 ;for.inc61.loopexit: ; preds = %for.inc58
316 ; %B.addr.11.lcssa.lcssa = phi i64* [ %B.addr.11.lcssa, %for.inc58 ]
317 ; br label %for.inc61
319 ;for.inc61: ; preds = %for.inc61.loopexit, %for.cond28.preheader
320 ; %B.addr.10.lcssa = phi i64* [ %B.addr.910, %for.cond28.preheader ], [ %B.addr.11.lcssa.lcssa, %for.inc61.loopexit ]
321 ; %inc62 = add nsw i64 %s.09, 1
322 ; %exitcond49 = icmp ne i64 %inc62, %n
323 ; br i1 %exitcond49, label %for.cond28.preheader, label %for.inc64.loopexit
325 ;for.inc64.loopexit: ; preds = %for.inc61
326 ; %B.addr.10.lcssa.lcssa = phi i64* [ %B.addr.10.lcssa, %for.inc61 ]
327 ; br label %for.inc64
329 ;for.inc64: ; preds = %for.inc64.loopexit, %for.cond25.preheader
330 ; %B.addr.9.lcssa = phi i64* [ %B.addr.814, %for.cond25.preheader ], [ %B.addr.10.lcssa.lcssa, %for.inc64.loopexit ]
331 ; %inc65 = add nsw i64 %r.013, 1
332 ; %exitcond50 = icmp ne i64 %inc65, %n
333 ; br i1 %exitcond50, label %for.cond25.preheader, label %for.inc67.loopexit
335 ;for.inc67.loopexit: ; preds = %for.inc64
336 ; %B.addr.9.lcssa.lcssa = phi i64* [ %B.addr.9.lcssa, %for.inc64 ]
337 ; br label %for.inc67
339 ;for.inc67: ; preds = %for.inc67.loopexit, %for.cond22.preheader
340 ; %B.addr.8.lcssa = phi i64* [ %B.addr.718, %for.cond22.preheader ], [ %B.addr.9.lcssa.lcssa, %for.inc67.loopexit ]
341 ; %inc68 = add nsw i64 %q.017, 1
342 ; %exitcond51 = icmp ne i64 %inc68, %n
343 ; br i1 %exitcond51, label %for.cond22.preheader, label %for.inc70.loopexit
345 ;for.inc70.loopexit: ; preds = %for.inc67
346 ; %B.addr.8.lcssa.lcssa = phi i64* [ %B.addr.8.lcssa, %for.inc67 ]
347 ; br label %for.inc70
349 ;for.inc70: ; preds = %for.inc70.loopexit, %for.cond19.preheader
350 ; %B.addr.7.lcssa = phi i64* [ %B.addr.622, %for.cond19.preheader ], [ %B.addr.8.lcssa.lcssa, %for.inc70.loopexit ]
351 ; %inc71 = add nsw i64 %p.021, 1
352 ; %exitcond52 = icmp ne i64 %inc71, %n
353 ; br i1 %exitcond52, label %for.cond19.preheader, label %for.inc73.loopexit
355 ;for.inc73.loopexit: ; preds = %for.inc70
356 ; %B.addr.7.lcssa.lcssa = phi i64* [ %B.addr.7.lcssa, %for.inc70 ]
357 ; br label %for.inc73
359 ;for.inc73: ; preds = %for.inc73.loopexit, %for.cond16.preheader
360 ; %B.addr.6.lcssa = phi i64* [ %B.addr.526, %for.cond16.preheader ], [ %B.addr.7.lcssa.lcssa, %for.inc73.loopexit ]
361 ; %inc74 = add nsw i64 %o.025, 1
362 ; %exitcond53 = icmp ne i64 %inc74, %n
363 ; br i1 %exitcond53, label %for.cond16.preheader, label %for.inc76.loopexit
365 ;for.inc76.loopexit: ; preds = %for.inc73
366 ; %B.addr.6.lcssa.lcssa = phi i64* [ %B.addr.6.lcssa, %for.inc73 ]
367 ; br label %for.inc76
369 ;for.inc76: ; preds = %for.inc76.loopexit, %for.cond13.preheader
370 ; %B.addr.5.lcssa = phi i64* [ %B.addr.430, %for.cond13.preheader ], [ %B.addr.6.lcssa.lcssa, %for.inc76.loopexit ]
371 ; %inc77 = add nsw i64 %m.029, 1
372 ; %exitcond54 = icmp ne i64 %inc77, %n
373 ; br i1 %exitcond54, label %for.cond13.preheader, label %for.inc79.loopexit
375 ;for.inc79.loopexit: ; preds = %for.inc76
376 ; %B.addr.5.lcssa.lcssa = phi i64* [ %B.addr.5.lcssa, %for.inc76 ]
377 ; br label %for.inc79
379 ;for.inc79: ; preds = %for.inc79.loopexit, %for.cond10.preheader
380 ; %B.addr.4.lcssa = phi i64* [ %B.addr.334, %for.cond10.preheader ], [ %B.addr.5.lcssa.lcssa, %for.inc79.loopexit ]
381 ; %inc80 = add nsw i64 %l.033, 1
382 ; %exitcond55 = icmp ne i64 %inc80, %n
383 ; br i1 %exitcond55, label %for.cond10.preheader, label %for.inc82.loopexit
385 ;for.inc82.loopexit: ; preds = %for.inc79
386 ; %B.addr.4.lcssa.lcssa = phi i64* [ %B.addr.4.lcssa, %for.inc79 ]
387 ; br label %for.inc82
389 ;for.inc82: ; preds = %for.inc82.loopexit, %for.cond7.preheader
390 ; %B.addr.3.lcssa = phi i64* [ %B.addr.238, %for.cond7.preheader ], [ %B.addr.4.lcssa.lcssa, %for.inc82.loopexit ]
391 ; %inc83 = add nsw i64 %k.037, 1
392 ; %exitcond56 = icmp ne i64 %inc83, %n
393 ; br i1 %exitcond56, label %for.cond7.preheader, label %for.inc85.loopexit
395 ;for.inc85.loopexit: ; preds = %for.inc82
396 ; %B.addr.3.lcssa.lcssa = phi i64* [ %B.addr.3.lcssa, %for.inc82 ]
397 ; br label %for.inc85
399 ;for.inc85: ; preds = %for.inc85.loopexit, %for.cond4.preheader
400 ; %B.addr.2.lcssa = phi i64* [ %B.addr.142, %for.cond4.preheader ], [ %B.addr.3.lcssa.lcssa, %for.inc85.loopexit ]
401 ; %inc86 = add nsw i64 %j.041, 1
402 ; %exitcond57 = icmp ne i64 %inc86, %n
403 ; br i1 %exitcond57, label %for.cond4.preheader, label %for.inc88.loopexit
405 ;for.inc88.loopexit: ; preds = %for.inc85
406 ; %B.addr.2.lcssa.lcssa = phi i64* [ %B.addr.2.lcssa, %for.inc85 ]
407 ; br label %for.inc88
409 ;for.inc88: ; preds = %for.inc88.loopexit, %for.cond1.preheader
410 ; %B.addr.1.lcssa = phi i64* [ %B.addr.046, %for.cond1.preheader ], [ %B.addr.2.lcssa.lcssa, %for.inc88.loopexit ]
411 ; %inc89 = add nsw i64 %i.045, 1
412 ; %exitcond58 = icmp ne i64 %inc89, %n
413 ; br i1 %exitcond58, label %for.cond1.preheader, label %for.end90.loopexit
415 ;for.end90.loopexit: ; preds = %for.inc88
416 ; br label %for.end90
418 ;for.end90: ; preds = %for.end90.loopexit, %entry
423 ;;void p4(int *A, int *B, long int n) {
424 ;; for (char i = 0; i < n; i++) {
428 define void @p4(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
430 %cmp1 = icmp sgt i64 %n, 0
431 br i1 %cmp1, label %for.body.preheader, label %for.end
434 ; CHECK: da analyze - output [*]!
435 ; CHECK: da analyze - flow [*|<]!
436 ; CHECK: da analyze - confused!
437 ; CHECK: da analyze - input [*]!
438 ; CHECK: da analyze - confused!
439 ; CHECK: da analyze - none!
441 for.body.preheader: ; preds = %entry
444 for.body: ; preds = %for.body.preheader, %for.body
445 %i.03 = phi i8 [ %inc, %for.body ], [ 0, %for.body.preheader ]
446 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
447 %conv2 = sext i8 %i.03 to i32
448 %conv3 = sext i8 %i.03 to i64
449 %add = add i64 %conv3, 2
450 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
451 store i32 %conv2, i32* %arrayidx, align 4
452 %idxprom4 = sext i8 %i.03 to i64
453 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %idxprom4
454 %0 = load i32, i32* %arrayidx5, align 4
455 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
456 store i32 %0, i32* %B.addr.02, align 4
457 %inc = add i8 %i.03, 1
458 %conv = sext i8 %inc to i64
459 %cmp = icmp slt i64 %conv, %n
460 br i1 %cmp, label %for.body, label %for.end.loopexit
462 for.end.loopexit: ; preds = %for.body
465 for.end: ; preds = %for.end.loopexit, %entry
470 ;;void p5(int *A, int *B, long int n) {
471 ;; for (short i = 0; i < n; i++) {
475 define void @p5(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
477 %cmp1 = icmp sgt i64 %n, 0
478 br i1 %cmp1, label %for.body.preheader, label %for.end
481 ; CHECK: da analyze - output [*]!
482 ; CHECK: da analyze - flow [*|<]!
483 ; CHECK: da analyze - confused!
484 ; CHECK: da analyze - input [*]!
485 ; CHECK: da analyze - confused!
486 ; CHECK: da analyze - none!
488 for.body.preheader: ; preds = %entry
491 for.body: ; preds = %for.body.preheader, %for.body
492 %i.03 = phi i16 [ %inc, %for.body ], [ 0, %for.body.preheader ]
493 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
494 %conv2 = sext i16 %i.03 to i32
495 %conv3 = sext i16 %i.03 to i64
496 %add = add i64 %conv3, 2
497 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
498 store i32 %conv2, i32* %arrayidx, align 4
499 %idxprom4 = sext i16 %i.03 to i64
500 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %idxprom4
501 %0 = load i32, i32* %arrayidx5, align 4
502 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
503 store i32 %0, i32* %B.addr.02, align 4
504 %inc = add i16 %i.03, 1
505 %conv = sext i16 %inc to i64
506 %cmp = icmp slt i64 %conv, %n
507 br i1 %cmp, label %for.body, label %for.end.loopexit
509 for.end.loopexit: ; preds = %for.body
512 for.end: ; preds = %for.end.loopexit, %entry
517 ;;void p6(int *A, int *B, long int n) {
518 ;; for (int i = 0; i < n; i++) {
522 define void @p6(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
524 %cmp1 = icmp sgt i64 %n, 0
525 br i1 %cmp1, label %for.body.preheader, label %for.end
528 ; CHECK: da analyze - none!
529 ; CHECK: da analyze - consistent flow [2]!
530 ; CHECK: da analyze - confused!
531 ; CHECK: da analyze - none!
532 ; CHECK: da analyze - confused!
533 ; CHECK: da analyze - none!
535 for.body.preheader: ; preds = %entry
538 for.body: ; preds = %for.body.preheader, %for.body
539 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
540 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
541 %0 = add nsw i64 %indvars.iv, 2
542 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %0
543 %1 = trunc i64 %indvars.iv to i32
544 store i32 %1, i32* %arrayidx, align 4
545 %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
546 %2 = load i32, i32* %arrayidx3, align 4
547 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
548 store i32 %2, i32* %B.addr.02, align 4
549 %indvars.iv.next = add i64 %indvars.iv, 1
550 %exitcond = icmp ne i64 %indvars.iv.next, %n
551 br i1 %exitcond, label %for.body, label %for.end.loopexit
553 for.end.loopexit: ; preds = %for.body
556 for.end: ; preds = %for.end.loopexit, %entry
561 ;;void p7(unsigned *A, unsigned *B, char n) {
565 define void @p7(i32* %A, i32* %B, i8 signext %n) nounwind uwtable ssp {
567 %idxprom = sext i8 %n to i64
568 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
571 ; CHECK: da analyze - none!
572 ; CHECK: da analyze - none!
573 ; CHECK: da analyze - confused!
574 ; CHECK: da analyze - none!
575 ; CHECK: da analyze - confused!
576 ; CHECK: da analyze - none!
578 store i32 0, i32* %arrayidx, align 4
579 %conv = sext i8 %n to i64
580 %add = add i64 %conv, 1
581 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %add
582 %0 = load i32, i32* %arrayidx2, align 4
583 store i32 %0, i32* %B, align 4
588 ;;void p8(unsigned *A, unsigned *B, short n) {
592 define void @p8(i32* %A, i32* %B, i16 signext %n) nounwind uwtable ssp {
594 %idxprom = sext i16 %n to i64
595 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
596 store i32 0, i32* %arrayidx, align 4
599 ; CHECK: da analyze - none!
600 ; CHECK: da analyze - none!
601 ; CHECK: da analyze - confused!
602 ; CHECK: da analyze - none!
603 ; CHECK: da analyze - confused!
604 ; CHECK: da analyze - none!
606 %conv = sext i16 %n to i64
607 %add = add i64 %conv, 1
608 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %add
609 %0 = load i32, i32* %arrayidx2, align 4
610 store i32 %0, i32* %B, align 4
615 ;;void p9(unsigned *A, unsigned *B, int n) {
619 define void @p9(i32* %A, i32* %B, i32 %n) nounwind uwtable ssp {
621 %idxprom = sext i32 %n to i64
622 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
623 store i32 0, i32* %arrayidx, align 4
626 ; CHECK: da analyze - none!
627 ; CHECK: da analyze - flow [|<]!
628 ; CHECK: da analyze - confused!
629 ; CHECK: da analyze - none!
630 ; CHECK: da analyze - confused!
631 ; CHECK: da analyze - none!
633 %add = add nsw i32 %n, 1
634 %idxprom1 = sext i32 %add to i64
635 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1
636 %0 = load i32, i32* %arrayidx2, align 4
637 store i32 %0, i32* %B, align 4
642 ;;void p10(unsigned *A, unsigned *B, unsigned n) {
646 define void @p10(i32* %A, i32* %B, i32 %n) nounwind uwtable ssp {
648 %idxprom = zext i32 %n to i64
649 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
650 store i32 0, i32* %arrayidx, align 4
653 ; CHECK: da analyze - none!
654 ; CHECK: da analyze - flow [|<]!
655 ; CHECK: da analyze - confused!
656 ; CHECK: da analyze - none!
657 ; CHECK: da analyze - confused!
658 ; CHECK: da analyze - none!
661 %idxprom1 = zext i32 %add to i64
662 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1
663 %0 = load i32, i32* %arrayidx2, align 4
664 store i32 %0, i32* %B, align 4
669 ;;typedef struct { int v; } S;
671 ;;void f(S *s, unsigned size) {
672 ;; S *i = s, *e = s + size - 1;
677 %struct.S = type { i32 }
679 define void @foo(%struct.S* %s, i32 %size) nounwind uwtable ssp {
681 %idx.ext = zext i32 %size to i64
682 %add.ptr.sum = add i64 %idx.ext, -1
683 %add.ptr1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 %add.ptr.sum
684 %cmp1 = icmp eq i64 %add.ptr.sum, 0
685 br i1 %cmp1, label %while.end, label %while.body.preheader
688 ; CHECK: da analyze - none!
689 ; CHECK: da analyze - consistent anti [1]!
690 ; CHECK: da analyze - none!
692 while.body.preheader: ; preds = %entry
695 while.body: ; preds = %while.body.preheader, %while.body
696 %i.02 = phi %struct.S* [ %incdec.ptr, %while.body ], [ %s, %while.body.preheader ]
697 %0 = getelementptr inbounds %struct.S, %struct.S* %i.02, i64 1, i32 0
698 %1 = load i32, i32* %0, align 4
699 %2 = getelementptr inbounds %struct.S, %struct.S* %i.02, i64 0, i32 0
700 store i32 %1, i32* %2, align 4
701 %incdec.ptr = getelementptr inbounds %struct.S, %struct.S* %i.02, i64 1
702 %cmp = icmp eq %struct.S* %incdec.ptr, %add.ptr1
703 br i1 %cmp, label %while.end.loopexit, label %while.body
705 while.end.loopexit: ; preds = %while.body
708 while.end: ; preds = %while.end.loopexit, %entry
712 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind