llvm-project
544 строки · 20.3 Кб
1; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
2; RUN: | FileCheck %s
3
4target 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"
5target triple = "x86_64-apple-macosx10.6.0"
6
7
8;; for (long int i = 0; i < 100; i++)
9;; for (long int j = 0; j < 100; j++) {
10;; A[i + 1][i + j] = i;
11;; *B++ = A[i][i + j];
12
13define void @prop0(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
14entry:
15br label %for.cond1.preheader
16
17; CHECK-LABEL: prop0
18; CHECK: da analyze - none!
19; CHECK: da analyze - flow [< >]!
20; CHECK: da analyze - confused!
21; CHECK: da analyze - none!
22; CHECK: da analyze - confused!
23; CHECK: da analyze - none!
24
25for.cond1.preheader: ; preds = %entry, %for.inc9
26%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc9 ]
27%i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ]
28br label %for.body3
29
30for.body3: ; preds = %for.cond1.preheader, %for.body3
31%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
32%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
33%conv = trunc i64 %i.03 to i32
34%add = add nsw i64 %i.03, %j.02
35%add4 = add nsw i64 %i.03, 1
36%arrayidx5 = getelementptr inbounds [100 x i32], ptr %A, i64 %add4, i64 %add
37store i32 %conv, ptr %arrayidx5, align 4
38%add6 = add nsw i64 %i.03, %j.02
39%arrayidx8 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add6
40%0 = load i32, ptr %arrayidx8, align 4
41%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
42store i32 %0, ptr %B.addr.11, align 4
43%inc = add nsw i64 %j.02, 1
44%exitcond = icmp ne i64 %inc, 100
45br i1 %exitcond, label %for.body3, label %for.inc9
46
47for.inc9: ; preds = %for.body3
48%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
49%inc10 = add nsw i64 %i.03, 1
50%exitcond5 = icmp ne i64 %inc10, 100
51br i1 %exitcond5, label %for.cond1.preheader, label %for.end11
52
53for.end11: ; preds = %for.inc9
54ret void
55}
56
57
58;; for (long int i = 0; i < 100; i++)
59;; for (long int j = 0; j < 100; j++)
60;; for (long int k = 0; k < 100; k++) {
61;; A[j - i][i + 1][j + k] = i;
62;; *B++ = A[j - i][i][j + k];
63
64define void @prop1(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
65entry:
66br label %for.cond1.preheader
67
68; CHECK-LABEL: prop1
69; CHECK: da analyze - output [* * *]!
70; CHECK: da analyze - flow [<> <> *]!
71; CHECK: da analyze - confused!
72; CHECK: da analyze - input [* * *]!
73; CHECK: da analyze - confused!
74; CHECK: da analyze - none!
75
76for.cond1.preheader: ; preds = %entry, %for.inc18
77%B.addr.06 = phi ptr [ %B, %entry ], [ %scevgep7, %for.inc18 ]
78%i.05 = phi i64 [ 0, %entry ], [ %inc19, %for.inc18 ]
79br label %for.cond4.preheader
80
81for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc15
82%B.addr.14 = phi ptr [ %B.addr.06, %for.cond1.preheader ], [ %scevgep, %for.inc15 ]
83%j.03 = phi i64 [ 0, %for.cond1.preheader ], [ %inc16, %for.inc15 ]
84br label %for.body6
85
86for.body6: ; preds = %for.cond4.preheader, %for.body6
87%k.02 = phi i64 [ 0, %for.cond4.preheader ], [ %inc, %for.body6 ]
88%B.addr.21 = phi ptr [ %B.addr.14, %for.cond4.preheader ], [ %incdec.ptr, %for.body6 ]
89%conv = trunc i64 %i.05 to i32
90%add = add nsw i64 %j.03, %k.02
91%add7 = add nsw i64 %i.05, 1
92%sub = sub nsw i64 %j.03, %i.05
93%arrayidx9 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %sub, i64 %add7, i64 %add
94store i32 %conv, ptr %arrayidx9, align 4
95%add10 = add nsw i64 %j.03, %k.02
96%sub11 = sub nsw i64 %j.03, %i.05
97%arrayidx14 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %sub11, i64 %i.05, i64 %add10
98%0 = load i32, ptr %arrayidx14, align 4
99%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.21, i64 1
100store i32 %0, ptr %B.addr.21, align 4
101%inc = add nsw i64 %k.02, 1
102%exitcond = icmp ne i64 %inc, 100
103br i1 %exitcond, label %for.body6, label %for.inc15
104
105for.inc15: ; preds = %for.body6
106%scevgep = getelementptr i32, ptr %B.addr.14, i64 100
107%inc16 = add nsw i64 %j.03, 1
108%exitcond8 = icmp ne i64 %inc16, 100
109br i1 %exitcond8, label %for.cond4.preheader, label %for.inc18
110
111for.inc18: ; preds = %for.inc15
112%scevgep7 = getelementptr i32, ptr %B.addr.06, i64 10000
113%inc19 = add nsw i64 %i.05, 1
114%exitcond9 = icmp ne i64 %inc19, 100
115br i1 %exitcond9, label %for.cond1.preheader, label %for.end20
116
117for.end20: ; preds = %for.inc18
118ret void
119}
120
121
122;; for (long int i = 0; i < 100; i++)
123;; for (long int j = 0; j ptr]!
124;; for (long int j = 0; j < 100; j++) {
125;; A[i - 1][2*i] = i;
126;; *B++ = A[i][i + j + 110];
127
128define void @prop2(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
129entry:
130br label %for.cond1.preheader
131
132; CHECK-LABEL: prop2
133; CHECK: da analyze - consistent output [0 S]!
134; CHECK: da analyze - flow [> *]!
135; CHECK: da analyze - confused!
136; CHECK: da analyze - none!
137; CHECK: da analyze - confused!
138; CHECK: da analyze - none!
139
140for.cond1.preheader: ; preds = %entry, %for.inc8
141%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc8 ]
142%i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ]
143br label %for.body3
144
145for.body3: ; preds = %for.cond1.preheader, %for.body3
146%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
147%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
148%conv = trunc i64 %i.03 to i32
149%mul = shl nsw i64 %i.03, 1
150%sub = add nsw i64 %i.03, -1
151%arrayidx4 = getelementptr inbounds [100 x i32], ptr %A, i64 %sub, i64 %mul
152store i32 %conv, ptr %arrayidx4, align 4
153%add = add nsw i64 %i.03, %j.02
154%add5 = add nsw i64 %add, 110
155%arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add5
156%0 = load i32, ptr %arrayidx7, align 4
157%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
158store i32 %0, ptr %B.addr.11, align 4
159%inc = add nsw i64 %j.02, 1
160%exitcond = icmp ne i64 %inc, 100
161br i1 %exitcond, label %for.body3, label %for.inc8
162
163for.inc8: ; preds = %for.body3
164%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
165%inc9 = add nsw i64 %i.03, 1
166%exitcond5 = icmp ne i64 %inc9, 100
167br i1 %exitcond5, label %for.cond1.preheader, label %for.end10
168
169for.end10: ; preds = %for.inc8
170ret void
171}
172
173
174;; for (long int i = 0; i < 100; i++)
175;; for (long int j = 0; j < 100; j++) {
176;; A[i][2*j + i] = i;
177;; *B++ = A[i][2*j - i + 5];
178
179define void @prop3(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
180entry:
181br label %for.cond1.preheader
182
183; CHECK-LABEL: prop3
184; CHECK: da analyze - output [* *]!
185; CHECK: da analyze - flow [<> *]!
186; CHECK: da analyze - confused!
187; CHECK: da analyze - input [* *]!
188; CHECK: da analyze - confused!
189; CHECK: da analyze - none!
190
191for.cond1.preheader: ; preds = %entry, %for.inc9
192%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc9 ]
193%i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ]
194br label %for.body3
195
196for.body3: ; preds = %for.cond1.preheader, %for.body3
197%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
198%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
199%conv = trunc i64 %i.03 to i32
200%mul = shl nsw i64 %j.02, 1
201%add = add nsw i64 %mul, %i.03
202%arrayidx4 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add
203store i32 %conv, ptr %arrayidx4, align 4
204%mul5 = shl nsw i64 %j.02, 1
205%sub = sub nsw i64 %mul5, %i.03
206%add6 = add nsw i64 %sub, 5
207%arrayidx8 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add6
208%0 = load i32, ptr %arrayidx8, align 4
209%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
210store i32 %0, ptr %B.addr.11, align 4
211%inc = add nsw i64 %j.02, 1
212%exitcond = icmp ne i64 %inc, 100
213br i1 %exitcond, label %for.body3, label %for.inc9
214
215for.inc9: ; preds = %for.body3
216%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
217%inc10 = add nsw i64 %i.03, 1
218%exitcond5 = icmp ne i64 %inc10, 100
219br i1 %exitcond5, label %for.cond1.preheader, label %for.end11
220
221for.end11: ; preds = %for.inc9
222ret void
223}
224
225
226;; for (long int i = 0; i < 100; i++)
227;; for (long int j = 0; j < 100; j++) {
228;; A[i + 2][2*i + j + 1] = i;
229;; *B++ = A[i][2*i + j];
230
231define void @prop4(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
232entry:
233br label %for.cond1.preheader
234
235; CHECK-LABEL: prop4
236; CHECK: da analyze - none!
237; CHECK: da analyze - flow [< <>]!
238; CHECK: da analyze - confused!
239; CHECK: da analyze - none!
240; CHECK: da analyze - confused!
241; CHECK: da analyze - none!
242
243for.cond1.preheader: ; preds = %entry, %for.inc11
244%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc11 ]
245%i.03 = phi i64 [ 0, %entry ], [ %inc12, %for.inc11 ]
246br label %for.body3
247
248for.body3: ; preds = %for.cond1.preheader, %for.body3
249%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
250%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
251%conv = trunc i64 %i.03 to i32
252%mul = shl nsw i64 %i.03, 1
253%add = add nsw i64 %mul, %j.02
254%add4 = add nsw i64 %add, 1
255%add5 = add nsw i64 %i.03, 2
256%arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 %add5, i64 %add4
257store i32 %conv, ptr %arrayidx6, align 4
258%mul7 = shl nsw i64 %i.03, 1
259%add8 = add nsw i64 %mul7, %j.02
260%arrayidx10 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add8
261%0 = load i32, ptr %arrayidx10, align 4
262%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
263store i32 %0, ptr %B.addr.11, align 4
264%inc = add nsw i64 %j.02, 1
265%exitcond = icmp ne i64 %inc, 100
266br i1 %exitcond, label %for.body3, label %for.inc11
267
268for.inc11: ; preds = %for.body3
269%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
270%inc12 = add nsw i64 %i.03, 1
271%exitcond5 = icmp ne i64 %inc12, 100
272br i1 %exitcond5, label %for.cond1.preheader, label %for.end13
273
274for.end13: ; preds = %for.inc11
275ret void
276}
277
278
279;; for (long int i = 0; i < 100; i++)
280;; for (long int j = 0; j < 100; j++) {
281;; A[3*i - 18][22 - i][2*i + j] = i;
282;; *B++ = A[i][i][3*i + j];
283
284define void @prop5(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
285entry:
286br label %for.cond1.preheader
287
288; CHECK-LABEL: prop5
289; CHECK: da analyze - none!
290; CHECK: da analyze - flow [* *|<]!
291; CHECK: da analyze - confused!
292; CHECK: da analyze - none!
293; CHECK: da analyze - confused!
294; CHECK: da analyze - none!
295
296for.cond1.preheader: ; preds = %entry, %for.inc13
297%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc13 ]
298%i.03 = phi i64 [ 0, %entry ], [ %inc14, %for.inc13 ]
299br label %for.body3
300
301for.body3: ; preds = %for.cond1.preheader, %for.body3
302%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
303%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
304%conv = trunc i64 %i.03 to i32
305%mul = shl nsw i64 %i.03, 1
306%add = add nsw i64 %mul, %j.02
307%sub = sub nsw i64 22, %i.03
308%mul4 = mul nsw i64 %i.03, 3
309%sub5 = add nsw i64 %mul4, -18
310%arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %sub5, i64 %sub, i64 %add
311store i32 %conv, ptr %arrayidx7, align 4
312%mul8 = mul nsw i64 %i.03, 3
313%add9 = add nsw i64 %mul8, %j.02
314%arrayidx12 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %i.03, i64 %i.03, i64 %add9
315%0 = load i32, ptr %arrayidx12, align 4
316%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
317store i32 %0, ptr %B.addr.11, align 4
318%inc = add nsw i64 %j.02, 1
319%exitcond = icmp ne i64 %inc, 100
320br i1 %exitcond, label %for.body3, label %for.inc13
321
322for.inc13: ; preds = %for.body3
323%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
324%inc14 = add nsw i64 %i.03, 1
325%exitcond5 = icmp ne i64 %inc14, 100
326br i1 %exitcond5, label %for.cond1.preheader, label %for.end15
327
328for.end15: ; preds = %for.inc13
329ret void
330}
331
332
333;; for (long int i = 0; i < 100; i++)
334;; for (long int j = 0; j < 100; j++) {
335;; A[i + 1][4*i + j + 2] = i;
336;; *B++ = A[2*i][8*i + j];
337
338define void @prop6(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
339entry:
340br label %for.cond1.preheader
341
342; CHECK-LABEL: prop6
343; CHECK: da analyze - none!
344; CHECK: da analyze - flow [=> <>]!
345; CHECK: da analyze - confused!
346; CHECK: da analyze - none!
347; CHECK: da analyze - confused!
348; CHECK: da analyze - none!
349
350for.cond1.preheader: ; preds = %entry, %for.inc12
351%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc12 ]
352%i.03 = phi i64 [ 0, %entry ], [ %inc13, %for.inc12 ]
353br label %for.body3
354
355for.body3: ; preds = %for.cond1.preheader, %for.body3
356%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
357%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
358%conv = trunc i64 %i.03 to i32
359%mul = shl nsw i64 %i.03, 2
360%add = add nsw i64 %mul, %j.02
361%add4 = add nsw i64 %add, 2
362%add5 = add nsw i64 %i.03, 1
363%arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 %add5, i64 %add4
364store i32 %conv, ptr %arrayidx6, align 4
365%mul7 = shl nsw i64 %i.03, 3
366%add8 = add nsw i64 %mul7, %j.02
367%mul9 = shl nsw i64 %i.03, 1
368%arrayidx11 = getelementptr inbounds [100 x i32], ptr %A, i64 %mul9, i64 %add8
369%0 = load i32, ptr %arrayidx11, align 4
370%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
371store i32 %0, ptr %B.addr.11, align 4
372%inc = add nsw i64 %j.02, 1
373%exitcond = icmp ne i64 %inc, 100
374br i1 %exitcond, label %for.body3, label %for.inc12
375
376for.inc12: ; preds = %for.body3
377%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
378%inc13 = add nsw i64 %i.03, 1
379%exitcond5 = icmp ne i64 %inc13, 100
380br i1 %exitcond5, label %for.cond1.preheader, label %for.end14
381
382for.end14: ; preds = %for.inc12
383ret void
384}
385
386
387;; for (long int i = 0; i < 100; i++)
388;; for (long int j = 0; j < 100; j++) {
389;; A[2*i + 4][-5*i + j + 2] = i;
390;; *B++ = A[-2*i + 20][5*i + j];
391
392define void @prop7(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
393entry:
394br label %for.cond1.preheader
395
396; CHECK-LABEL: prop7
397; CHECK: da analyze - none!
398; CHECK: da analyze - flow [* <>]!
399; CHECK: da analyze - confused!
400; CHECK: da analyze - none!
401; CHECK: da analyze - confused!
402; CHECK: da analyze - none!
403
404for.cond1.preheader: ; preds = %entry, %for.inc14
405%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc14 ]
406%i.03 = phi i64 [ 0, %entry ], [ %inc15, %for.inc14 ]
407br label %for.body3
408
409for.body3: ; preds = %for.cond1.preheader, %for.body3
410%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
411%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
412%conv = trunc i64 %i.03 to i32
413%mul = mul nsw i64 %i.03, -5
414%add = add nsw i64 %mul, %j.02
415%add4 = add nsw i64 %add, 2
416%mul5 = shl nsw i64 %i.03, 1
417%add6 = add nsw i64 %mul5, 4
418%arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 %add6, i64 %add4
419store i32 %conv, ptr %arrayidx7, align 4
420%mul8 = mul nsw i64 %i.03, 5
421%add9 = add nsw i64 %mul8, %j.02
422%mul10 = mul nsw i64 %i.03, -2
423%add11 = add nsw i64 %mul10, 20
424%arrayidx13 = getelementptr inbounds [100 x i32], ptr %A, i64 %add11, i64 %add9
425%0 = load i32, ptr %arrayidx13, align 4
426%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
427store i32 %0, ptr %B.addr.11, align 4
428%inc = add nsw i64 %j.02, 1
429%exitcond = icmp ne i64 %inc, 100
430br i1 %exitcond, label %for.body3, label %for.inc14
431
432for.inc14: ; preds = %for.body3
433%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
434%inc15 = add nsw i64 %i.03, 1
435%exitcond5 = icmp ne i64 %inc15, 100
436br i1 %exitcond5, label %for.cond1.preheader, label %for.end16
437
438for.end16: ; preds = %for.inc14
439ret void
440}
441
442
443;; for (long int i = 0; i < 100; i++)
444;; for (long int j = 0; j < 100; j++) {
445;; A[4][j + 2] = i;
446;; *B++ = A[-2*i + 4][5*i + j];
447
448define void @prop8(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
449entry:
450br label %for.cond1.preheader
451
452; CHECK-LABEL: prop8
453; CHECK: da analyze - consistent output [S 0]!
454; CHECK: da analyze - flow [=> <]!
455; CHECK: da analyze - confused!
456; CHECK: da analyze - none!
457; CHECK: da analyze - confused!
458; CHECK: da analyze - none!
459
460for.cond1.preheader: ; preds = %entry, %for.inc10
461%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc10 ]
462%i.03 = phi i64 [ 0, %entry ], [ %inc11, %for.inc10 ]
463br label %for.body3
464
465for.body3: ; preds = %for.cond1.preheader, %for.body3
466%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
467%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
468%conv = trunc i64 %i.03 to i32
469%add = add nsw i64 %j.02, 2
470%arrayidx4 = getelementptr inbounds [100 x i32], ptr %A, i64 4, i64 %add
471store i32 %conv, ptr %arrayidx4, align 4
472%mul = mul nsw i64 %i.03, 5
473%add5 = add nsw i64 %mul, %j.02
474%mul6 = mul nsw i64 %i.03, -2
475%add7 = add nsw i64 %mul6, 4
476%arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 %add7, i64 %add5
477%0 = load i32, ptr %arrayidx9, align 4
478%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
479store i32 %0, ptr %B.addr.11, align 4
480%inc = add nsw i64 %j.02, 1
481%exitcond = icmp ne i64 %inc, 100
482br i1 %exitcond, label %for.body3, label %for.inc10
483
484for.inc10: ; preds = %for.body3
485%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
486%inc11 = add nsw i64 %i.03, 1
487%exitcond5 = icmp ne i64 %inc11, 100
488br i1 %exitcond5, label %for.cond1.preheader, label %for.end12
489
490for.end12: ; preds = %for.inc10
491ret void
492}
493
494
495;; for (long int i = 0; i < 100; i++)
496;; for (long int j = 0; j < 100; j++) {
497;; A[2*i + 4][5*i + j + 2] = i;
498;; *B++ = A[4][j];
499
500define void @prop9(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
501entry:
502br label %for.cond1.preheader
503
504; CHECK-LABEL: prop9
505; CHECK: da analyze - none!
506; CHECK: da analyze - flow [<= <]!
507; CHECK: da analyze - confused!
508; CHECK: da analyze - consistent input [S 0]!
509; CHECK: da analyze - confused!
510; CHECK: da analyze - none!
511
512for.cond1.preheader: ; preds = %entry, %for.inc10
513%B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc10 ]
514%i.03 = phi i64 [ 0, %entry ], [ %inc11, %for.inc10 ]
515br label %for.body3
516
517for.body3: ; preds = %for.cond1.preheader, %for.body3
518%j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
519%B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
520%conv = trunc i64 %i.03 to i32
521%mul = mul nsw i64 %i.03, 5
522%add = add nsw i64 %mul, %j.02
523%add4 = add nsw i64 %add, 2
524%mul5 = shl nsw i64 %i.03, 1
525%add6 = add nsw i64 %mul5, 4
526%arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 %add6, i64 %add4
527store i32 %conv, ptr %arrayidx7, align 4
528%arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 4, i64 %j.02
529%0 = load i32, ptr %arrayidx9, align 4
530%incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
531store i32 %0, ptr %B.addr.11, align 4
532%inc = add nsw i64 %j.02, 1
533%exitcond = icmp ne i64 %inc, 100
534br i1 %exitcond, label %for.body3, label %for.inc10
535
536for.inc10: ; preds = %for.body3
537%scevgep = getelementptr i32, ptr %B.addr.04, i64 100
538%inc11 = add nsw i64 %i.03, 1
539%exitcond5 = icmp ne i64 %inc11, 100
540br i1 %exitcond5, label %for.cond1.preheader, label %for.end12
541
542for.end12: ; preds = %for.inc10
543ret void
544}
545