blob: 711d0fabf87f844b7c4aeb3ceac3748a3016fa6a [file] [log] [blame]
Sebastian Pop59b61b92012-10-11 07:32:34 +00001; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
2
3; ModuleID = 'SymbolicSIV.bc'
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
Benjamin Kramer3eb15632012-11-13 12:12:02 +00008;; for (long int i = 0; i < n; i++) {
9;; A[2*i + n] = i;
10;; *B++ = A[3*i + 3*n];
Sebastian Pop59b61b92012-10-11 07:32:34 +000011
12define void @symbolicsiv0(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
13entry:
14 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +000015 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +000016
Preston Briggs5cb8cfa2012-11-27 19:12:26 +000017; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +000018; CHECK: da analyze - none!
19; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +000020; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +000021; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +000022; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +000023
24for.body.preheader: ; preds = %entry
25 br label %for.body
26
27for.body: ; preds = %for.body.preheader, %for.body
28 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
29 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +000030 %conv = trunc i64 %i.03 to i32
31 %mul = shl nsw i64 %i.03, 1
32 %add = add i64 %mul, %n
David Blaikie79e6c742015-02-27 19:29:02 +000033 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
Sebastian Pop59b61b92012-10-11 07:32:34 +000034 store i32 %conv, i32* %arrayidx, align 4
35 %mul14 = add i64 %i.03, %n
36 %add3 = mul i64 %mul14, 3
David Blaikie79e6c742015-02-27 19:29:02 +000037 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %add3
David Blaikiea79ac142015-02-27 21:17:42 +000038 %0 = load i32, i32* %arrayidx4, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000039 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +000040 store i32 %0, i32* %B.addr.02, align 4
41 %inc = add nsw i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +000042 %exitcond = icmp ne i64 %inc, %n
43 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +000044
Benjamin Kramer3eb15632012-11-13 12:12:02 +000045for.end.loopexit: ; preds = %for.body
46 br label %for.end
47
48for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +000049 ret void
50}
51
52
Benjamin Kramer3eb15632012-11-13 12:12:02 +000053;; for (long int i = 0; i < n; i++) {
54;; A[2*i + 5*n] = i;
55;; *B++ = A[3*i + 2*n];
Sebastian Pop59b61b92012-10-11 07:32:34 +000056
57define void @symbolicsiv1(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
58entry:
59 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +000060 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +000061
Preston Briggs5cb8cfa2012-11-27 19:12:26 +000062; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +000063; CHECK: da analyze - none!
64; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +000065; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +000066; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +000067; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +000068
69for.body.preheader: ; preds = %entry
70 br label %for.body
71
72for.body: ; preds = %for.body.preheader, %for.body
73 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
74 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +000075 %conv = trunc i64 %i.03 to i32
76 %mul = shl nsw i64 %i.03, 1
77 %mul1 = mul i64 %n, 5
78 %add = add i64 %mul, %mul1
David Blaikie79e6c742015-02-27 19:29:02 +000079 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
Sebastian Pop59b61b92012-10-11 07:32:34 +000080 store i32 %conv, i32* %arrayidx, align 4
81 %mul2 = mul nsw i64 %i.03, 3
82 %mul3 = shl i64 %n, 1
83 %add4 = add i64 %mul2, %mul3
David Blaikie79e6c742015-02-27 19:29:02 +000084 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %add4
David Blaikiea79ac142015-02-27 21:17:42 +000085 %0 = load i32, i32* %arrayidx5, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000086 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +000087 store i32 %0, i32* %B.addr.02, align 4
88 %inc = add nsw i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +000089 %exitcond = icmp ne i64 %inc, %n
90 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +000091
Benjamin Kramer3eb15632012-11-13 12:12:02 +000092for.end.loopexit: ; preds = %for.body
93 br label %for.end
94
95for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +000096 ret void
97}
98
99
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000100;; for (long int i = 0; i < n; i++) {
101;; A[2*i - n] = i;
102;; *B++ = A[-i + 2*n];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000103
104define void @symbolicsiv2(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
105entry:
106 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000107 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +0000108
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000109; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000110; CHECK: da analyze - none!
111; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000112; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000113; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000114; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000115
116for.body.preheader: ; preds = %entry
117 br label %for.body
118
119for.body: ; preds = %for.body.preheader, %for.body
120 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
121 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +0000122 %conv = trunc i64 %i.03 to i32
123 %mul = shl nsw i64 %i.03, 1
124 %sub = sub i64 %mul, %n
David Blaikie79e6c742015-02-27 19:29:02 +0000125 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
Sebastian Pop59b61b92012-10-11 07:32:34 +0000126 store i32 %conv, i32* %arrayidx, align 4
127 %mul2 = shl i64 %n, 1
128 %add = sub i64 %mul2, %i.03
David Blaikie79e6c742015-02-27 19:29:02 +0000129 %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %add
David Blaikiea79ac142015-02-27 21:17:42 +0000130 %0 = load i32, i32* %arrayidx3, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000131 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000132 store i32 %0, i32* %B.addr.02, align 4
133 %inc = add nsw i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000134 %exitcond = icmp ne i64 %inc, %n
135 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +0000136
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000137for.end.loopexit: ; preds = %for.body
138 br label %for.end
139
140for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +0000141 ret void
142}
143
144
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000145;; for (long int i = 0; i < n; i++) {
146;; A[-2*i + n + 1] = i;
147;; *B++ = A[i - 2*n];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000148
149define void @symbolicsiv3(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
150entry:
151 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000152 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +0000153
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000154; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000155; CHECK: da analyze - none!
156; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000157; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000158; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000159; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000160
161for.body.preheader: ; preds = %entry
162 br label %for.body
163
164for.body: ; preds = %for.body.preheader, %for.body
165 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
166 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +0000167 %conv = trunc i64 %i.03 to i32
168 %mul = mul nsw i64 %i.03, -2
169 %add = add i64 %mul, %n
170 %add1 = add i64 %add, 1
David Blaikie79e6c742015-02-27 19:29:02 +0000171 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000172 store i32 %conv, i32* %arrayidx, align 4
173 %mul2 = shl i64 %n, 1
174 %sub = sub i64 %i.03, %mul2
David Blaikie79e6c742015-02-27 19:29:02 +0000175 %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %sub
David Blaikiea79ac142015-02-27 21:17:42 +0000176 %0 = load i32, i32* %arrayidx3, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000177 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000178 store i32 %0, i32* %B.addr.02, align 4
179 %inc = add nsw i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000180 %exitcond = icmp ne i64 %inc, %n
181 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +0000182
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000183for.end.loopexit: ; preds = %for.body
184 br label %for.end
185
186for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +0000187 ret void
188}
189
190
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000191;; for (long int i = 0; i < n; i++) {
192;; A[-2*i + 3*n] = i;
193;; *B++ = A[-i + n];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000194
195define void @symbolicsiv4(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
196entry:
197 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000198 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +0000199
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000200; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000201; CHECK: da analyze - none!
202; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000203; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000204; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000205; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000206
207for.body.preheader: ; preds = %entry
208 br label %for.body
209
210for.body: ; preds = %for.body.preheader, %for.body
211 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
212 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +0000213 %conv = trunc i64 %i.03 to i32
214 %mul = mul nsw i64 %i.03, -2
215 %mul1 = mul i64 %n, 3
216 %add = add i64 %mul, %mul1
David Blaikie79e6c742015-02-27 19:29:02 +0000217 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
Sebastian Pop59b61b92012-10-11 07:32:34 +0000218 store i32 %conv, i32* %arrayidx, align 4
219 %add2 = sub i64 %n, %i.03
David Blaikie79e6c742015-02-27 19:29:02 +0000220 %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %add2
David Blaikiea79ac142015-02-27 21:17:42 +0000221 %0 = load i32, i32* %arrayidx3, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000222 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000223 store i32 %0, i32* %B.addr.02, align 4
224 %inc = add nsw i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000225 %exitcond = icmp ne i64 %inc, %n
226 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +0000227
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000228for.end.loopexit: ; preds = %for.body
229 br label %for.end
230
231for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +0000232 ret void
233}
234
235
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000236;; for (long int i = 0; i < n; i++) {
237;; A[-2*i - 2*n] = i;
238;; *B++ = A[-i - n];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000239
240define void @symbolicsiv5(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
241entry:
242 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000243 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +0000244
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000245; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000246; CHECK: da analyze - none!
247; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000248; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000249; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000250; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000251
252for.body.preheader: ; preds = %entry
253 br label %for.body
254
255for.body: ; preds = %for.body.preheader, %for.body
256 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
257 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +0000258 %conv = trunc i64 %i.03 to i32
259 %mul = mul nsw i64 %i.03, -2
260 %mul1 = shl i64 %n, 1
261 %sub = sub i64 %mul, %mul1
David Blaikie79e6c742015-02-27 19:29:02 +0000262 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub
Sebastian Pop59b61b92012-10-11 07:32:34 +0000263 store i32 %conv, i32* %arrayidx, align 4
264 %sub2 = sub nsw i64 0, %i.03
265 %sub3 = sub i64 %sub2, %n
David Blaikie79e6c742015-02-27 19:29:02 +0000266 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %sub3
David Blaikiea79ac142015-02-27 21:17:42 +0000267 %0 = load i32, i32* %arrayidx4, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000268 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000269 store i32 %0, i32* %B.addr.02, align 4
270 %inc = add nsw i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000271 %exitcond = icmp ne i64 %inc, %n
272 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +0000273
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000274for.end.loopexit: ; preds = %for.body
275 br label %for.end
276
277for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +0000278 ret void
279}
280
281
282;; why doesn't SCEV package understand that n >= 0?
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000283;; for (long unsigned i = 0; i < n; i++) {
284;; A[i + n + 1] = i;
285;; *B++ = A[-i];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000286
287define void @weaktest(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
288entry:
289 %cmp1 = icmp eq i64 %n, 0
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000290 br i1 %cmp1, label %for.end, label %for.body.preheader
Sebastian Pop59b61b92012-10-11 07:32:34 +0000291
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000292; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000293; CHECK: da analyze - flow [*|<] splitable!
294; CHECK: da analyze - split level = 1, iteration = ((0 smax (-1 + (-1 * %n))) /u 2)!
295; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000296; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000297; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000298; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000299
300for.body.preheader: ; preds = %entry
301 br label %for.body
302
303for.body: ; preds = %for.body.preheader, %for.body
304 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
305 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
Sebastian Pop59b61b92012-10-11 07:32:34 +0000306 %conv = trunc i64 %i.03 to i32
307 %add = add i64 %i.03, %n
308 %add1 = add i64 %add, 1
David Blaikie79e6c742015-02-27 19:29:02 +0000309 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000310 store i32 %conv, i32* %arrayidx, align 4
311 %sub = sub i64 0, %i.03
David Blaikie79e6c742015-02-27 19:29:02 +0000312 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %sub
David Blaikiea79ac142015-02-27 21:17:42 +0000313 %0 = load i32, i32* %arrayidx2, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000314 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000315 store i32 %0, i32* %B.addr.02, align 4
316 %inc = add i64 %i.03, 1
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000317 %exitcond = icmp ne i64 %inc, %n
318 br i1 %exitcond, label %for.body, label %for.end.loopexit
Sebastian Pop59b61b92012-10-11 07:32:34 +0000319
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000320for.end.loopexit: ; preds = %for.body
321 br label %for.end
322
323for.end: ; preds = %for.end.loopexit, %entry
Sebastian Pop59b61b92012-10-11 07:32:34 +0000324 ret void
325}
326
327
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000328;; for (long int i = 0; i < n; i++) {
329;; A[4*N*i + M] = i;
330;; *B++ = A[4*N*i + 3*M + 1];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000331
332define void @symbolicsiv6(i32* %A, i32* %B, i64 %n, i64 %N, i64 %M) nounwind uwtable ssp {
333entry:
334 %cmp1 = icmp eq i64 %n, 0
335 br i1 %cmp1, label %for.end, label %for.body.preheader
336
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000337; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000338; CHECK: da analyze - none!
339; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000340; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000341; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000342; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000343
Sebastian Pop59b61b92012-10-11 07:32:34 +0000344for.body.preheader: ; preds = %entry
345 br label %for.body
346
347for.body: ; preds = %for.body.preheader, %for.body
348 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
349 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
350 %conv = trunc i64 %i.03 to i32
351 %mul = shl i64 %N, 2
352 %mul1 = mul i64 %mul, %i.03
353 %add = add i64 %mul1, %M
David Blaikie79e6c742015-02-27 19:29:02 +0000354 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
Sebastian Pop59b61b92012-10-11 07:32:34 +0000355 store i32 %conv, i32* %arrayidx, align 4
356 %mul2 = shl i64 %N, 2
357 %mul3 = mul i64 %mul2, %i.03
358 %mul4 = mul i64 %M, 3
359 %add5 = add i64 %mul3, %mul4
360 %add6 = add i64 %add5, 1
David Blaikie79e6c742015-02-27 19:29:02 +0000361 %arrayidx7 = getelementptr inbounds i32, i32* %A, i64 %add6
David Blaikiea79ac142015-02-27 21:17:42 +0000362 %0 = load i32, i32* %arrayidx7, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000363 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000364 store i32 %0, i32* %B.addr.02, align 4
365 %inc = add nsw i64 %i.03, 1
366 %exitcond = icmp ne i64 %inc, %n
367 br i1 %exitcond, label %for.body, label %for.end.loopexit
368
369for.end.loopexit: ; preds = %for.body
370 br label %for.end
371
372for.end: ; preds = %for.end.loopexit, %entry
373 ret void
374}
375
376
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000377;; for (long int i = 0; i < n; i++) {
378;; A[2*N*i + M] = i;
379;; *B++ = A[2*N*i - 3*M + 2];
Sebastian Pop59b61b92012-10-11 07:32:34 +0000380
381define void @symbolicsiv7(i32* %A, i32* %B, i64 %n, i64 %N, i64 %M) nounwind uwtable ssp {
382entry:
383 %cmp1 = icmp eq i64 %n, 0
384 br i1 %cmp1, label %for.end, label %for.body.preheader
385
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000386; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000387; CHECK: da analyze - flow [<>]!
388; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000389; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000390; CHECK: da analyze - confused!
Preston Briggs5cb8cfa2012-11-27 19:12:26 +0000391; CHECK: da analyze - none!
Benjamin Kramer3eb15632012-11-13 12:12:02 +0000392
Sebastian Pop59b61b92012-10-11 07:32:34 +0000393for.body.preheader: ; preds = %entry
394 br label %for.body
395
396for.body: ; preds = %for.body.preheader, %for.body
397 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
398 %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
399 %conv = trunc i64 %i.03 to i32
400 %mul = shl i64 %N, 1
401 %mul1 = mul i64 %mul, %i.03
402 %add = add i64 %mul1, %M
David Blaikie79e6c742015-02-27 19:29:02 +0000403 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
Sebastian Pop59b61b92012-10-11 07:32:34 +0000404 store i32 %conv, i32* %arrayidx, align 4
405 %mul2 = shl i64 %N, 1
406 %mul3 = mul i64 %mul2, %i.03
407 %0 = mul i64 %M, -3
408 %sub = add i64 %mul3, %0
409 %add5 = add i64 %sub, 2
David Blaikie79e6c742015-02-27 19:29:02 +0000410 %arrayidx6 = getelementptr inbounds i32, i32* %A, i64 %add5
David Blaikiea79ac142015-02-27 21:17:42 +0000411 %1 = load i32, i32* %arrayidx6, align 4
David Blaikie79e6c742015-02-27 19:29:02 +0000412 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
Sebastian Pop59b61b92012-10-11 07:32:34 +0000413 store i32 %1, i32* %B.addr.02, align 4
414 %inc = add nsw i64 %i.03, 1
415 %exitcond = icmp ne i64 %inc, %n
416 br i1 %exitcond, label %for.body, label %for.end.loopexit
417
418for.end.loopexit: ; preds = %for.body
419 br label %for.end
420
421for.end: ; preds = %for.end.loopexit, %entry
422 ret void
423}