1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
4 ; ModuleID = 'WeakZeroSrcSIV.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 (int i = 0; i < N; i++) {
13 define void @dstzero(ptr nocapture %A, i32 %N) {
15 %cmp6 = icmp sgt i32 %N, 0
16 br i1 %cmp6, label %for.body, label %for.cond.cleanup
18 ; CHECK: da analyze - consistent output [S]!
19 ; CHECK: da analyze - output [p=>|<]!
20 ; CHECK: da analyze - none!
22 for.body: ; preds = %entry, %for.body
23 %i.07 = phi i32 [ %add, %for.body ], [ 0, %entry ]
24 store i32 0, ptr %A, align 4
25 %arrayidx1 = getelementptr inbounds i32, ptr %A, i32 %i.07
26 store i32 1, ptr %arrayidx1, align 4
27 %add = add nuw nsw i32 %i.07, 1
28 %exitcond = icmp eq i32 %add, %N
29 br i1 %exitcond, label %for.cond.cleanup, label %for.body
31 for.cond.cleanup: ; preds = %for.body, %entry
36 ;; for (long unsigned i = 0; i < 30; i++) {
38 ;; *B++ = A[2*i + 10];
40 define void @weakzerosrc0(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
44 ; CHECK: da analyze - consistent output [S]!
45 ; CHECK: da analyze - flow [p=>|<]!
46 ; CHECK: da analyze - confused!
47 ; CHECK: da analyze - none!
48 ; CHECK: da analyze - confused!
49 ; CHECK: da analyze - none!
51 for.body: ; preds = %entry, %for.body
52 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
53 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
54 %conv = trunc i64 %i.02 to i32
55 %arrayidx = getelementptr inbounds i32, ptr %A, i64 10
56 store i32 %conv, ptr %arrayidx, align 4
57 %mul = shl i64 %i.02, 1
58 %add = add i64 %mul, 10
59 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %add
60 %0 = load i32, ptr %arrayidx1, align 4
61 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
62 store i32 %0, ptr %B.addr.01, align 4
63 %inc = add i64 %i.02, 1
64 %exitcond = icmp ne i64 %inc, 30
65 br i1 %exitcond, label %for.body, label %for.end
67 for.end: ; preds = %for.body
72 ;; for (long unsigned i = 0; i < n; i++) {
74 ;; *B++ = A[n*i + 10];
76 define void @weakzerosrc1(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
78 %cmp1 = icmp eq i64 %n, 0
79 br i1 %cmp1, label %for.end, label %for.body.preheader
81 ; CHECK: da analyze - consistent output [S]!
82 ; CHECK: da analyze - flow [p=>|<]!
83 ; CHECK: da analyze - confused!
84 ; CHECK: da analyze - none!
85 ; CHECK: da analyze - confused!
86 ; CHECK: da analyze - none!
88 for.body.preheader: ; preds = %entry
91 for.body: ; preds = %for.body.preheader, %for.body
92 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
93 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
94 %conv = trunc i64 %i.03 to i32
95 %arrayidx = getelementptr inbounds i32, ptr %A, i64 10
96 store i32 %conv, ptr %arrayidx, align 4
97 %mul = mul i64 %i.03, %n
98 %add = add i64 %mul, 10
99 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %add
100 %0 = load i32, ptr %arrayidx1, align 4
101 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
102 store i32 %0, ptr %B.addr.02, align 4
103 %inc = add i64 %i.03, 1
104 %exitcond = icmp ne i64 %inc, %n
105 br i1 %exitcond, label %for.body, label %for.end.loopexit
107 for.end.loopexit: ; preds = %for.body
110 for.end: ; preds = %for.end.loopexit, %entry
115 ;; for (long unsigned i = 0; i < 5; i++) {
119 define void @weakzerosrc2(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
123 ; CHECK: da analyze - consistent output [S]!
124 ; CHECK: da analyze - none!
125 ; CHECK: da analyze - confused!
126 ; CHECK: da analyze - none!
127 ; CHECK: da analyze - confused!
128 ; CHECK: da analyze - none!
130 for.body: ; preds = %entry, %for.body
131 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
132 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
133 %conv = trunc i64 %i.02 to i32
134 %arrayidx = getelementptr inbounds i32, ptr %A, i64 10
135 store i32 %conv, ptr %arrayidx, align 4
136 %mul = shl i64 %i.02, 1
137 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %mul
138 %0 = load i32, ptr %arrayidx1, align 4
139 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
140 store i32 %0, ptr %B.addr.01, align 4
141 %inc = add i64 %i.02, 1
142 %exitcond = icmp ne i64 %inc, 5
143 br i1 %exitcond, label %for.body, label %for.end
145 for.end: ; preds = %for.body
150 ;; for (long unsigned i = 0; i < 6; i++) {
154 define void @weakzerosrc3(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
158 ; CHECK: da analyze - consistent output [S]!
159 ; CHECK: da analyze - flow [<=p|<]!
160 ; CHECK: da analyze - confused!
161 ; CHECK: da analyze - none!
162 ; CHECK: da analyze - confused!
163 ; CHECK: da analyze - none!
165 for.body: ; preds = %entry, %for.body
166 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
167 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
168 %conv = trunc i64 %i.02 to i32
169 %arrayidx = getelementptr inbounds i32, ptr %A, i64 10
170 store i32 %conv, ptr %arrayidx, align 4
171 %mul = shl i64 %i.02, 1
172 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %mul
173 %0 = load i32, ptr %arrayidx1, align 4
174 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
175 store i32 %0, ptr %B.addr.01, align 4
176 %inc = add i64 %i.02, 1
177 %exitcond = icmp ne i64 %inc, 6
178 br i1 %exitcond, label %for.body, label %for.end
180 for.end: ; preds = %for.body
185 ;; for (long unsigned i = 0; i < 7; i++) {
189 define void @weakzerosrc4(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
193 ; CHECK: da analyze - consistent output [S]!
194 ; CHECK: da analyze - flow [*|<]!
195 ; CHECK: da analyze - confused!
196 ; CHECK: da analyze - none!
197 ; CHECK: da analyze - confused!
198 ; CHECK: da analyze - none!
200 for.body: ; preds = %entry, %for.body
201 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
202 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
203 %conv = trunc i64 %i.02 to i32
204 %arrayidx = getelementptr inbounds i32, ptr %A, i64 10
205 store i32 %conv, ptr %arrayidx, align 4
206 %mul = shl i64 %i.02, 1
207 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %mul
208 %0 = load i32, ptr %arrayidx1, align 4
209 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
210 store i32 %0, ptr %B.addr.01, align 4
211 %inc = add i64 %i.02, 1
212 %exitcond = icmp ne i64 %inc, 7
213 br i1 %exitcond, label %for.body, label %for.end
215 for.end: ; preds = %for.body
220 ;; for (long unsigned i = 0; i < 7; i++) {
224 define void @weakzerosrc5(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
228 ; CHECK: da analyze - consistent output [S]!
229 ; CHECK: da analyze - none!
230 ; CHECK: da analyze - confused!
231 ; CHECK: da analyze - none!
232 ; CHECK: da analyze - confused!
233 ; CHECK: da analyze - none!
235 for.body: ; preds = %entry, %for.body
236 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
237 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
238 %conv = trunc i64 %i.02 to i32
239 %arrayidx = getelementptr inbounds i32, ptr %A, i64 -10
240 store i32 %conv, ptr %arrayidx, align 4
241 %mul = shl i64 %i.02, 1
242 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %mul
243 %0 = load i32, ptr %arrayidx1, align 4
244 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
245 store i32 %0, ptr %B.addr.01, align 4
246 %inc = add i64 %i.02, 1
247 %exitcond = icmp ne i64 %inc, 7
248 br i1 %exitcond, label %for.body, label %for.end
250 for.end: ; preds = %for.body
255 ;; for (long unsigned i = 0; i < n; i++) {
259 define void @weakzerosrc6(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
261 %cmp1 = icmp eq i64 %n, 0
262 br i1 %cmp1, label %for.end, label %for.body.preheader
264 ; CHECK: da analyze - consistent output [S]!
265 ; CHECK: da analyze - none!
266 ; CHECK: da analyze - confused!
267 ; CHECK: da analyze - none!
268 ; CHECK: da analyze - confused!
269 ; CHECK: da analyze - none!
271 for.body.preheader: ; preds = %entry
274 for.body: ; preds = %for.body.preheader, %for.body
275 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
276 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
277 %conv = trunc i64 %i.03 to i32
278 %arrayidx = getelementptr inbounds i32, ptr %A, i64 10
279 store i32 %conv, ptr %arrayidx, align 4
280 %mul = mul i64 %i.03, 3
281 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %mul
282 %0 = load i32, ptr %arrayidx1, align 4
283 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
284 store i32 %0, ptr %B.addr.02, align 4
285 %inc = add i64 %i.03, 1
286 %exitcond = icmp ne i64 %inc, %n
287 br i1 %exitcond, label %for.body, label %for.end.loopexit
289 for.end.loopexit: ; preds = %for.body
292 for.end: ; preds = %for.end.loopexit, %entry