1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
4 ; ModuleID = 'SymbolicRDIV.bc'
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 < n1; i++)
11 ;; for (long int j = 0; j < n2; j++)
12 ;; *B++ = A[3*j + 3*n1];
14 define void @symbolicrdiv0(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
16 %cmp4 = icmp eq i64 %n1, 0
17 br i1 %cmp4, label %for.cond1.preheader, label %for.body.preheader
19 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv0'
20 ; CHECK: da analyze - none!
21 ; CHECK: da analyze - none!
22 ; CHECK: da analyze - confused!
23 ; CHECK: da analyze - none!
24 ; CHECK: da analyze - confused!
25 ; CHECK: da analyze - none!
27 for.body.preheader: ; preds = %entry
30 for.cond1.preheader.loopexit: ; preds = %for.body
31 br label %for.cond1.preheader
33 for.cond1.preheader: ; preds = %for.cond1.preheader.loopexit, %entry
34 %cmp21 = icmp eq i64 %n2, 0
35 br i1 %cmp21, label %for.end11, label %for.body4.preheader
37 for.body4.preheader: ; preds = %for.cond1.preheader
40 for.body: ; preds = %for.body.preheader, %for.body
41 %i.05 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
42 %conv = trunc i64 %i.05 to i32
43 %mul = shl nsw i64 %i.05, 1
44 %add = add i64 %mul, %n1
45 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
46 store i32 %conv, ptr %arrayidx, align 4
47 %inc = add nsw i64 %i.05, 1
48 %exitcond = icmp ne i64 %inc, %n1
49 br i1 %exitcond, label %for.body, label %for.cond1.preheader.loopexit
51 for.body4: ; preds = %for.body4.preheader, %for.body4
52 %j.03 = phi i64 [ %inc10, %for.body4 ], [ 0, %for.body4.preheader ]
53 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
54 %mul56 = add i64 %j.03, %n1
55 %add7 = mul i64 %mul56, 3
56 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %add7
57 %0 = load i32, ptr %arrayidx8, align 4
58 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
59 store i32 %0, ptr %B.addr.02, align 4
60 %inc10 = add nsw i64 %j.03, 1
61 %exitcond7 = icmp ne i64 %inc10, %n2
62 br i1 %exitcond7, label %for.body4, label %for.end11.loopexit
64 for.end11.loopexit: ; preds = %for.body4
67 for.end11: ; preds = %for.end11.loopexit, %for.cond1.preheader
72 ;; for (long int i = 0; i < n1; i++)
74 ;; for (long int j = 0; j < n2; j++)
75 ;; *B++ = A[3*j + 2*n2];
77 define void @symbolicrdiv1(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
79 %cmp4 = icmp eq i64 %n1, 0
80 br i1 %cmp4, label %for.cond2.preheader, label %for.body.preheader
82 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv1'
83 ; CHECK: da analyze - none!
84 ; CHECK: da analyze - none!
85 ; CHECK: da analyze - confused!
86 ; CHECK: da analyze - none!
87 ; CHECK: da analyze - confused!
88 ; CHECK: da analyze - none!
90 for.body.preheader: ; preds = %entry
93 for.cond2.preheader.loopexit: ; preds = %for.body
94 br label %for.cond2.preheader
96 for.cond2.preheader: ; preds = %for.cond2.preheader.loopexit, %entry
97 %cmp31 = icmp eq i64 %n2, 0
98 br i1 %cmp31, label %for.end12, label %for.body5.preheader
100 for.body5.preheader: ; preds = %for.cond2.preheader
103 for.body: ; preds = %for.body.preheader, %for.body
104 %i.05 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
105 %conv = trunc i64 %i.05 to i32
106 %mul = shl nsw i64 %i.05, 1
107 %mul1 = mul i64 %n2, 5
108 %add = add i64 %mul, %mul1
109 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
110 store i32 %conv, ptr %arrayidx, align 4
111 %inc = add nsw i64 %i.05, 1
112 %exitcond = icmp ne i64 %inc, %n1
113 br i1 %exitcond, label %for.body, label %for.cond2.preheader.loopexit
115 for.body5: ; preds = %for.body5.preheader, %for.body5
116 %j.03 = phi i64 [ %inc11, %for.body5 ], [ 0, %for.body5.preheader ]
117 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body5 ], [ %B, %for.body5.preheader ]
118 %mul6 = mul nsw i64 %j.03, 3
119 %mul7 = shl i64 %n2, 1
120 %add8 = add i64 %mul6, %mul7
121 %arrayidx9 = getelementptr inbounds i32, ptr %A, i64 %add8
122 %0 = load i32, ptr %arrayidx9, align 4
123 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
124 store i32 %0, ptr %B.addr.02, align 4
125 %inc11 = add nsw i64 %j.03, 1
126 %exitcond6 = icmp ne i64 %inc11, %n2
127 br i1 %exitcond6, label %for.body5, label %for.end12.loopexit
129 for.end12.loopexit: ; preds = %for.body5
132 for.end12: ; preds = %for.end12.loopexit, %for.cond2.preheader
137 ;; for (long int i = 0; i < n1; i++)
139 ;; for (long int j = 0; j < n2; j++)
140 ;; *B++ = A[-j + 2*n1];
142 define void @symbolicrdiv2(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
144 %cmp4 = icmp eq i64 %n1, 0
145 br i1 %cmp4, label %for.cond1.preheader, label %for.body.preheader
147 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv2'
148 ; CHECK: da analyze - none!
149 ; CHECK: da analyze - none!
150 ; CHECK: da analyze - confused!
151 ; CHECK: da analyze - none!
152 ; CHECK: da analyze - confused!
153 ; CHECK: da analyze - none!
155 for.body.preheader: ; preds = %entry
158 for.cond1.preheader.loopexit: ; preds = %for.body
159 br label %for.cond1.preheader
161 for.cond1.preheader: ; preds = %for.cond1.preheader.loopexit, %entry
162 %cmp21 = icmp eq i64 %n2, 0
163 br i1 %cmp21, label %for.end10, label %for.body4.preheader
165 for.body4.preheader: ; preds = %for.cond1.preheader
168 for.body: ; preds = %for.body.preheader, %for.body
169 %i.05 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
170 %conv = trunc i64 %i.05 to i32
171 %mul = shl nsw i64 %i.05, 1
172 %sub = sub i64 %mul, %n2
173 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %sub
174 store i32 %conv, ptr %arrayidx, align 4
175 %inc = add nsw i64 %i.05, 1
176 %exitcond = icmp ne i64 %inc, %n1
177 br i1 %exitcond, label %for.body, label %for.cond1.preheader.loopexit
179 for.body4: ; preds = %for.body4.preheader, %for.body4
180 %j.03 = phi i64 [ %inc9, %for.body4 ], [ 0, %for.body4.preheader ]
181 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
182 %mul6 = shl i64 %n1, 1
183 %add = sub i64 %mul6, %j.03
184 %arrayidx7 = getelementptr inbounds i32, ptr %A, i64 %add
185 %0 = load i32, ptr %arrayidx7, align 4
186 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
187 store i32 %0, ptr %B.addr.02, align 4
188 %inc9 = add nsw i64 %j.03, 1
189 %exitcond6 = icmp ne i64 %inc9, %n2
190 br i1 %exitcond6, label %for.body4, label %for.end10.loopexit
192 for.end10.loopexit: ; preds = %for.body4
195 for.end10: ; preds = %for.end10.loopexit, %for.cond1.preheader
200 ;; for (long int i = 0; i < n1; i++)
202 ;; for (long int j = 0; j < n2; j++)
205 define void @symbolicrdiv3(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
207 %cmp4 = icmp eq i64 %n1, 0
208 br i1 %cmp4, label %for.cond1.preheader, label %for.body.preheader
210 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv3'
211 ; CHECK: da analyze - none!
212 ; CHECK: da analyze - none!
213 ; CHECK: da analyze - confused!
214 ; CHECK: da analyze - none!
215 ; CHECK: da analyze - confused!
216 ; CHECK: da analyze - none!
218 for.body.preheader: ; preds = %entry
221 for.cond1.preheader.loopexit: ; preds = %for.body
222 br label %for.cond1.preheader
224 for.cond1.preheader: ; preds = %for.cond1.preheader.loopexit, %entry
225 %cmp21 = icmp eq i64 %n2, 0
226 br i1 %cmp21, label %for.end9, label %for.body4.preheader
228 for.body4.preheader: ; preds = %for.cond1.preheader
231 for.body: ; preds = %for.body.preheader, %for.body
232 %i.05 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
233 %conv = trunc i64 %i.05 to i32
234 %add = sub i64 %n2, %i.05
235 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
236 store i32 %conv, ptr %arrayidx, align 4
237 %inc = add nsw i64 %i.05, 1
238 %exitcond = icmp ne i64 %inc, %n1
239 br i1 %exitcond, label %for.body, label %for.cond1.preheader.loopexit
241 for.body4: ; preds = %for.body4.preheader, %for.body4
242 %j.03 = phi i64 [ %inc8, %for.body4 ], [ 0, %for.body4.preheader ]
243 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
244 %sub5 = sub i64 %j.03, %n1
245 %arrayidx6 = getelementptr inbounds i32, ptr %A, i64 %sub5
246 %0 = load i32, ptr %arrayidx6, align 4
247 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
248 store i32 %0, ptr %B.addr.02, align 4
249 %inc8 = add nsw i64 %j.03, 1
250 %exitcond6 = icmp ne i64 %inc8, %n2
251 br i1 %exitcond6, label %for.body4, label %for.end9.loopexit
253 for.end9.loopexit: ; preds = %for.body4
256 for.end9: ; preds = %for.end9.loopexit, %for.cond1.preheader
261 ;; for (long int i = 0; i < n1; i++)
263 ;; for (long int j = 0; j < n2; j++)
264 ;; *B++ = A[-j + n1];
266 define void @symbolicrdiv4(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
268 %cmp4 = icmp eq i64 %n1, 0
269 br i1 %cmp4, label %for.cond1.preheader, label %for.body.preheader
271 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv4'
272 ; CHECK: da analyze - none!
273 ; CHECK: da analyze - none!
274 ; CHECK: da analyze - confused!
275 ; CHECK: da analyze - none!
276 ; CHECK: da analyze - confused!
277 ; CHECK: da analyze - none!
279 for.body.preheader: ; preds = %entry
282 for.cond1.preheader.loopexit: ; preds = %for.body
283 br label %for.cond1.preheader
285 for.cond1.preheader: ; preds = %for.cond1.preheader.loopexit, %entry
286 %cmp21 = icmp eq i64 %n2, 0
287 br i1 %cmp21, label %for.end10, label %for.body4.preheader
289 for.body4.preheader: ; preds = %for.cond1.preheader
292 for.body: ; preds = %for.body.preheader, %for.body
293 %i.05 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
294 %conv = trunc i64 %i.05 to i32
295 %mul = shl i64 %n1, 1
296 %add = sub i64 %mul, %i.05
297 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
298 store i32 %conv, ptr %arrayidx, align 4
299 %inc = add nsw i64 %i.05, 1
300 %exitcond = icmp ne i64 %inc, %n1
301 br i1 %exitcond, label %for.body, label %for.cond1.preheader.loopexit
303 for.body4: ; preds = %for.body4.preheader, %for.body4
304 %j.03 = phi i64 [ %inc9, %for.body4 ], [ 0, %for.body4.preheader ]
305 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
306 %add6 = sub i64 %n1, %j.03
307 %arrayidx7 = getelementptr inbounds i32, ptr %A, i64 %add6
308 %0 = load i32, ptr %arrayidx7, align 4
309 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
310 store i32 %0, ptr %B.addr.02, align 4
311 %inc9 = add nsw i64 %j.03, 1
312 %exitcond6 = icmp ne i64 %inc9, %n2
313 br i1 %exitcond6, label %for.body4, label %for.end10.loopexit
315 for.end10.loopexit: ; preds = %for.body4
318 for.end10: ; preds = %for.end10.loopexit, %for.cond1.preheader
323 ;; for (long int i = 0; i < n1; i++)
325 ;; for (long int j = 0; j < n2; j++)
326 ;; *B++ = A[-j + 2*n2];
328 define void @symbolicrdiv5(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
330 %cmp4 = icmp eq i64 %n1, 0
331 br i1 %cmp4, label %for.cond1.preheader, label %for.body.preheader
333 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv5'
334 ; CHECK: da analyze - none!
335 ; CHECK: da analyze - none!
336 ; CHECK: da analyze - confused!
337 ; CHECK: da analyze - none!
338 ; CHECK: da analyze - confused!
339 ; CHECK: da analyze - none!
341 for.body.preheader: ; preds = %entry
344 for.cond1.preheader.loopexit: ; preds = %for.body
345 br label %for.cond1.preheader
347 for.cond1.preheader: ; preds = %for.cond1.preheader.loopexit, %entry
348 %cmp21 = icmp eq i64 %n2, 0
349 br i1 %cmp21, label %for.end10, label %for.body4.preheader
351 for.body4.preheader: ; preds = %for.cond1.preheader
354 for.body: ; preds = %for.body.preheader, %for.body
355 %i.05 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
356 %conv = trunc i64 %i.05 to i32
357 %add = sub i64 %n2, %i.05
358 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
359 store i32 %conv, ptr %arrayidx, align 4
360 %inc = add nsw i64 %i.05, 1
361 %exitcond = icmp ne i64 %inc, %n1
362 br i1 %exitcond, label %for.body, label %for.cond1.preheader.loopexit
364 for.body4: ; preds = %for.body4.preheader, %for.body4
365 %j.03 = phi i64 [ %inc9, %for.body4 ], [ 0, %for.body4.preheader ]
366 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
367 %mul = shl i64 %n2, 1
368 %add6 = sub i64 %mul, %j.03
369 %arrayidx7 = getelementptr inbounds i32, ptr %A, i64 %add6
370 %0 = load i32, ptr %arrayidx7, align 4
371 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
372 store i32 %0, ptr %B.addr.02, align 4
373 %inc9 = add nsw i64 %j.03, 1
374 %exitcond6 = icmp ne i64 %inc9, %n2
375 br i1 %exitcond6, label %for.body4, label %for.end10.loopexit
377 for.end10.loopexit: ; preds = %for.body4
380 for.end10: ; preds = %for.end10.loopexit, %for.cond1.preheader
385 ;; for (long int i = 0; i < n1; i++)
386 ;; for (long int j = 0; j < n2; j++) {
390 define void @symbolicrdiv6(ptr %A, ptr %B, i64 %n1, i64 %n2) nounwind uwtable ssp {
392 %cmp4 = icmp eq i64 %n1, 0
393 br i1 %cmp4, label %for.end7, label %for.cond1.preheader.preheader
395 ; CHECK: 'Dependence Analysis' for function 'symbolicrdiv6'
396 ; CHECK: da analyze - output [* *]!
397 ; CHECK: da analyze - none!
398 ; CHECK: da analyze - confused!
399 ; CHECK: da analyze - consistent input [S S]!
400 ; CHECK: da analyze - confused!
401 ; CHECK: da analyze - output [* *]!
403 for.cond1.preheader.preheader: ; preds = %entry
404 br label %for.cond1.preheader
406 for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc5
407 %B.addr.06 = phi ptr [ %B.addr.1.lcssa, %for.inc5 ], [ %B, %for.cond1.preheader.preheader ]
408 %i.05 = phi i64 [ %inc6, %for.inc5 ], [ 0, %for.cond1.preheader.preheader ]
409 %cmp21 = icmp eq i64 %n2, 0
410 br i1 %cmp21, label %for.inc5, label %for.body3.preheader
412 for.body3.preheader: ; preds = %for.cond1.preheader
415 for.body3: ; preds = %for.body3.preheader, %for.body3
416 %j.03 = phi i64 [ %inc, %for.body3 ], [ 0, %for.body3.preheader ]
417 %B.addr.12 = phi ptr [ %incdec.ptr, %for.body3 ], [ %B.addr.06, %for.body3.preheader ]
418 %conv = trunc i64 %i.05 to i32
419 %sub = sub nsw i64 %j.03, %i.05
420 %add = add i64 %sub, %n2
421 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
422 store i32 %conv, ptr %arrayidx, align 4
423 %mul = shl i64 %n2, 1
424 %arrayidx4 = getelementptr inbounds i32, ptr %A, i64 %mul
425 %0 = load i32, ptr %arrayidx4, align 4
426 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.12, i64 1
427 store i32 %0, ptr %B.addr.12, align 4
428 %inc = add nsw i64 %j.03, 1
429 %exitcond = icmp ne i64 %inc, %n2
430 br i1 %exitcond, label %for.body3, label %for.inc5.loopexit
432 for.inc5.loopexit: ; preds = %for.body3
433 %scevgep = getelementptr i32, ptr %B.addr.06, i64 %n2
436 for.inc5: ; preds = %for.inc5.loopexit, %for.cond1.preheader
437 %B.addr.1.lcssa = phi ptr [ %B.addr.06, %for.cond1.preheader ], [ %scevgep, %for.inc5.loopexit ]
438 %inc6 = add nsw i64 %i.05, 1
439 %exitcond7 = icmp ne i64 %inc6, %n1
440 br i1 %exitcond7, label %for.cond1.preheader, label %for.end7.loopexit
442 for.end7.loopexit: ; preds = %for.inc5
445 for.end7: ; preds = %for.end7.loopexit, %entry