1; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
2; RUN: | FileCheck %s
3; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
4
5; ModuleID = 'ExactRDIV.bc'
6target 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"
7target triple = "x86_64-apple-macosx10.6.0"
8
9
10;;  for (long int i = 0; i < 10; i++)
11;;    A[4*i + 10] = i;
12;;  for (long int j = 0; j < 10; j++)
13;;    *B++ = A[2*j + 1];
14
15define void @rdiv0(i32* %A, i32* %B) nounwind uwtable ssp {
16entry:
17  br label %for.body
18
19; CHECK: da analyze - none!
20; CHECK: da analyze - none!
21; CHECK: da analyze - confused!
22; CHECK: da analyze - none!
23; CHECK: da analyze - confused!
24; CHECK: da analyze - none!
25
26for.body:                                         ; preds = %entry, %for.body
27  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
28  %conv = trunc i64 %i.03 to i32
29  %mul = shl nsw i64 %i.03, 2
30  %add = add nsw i64 %mul, 10
31  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
32  store i32 %conv, i32* %arrayidx, align 4
33  %inc = add nsw i64 %i.03, 1
34  %exitcond5 = icmp ne i64 %inc, 10
35  br i1 %exitcond5, label %for.body, label %for.body4.preheader
36
37for.body4.preheader:                              ; preds = %for.body
38  br label %for.body4
39
40for.body4:                                        ; preds = %for.body4.preheader, %for.body4
41  %j.02 = phi i64 [ %inc9, %for.body4 ], [ 0, %for.body4.preheader ]
42  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
43  %mul5 = shl nsw i64 %j.02, 1
44  %add64 = or i64 %mul5, 1
45  %arrayidx7 = getelementptr inbounds i32, i32* %A, i64 %add64
46  %0 = load i32, i32* %arrayidx7, align 4
47  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
48  store i32 %0, i32* %B.addr.01, align 4
49  %inc9 = add nsw i64 %j.02, 1
50  %exitcond = icmp ne i64 %inc9, 10
51  br i1 %exitcond, label %for.body4, label %for.end10
52
53for.end10:                                        ; preds = %for.body4
54  ret void
55}
56
57
58;;  for (long int i = 0; i < 5; i++)
59;;    A[11*i - 45] = i;
60;;  for (long int j = 0; j < 10; j++)
61;;    *B++ = A[j];
62
63define void @rdiv1(i32* %A, i32* %B) nounwind uwtable ssp {
64entry:
65  br label %for.body
66
67; CHECK: da analyze - none!
68; CHECK: da analyze - none!
69; CHECK: da analyze - confused!
70; CHECK: da analyze - none!
71; CHECK: da analyze - confused!
72; CHECK: da analyze - none!
73
74for.body:                                         ; preds = %entry, %for.body
75  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
76  %conv = trunc i64 %i.03 to i32
77  %mul = mul nsw i64 %i.03, 11
78  %sub = add nsw i64 %mul, -45
79  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
80  store i32 %conv, i32* %arrayidx, align 4
81  %inc = add nsw i64 %i.03, 1
82  %exitcond4 = icmp ne i64 %inc, 5
83  br i1 %exitcond4, label %for.body, label %for.body4.preheader
84
85for.body4.preheader:                              ; preds = %for.body
86  br label %for.body4
87
88for.body4:                                        ; preds = %for.body4.preheader, %for.body4
89  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
90  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
91  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02
92  %0 = load i32, i32* %arrayidx5, align 4
93  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
94  store i32 %0, i32* %B.addr.01, align 4
95  %inc7 = add nsw i64 %j.02, 1
96  %exitcond = icmp ne i64 %inc7, 10
97  br i1 %exitcond, label %for.body4, label %for.end8
98
99for.end8:                                         ; preds = %for.body4
100  ret void
101}
102
103
104;;  for (long int i = 0; i <= 5; i++)
105;;    A[11*i - 45] = i;
106;;  for (long int j = 0; j < 10; j++)
107;;    *B++ = A[j];
108
109define void @rdiv2(i32* %A, i32* %B) nounwind uwtable ssp {
110entry:
111  br label %for.body
112
113; CHECK: da analyze - none!
114; CHECK: da analyze - none!
115; CHECK: da analyze - confused!
116; CHECK: da analyze - none!
117; CHECK: da analyze - confused!
118; CHECK: da analyze - none!
119
120for.body:                                         ; preds = %entry, %for.body
121  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
122  %conv = trunc i64 %i.03 to i32
123  %mul = mul nsw i64 %i.03, 11
124  %sub = add nsw i64 %mul, -45
125  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
126  store i32 %conv, i32* %arrayidx, align 4
127  %inc = add nsw i64 %i.03, 1
128  %exitcond4 = icmp ne i64 %inc, 6
129  br i1 %exitcond4, label %for.body, label %for.body4.preheader
130
131for.body4.preheader:                              ; preds = %for.body
132  br label %for.body4
133
134for.body4:                                        ; preds = %for.body4.preheader, %for.body4
135  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
136  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
137  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02
138  %0 = load i32, i32* %arrayidx5, align 4
139  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
140  store i32 %0, i32* %B.addr.01, align 4
141  %inc7 = add nsw i64 %j.02, 1
142  %exitcond = icmp ne i64 %inc7, 10
143  br i1 %exitcond, label %for.body4, label %for.end8
144
145for.end8:                                         ; preds = %for.body4
146  ret void
147}
148
149
150;;  for (long int i = 0; i < 5; i++)
151;;    A[11*i - 45] = i;
152;;  for (long int j = 0; j <= 10; j++)
153;;    *B++ = A[j];
154
155define void @rdiv3(i32* %A, i32* %B) nounwind uwtable ssp {
156entry:
157  br label %for.body
158
159; CHECK: da analyze - none!
160; CHECK: da analyze - none!
161; CHECK: da analyze - confused!
162; CHECK: da analyze - none!
163; CHECK: da analyze - confused!
164; CHECK: da analyze - none!
165
166for.body:                                         ; preds = %entry, %for.body
167  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
168  %conv = trunc i64 %i.03 to i32
169  %mul = mul nsw i64 %i.03, 11
170  %sub = add nsw i64 %mul, -45
171  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
172  store i32 %conv, i32* %arrayidx, align 4
173  %inc = add nsw i64 %i.03, 1
174  %exitcond4 = icmp ne i64 %inc, 5
175  br i1 %exitcond4, label %for.body, label %for.body4.preheader
176
177for.body4.preheader:                              ; preds = %for.body
178  br label %for.body4
179
180for.body4:                                        ; preds = %for.body4.preheader, %for.body4
181  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
182  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
183  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02
184  %0 = load i32, i32* %arrayidx5, align 4
185  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
186  store i32 %0, i32* %B.addr.01, align 4
187  %inc7 = add nsw i64 %j.02, 1
188  %exitcond = icmp ne i64 %inc7, 11
189  br i1 %exitcond, label %for.body4, label %for.end8
190
191for.end8:                                         ; preds = %for.body4
192  ret void
193}
194
195
196;;  for (long int i = 0; i <= 5; i++)
197;;    A[11*i - 45] = i;
198;;  for (long int j = 0; j <= 10; j++)
199;;    *B++ = A[j];
200
201define void @rdiv4(i32* %A, i32* %B) nounwind uwtable ssp {
202entry:
203  br label %for.body
204
205; CHECK: da analyze - none!
206; CHECK: da analyze - flow [|<]!
207; CHECK: da analyze - confused!
208; CHECK: da analyze - none!
209; CHECK: da analyze - confused!
210; CHECK: da analyze - none!
211
212for.body:                                         ; preds = %entry, %for.body
213  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
214  %conv = trunc i64 %i.03 to i32
215  %mul = mul nsw i64 %i.03, 11
216  %sub = add nsw i64 %mul, -45
217  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
218  store i32 %conv, i32* %arrayidx, align 4
219  %inc = add nsw i64 %i.03, 1
220  %exitcond4 = icmp ne i64 %inc, 6
221  br i1 %exitcond4, label %for.body, label %for.body4.preheader
222
223for.body4.preheader:                              ; preds = %for.body
224  br label %for.body4
225
226for.body4:                                        ; preds = %for.body4.preheader, %for.body4
227  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
228  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
229  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02
230  %0 = load i32, i32* %arrayidx5, align 4
231  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
232  store i32 %0, i32* %B.addr.01, align 4
233  %inc7 = add nsw i64 %j.02, 1
234  %exitcond = icmp ne i64 %inc7, 11
235  br i1 %exitcond, label %for.body4, label %for.end8
236
237for.end8:                                         ; preds = %for.body4
238  ret void
239}
240
241
242;;  for (long int i = 0; i < 5; i++)
243;;    A[-11*i + 45] = i;
244;;  for (long int j = 0; j < 10; j++)
245;;    *B++ = A[-j];
246
247define void @rdiv5(i32* %A, i32* %B) nounwind uwtable ssp {
248entry:
249  br label %for.body
250
251; CHECK: da analyze - none!
252; CHECK: da analyze - none!
253; CHECK: da analyze - confused!
254; CHECK: da analyze - none!
255; CHECK: da analyze - confused!
256; CHECK: da analyze - none!
257
258for.body:                                         ; preds = %entry, %for.body
259  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
260  %conv = trunc i64 %i.03 to i32
261  %mul = mul nsw i64 %i.03, -11
262  %add = add nsw i64 %mul, 45
263  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
264  store i32 %conv, i32* %arrayidx, align 4
265  %inc = add nsw i64 %i.03, 1
266  %exitcond4 = icmp ne i64 %inc, 5
267  br i1 %exitcond4, label %for.body, label %for.body4.preheader
268
269for.body4.preheader:                              ; preds = %for.body
270  br label %for.body4
271
272for.body4:                                        ; preds = %for.body4.preheader, %for.body4
273  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
274  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
275  %sub = sub nsw i64 0, %j.02
276  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub
277  %0 = load i32, i32* %arrayidx5, align 4
278  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
279  store i32 %0, i32* %B.addr.01, align 4
280  %inc7 = add nsw i64 %j.02, 1
281  %exitcond = icmp ne i64 %inc7, 10
282  br i1 %exitcond, label %for.body4, label %for.end8
283
284for.end8:                                         ; preds = %for.body4
285  ret void
286}
287
288
289;;  for (long int i = 0; i <= 5; i++)
290;;    A[-11*i + 45] = i;
291;;  for (long int j = 0; j < 10; j++)
292;;    *B++ = A[-j];
293
294define void @rdiv6(i32* %A, i32* %B) nounwind uwtable ssp {
295entry:
296  br label %for.body
297
298; CHECK: da analyze - none!
299; CHECK: da analyze - none!
300; CHECK: da analyze - confused!
301; CHECK: da analyze - none!
302; CHECK: da analyze - confused!
303; CHECK: da analyze - none!
304
305for.body:                                         ; preds = %entry, %for.body
306  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
307  %conv = trunc i64 %i.03 to i32
308  %mul = mul nsw i64 %i.03, -11
309  %add = add nsw i64 %mul, 45
310  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
311  store i32 %conv, i32* %arrayidx, align 4
312  %inc = add nsw i64 %i.03, 1
313  %exitcond4 = icmp ne i64 %inc, 6
314  br i1 %exitcond4, label %for.body, label %for.body4.preheader
315
316for.body4.preheader:                              ; preds = %for.body
317  br label %for.body4
318
319for.body4:                                        ; preds = %for.body4.preheader, %for.body4
320  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
321  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
322  %sub = sub nsw i64 0, %j.02
323  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub
324  %0 = load i32, i32* %arrayidx5, align 4
325  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
326  store i32 %0, i32* %B.addr.01, align 4
327  %inc7 = add nsw i64 %j.02, 1
328  %exitcond = icmp ne i64 %inc7, 10
329  br i1 %exitcond, label %for.body4, label %for.end8
330
331for.end8:                                         ; preds = %for.body4
332  ret void
333}
334
335
336;;  for (long int i = 0; i < 5; i++)
337;;    A[-11*i + 45] = i;
338;;  for (long int j = 0; j <= 10; j++)
339;;    *B++ = A[-j];
340
341define void @rdiv7(i32* %A, i32* %B) nounwind uwtable ssp {
342entry:
343  br label %for.body
344
345; CHECK: da analyze - none!
346; CHECK: da analyze - none!
347; CHECK: da analyze - confused!
348; CHECK: da analyze - none!
349; CHECK: da analyze - confused!
350; CHECK: da analyze - none!
351
352for.body:                                         ; preds = %entry, %for.body
353  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
354  %conv = trunc i64 %i.03 to i32
355  %mul = mul nsw i64 %i.03, -11
356  %add = add nsw i64 %mul, 45
357  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
358  store i32 %conv, i32* %arrayidx, align 4
359  %inc = add nsw i64 %i.03, 1
360  %exitcond4 = icmp ne i64 %inc, 5
361  br i1 %exitcond4, label %for.body, label %for.body4.preheader
362
363for.body4.preheader:                              ; preds = %for.body
364  br label %for.body4
365
366for.body4:                                        ; preds = %for.body4.preheader, %for.body4
367  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
368  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
369  %sub = sub nsw i64 0, %j.02
370  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub
371  %0 = load i32, i32* %arrayidx5, align 4
372  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
373  store i32 %0, i32* %B.addr.01, align 4
374  %inc7 = add nsw i64 %j.02, 1
375  %exitcond = icmp ne i64 %inc7, 11
376  br i1 %exitcond, label %for.body4, label %for.end8
377
378for.end8:                                         ; preds = %for.body4
379  ret void
380}
381
382
383;;  for (long int i = 0; i <= 5; i++)
384;;    A[-11*i + 45] = i;
385;;  for (long int j = 0; j <= 10; j++)
386;;    *B++ = A[-j];
387
388define void @rdiv8(i32* %A, i32* %B) nounwind uwtable ssp {
389entry:
390  br label %for.body
391
392; CHECK: da analyze - none!
393; CHECK: da analyze - flow [|<]!
394; CHECK: da analyze - confused!
395; CHECK: da analyze - none!
396; CHECK: da analyze - confused!
397; CHECK: da analyze - none!
398
399for.body:                                         ; preds = %entry, %for.body
400  %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
401  %conv = trunc i64 %i.03 to i32
402  %mul = mul nsw i64 %i.03, -11
403  %add = add nsw i64 %mul, 45
404  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
405  store i32 %conv, i32* %arrayidx, align 4
406  %inc = add nsw i64 %i.03, 1
407  %exitcond4 = icmp ne i64 %inc, 6
408  br i1 %exitcond4, label %for.body, label %for.body4.preheader
409
410for.body4.preheader:                              ; preds = %for.body
411  br label %for.body4
412
413for.body4:                                        ; preds = %for.body4.preheader, %for.body4
414  %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ]
415  %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ]
416  %sub = sub nsw i64 0, %j.02
417  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub
418  %0 = load i32, i32* %arrayidx5, align 4
419  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
420  store i32 %0, i32* %B.addr.01, align 4
421  %inc7 = add nsw i64 %j.02, 1
422  %exitcond = icmp ne i64 %inc7, 11
423  br i1 %exitcond, label %for.body4, label %for.end8
424
425for.end8:                                         ; preds = %for.body4
426  ret void
427}
428
429
430;;  for (long int i = 0; i < 5; i++)
431;;    for (long int j = 0; j < 10; j++) {
432;;      A[11*i - j] = i;
433;;      *B++ = A[45];
434
435define void @rdiv9(i32* %A, i32* %B) nounwind uwtable ssp {
436entry:
437  br label %for.cond1.preheader
438
439; CHECK: da analyze - none!
440; CHECK: da analyze - none!
441; CHECK: da analyze - confused!
442; CHECK: da analyze - consistent input [S S]!
443; CHECK: da analyze - confused!
444; CHECK: da analyze - none!
445
446for.cond1.preheader:                              ; preds = %entry, %for.inc5
447  %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ]
448  %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ]
449  br label %for.body3
450
451for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
452  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
453  %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
454  %conv = trunc i64 %i.03 to i32
455  %mul = mul nsw i64 %i.03, 11
456  %sub = sub nsw i64 %mul, %j.02
457  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
458  store i32 %conv, i32* %arrayidx, align 4
459  %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45
460  %0 = load i32, i32* %arrayidx4, align 4
461  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1
462  store i32 %0, i32* %B.addr.11, align 4
463  %inc = add nsw i64 %j.02, 1
464  %exitcond = icmp ne i64 %inc, 10
465  br i1 %exitcond, label %for.body3, label %for.inc5
466
467for.inc5:                                         ; preds = %for.body3
468  %scevgep = getelementptr i32, i32* %B.addr.04, i64 10
469  %inc6 = add nsw i64 %i.03, 1
470  %exitcond5 = icmp ne i64 %inc6, 5
471  br i1 %exitcond5, label %for.cond1.preheader, label %for.end7
472
473for.end7:                                         ; preds = %for.inc5
474  ret void
475}
476
477
478
479;;  for (long int i = 0; i <= 5; i++)
480;;    for (long int j = 0; j < 10; j++) {
481;;      A[11*i - j] = i;
482;;      *B++ = A[45];
483
484define void @rdiv10(i32* %A, i32* %B) nounwind uwtable ssp {
485entry:
486  br label %for.cond1.preheader
487
488; CHECK: da analyze - none!
489; CHECK: da analyze - none!
490; CHECK: da analyze - confused!
491; CHECK: da analyze - consistent input [S S]!
492; CHECK: da analyze - confused!
493; CHECK: da analyze - none!
494
495for.cond1.preheader:                              ; preds = %entry, %for.inc5
496  %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ]
497  %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ]
498  br label %for.body3
499
500for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
501  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
502  %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
503  %conv = trunc i64 %i.03 to i32
504  %mul = mul nsw i64 %i.03, 11
505  %sub = sub nsw i64 %mul, %j.02
506  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
507  store i32 %conv, i32* %arrayidx, align 4
508  %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45
509  %0 = load i32, i32* %arrayidx4, align 4
510  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1
511  store i32 %0, i32* %B.addr.11, align 4
512  %inc = add nsw i64 %j.02, 1
513  %exitcond = icmp ne i64 %inc, 10
514  br i1 %exitcond, label %for.body3, label %for.inc5
515
516for.inc5:                                         ; preds = %for.body3
517  %scevgep = getelementptr i32, i32* %B.addr.04, i64 10
518  %inc6 = add nsw i64 %i.03, 1
519  %exitcond5 = icmp ne i64 %inc6, 6
520  br i1 %exitcond5, label %for.cond1.preheader, label %for.end7
521
522for.end7:                                         ; preds = %for.inc5
523  ret void
524}
525
526
527;;  for (long int i = 0; i < 5; i++)
528;;    for (long int j = 0; j <= 10; j++) {
529;;      A[11*i - j] = i;
530;;      *B++ = A[45];
531
532define void @rdiv11(i32* %A, i32* %B) nounwind uwtable ssp {
533entry:
534  br label %for.cond1.preheader
535
536; CHECK: da analyze - none!
537; CHECK: da analyze - none!
538; CHECK: da analyze - confused!
539; CHECK: da analyze - consistent input [S S]!
540; CHECK: da analyze - confused!
541; CHECK: da analyze - none!
542
543for.cond1.preheader:                              ; preds = %entry, %for.inc5
544  %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ]
545  %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ]
546  br label %for.body3
547
548for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
549  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
550  %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
551  %conv = trunc i64 %i.03 to i32
552  %mul = mul nsw i64 %i.03, 11
553  %sub = sub nsw i64 %mul, %j.02
554  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
555  store i32 %conv, i32* %arrayidx, align 4
556  %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45
557  %0 = load i32, i32* %arrayidx4, align 4
558  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1
559  store i32 %0, i32* %B.addr.11, align 4
560  %inc = add nsw i64 %j.02, 1
561  %exitcond = icmp ne i64 %inc, 11
562  br i1 %exitcond, label %for.body3, label %for.inc5
563
564for.inc5:                                         ; preds = %for.body3
565  %scevgep = getelementptr i32, i32* %B.addr.04, i64 11
566  %inc6 = add nsw i64 %i.03, 1
567  %exitcond5 = icmp ne i64 %inc6, 5
568  br i1 %exitcond5, label %for.cond1.preheader, label %for.end7
569
570for.end7:                                         ; preds = %for.inc5
571  ret void
572}
573
574
575;;  for (long int i = 0; i <= 5; i++)
576;;    for (long int j = 0; j <= 10; j++) {
577;;      A[11*i - j] = i;
578;;      *B++ = A[45];
579
580define void @rdiv12(i32* %A, i32* %B) nounwind uwtable ssp {
581entry:
582  br label %for.cond1.preheader
583
584; CHECK: da analyze - none!
585; CHECK: da analyze - flow [* *|<]!
586; CHECK: da analyze - confused!
587; CHECK: da analyze - consistent input [S S]!
588; CHECK: da analyze - confused!
589; CHECK: da analyze - none!
590
591for.cond1.preheader:                              ; preds = %entry, %for.inc5
592  %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ]
593  %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ]
594  br label %for.body3
595
596for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
597  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
598  %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
599  %conv = trunc i64 %i.03 to i32
600  %mul = mul nsw i64 %i.03, 11
601  %sub = sub nsw i64 %mul, %j.02
602  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
603  store i32 %conv, i32* %arrayidx, align 4
604  %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45
605  %0 = load i32, i32* %arrayidx4, align 4
606  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1
607  store i32 %0, i32* %B.addr.11, align 4
608  %inc = add nsw i64 %j.02, 1
609  %exitcond = icmp ne i64 %inc, 11
610  br i1 %exitcond, label %for.body3, label %for.inc5
611
612for.inc5:                                         ; preds = %for.body3
613  %scevgep = getelementptr i32, i32* %B.addr.04, i64 11
614  %inc6 = add nsw i64 %i.03, 1
615  %exitcond5 = icmp ne i64 %inc6, 6
616  br i1 %exitcond5, label %for.cond1.preheader, label %for.end7
617
618for.end7:                                         ; preds = %for.inc5
619  ret void
620}
621