1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
4 ; ModuleID = 'WeakZeroDstSIV.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 - none!
19 ; CHECK: da analyze - output [p<=|<]!
20 ; CHECK: da analyze - consistent output [S]!
22 for.body: ; preds = %entry, %for.body
23 %i.07 = phi i32 [ %add, %for.body ], [ 0, %entry ]
24 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.07
25 store i32 0, ptr %arrayidx, align 4
26 store i32 1, ptr %A, 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
38 ;; for (long unsigned i = 0; i < 30; i++) {
42 define void @weakzerodst0(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
46 ; CHECK: da analyze - none!
47 ; CHECK: da analyze - flow [p<=|<]!
48 ; CHECK: da analyze - confused!
49 ; CHECK: da analyze - consistent input [S]!
50 ; CHECK: da analyze - confused!
51 ; CHECK: da analyze - none!
53 for.body: ; preds = %entry, %for.body
54 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
55 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
56 %conv = trunc i64 %i.02 to i32
57 %mul = shl i64 %i.02, 1
58 %add = add i64 %mul, 10
59 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
60 store i32 %conv, ptr %arrayidx, align 4
61 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 10
62 %0 = load i32, ptr %arrayidx1, align 4
63 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
64 store i32 %0, ptr %B.addr.01, align 4
65 %inc = add i64 %i.02, 1
66 %exitcond = icmp ne i64 %inc, 30
67 br i1 %exitcond, label %for.body, label %for.end
69 for.end: ; preds = %for.body
74 ;; for (long unsigned i = 0; i < n; i++) {
78 define void @weakzerodst1(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
80 %cmp1 = icmp eq i64 %n, 0
81 br i1 %cmp1, label %for.end, label %for.body.preheader
83 ; CHECK: da analyze - none!
84 ; CHECK: da analyze - flow [p<=|<]!
85 ; CHECK: da analyze - confused!
86 ; CHECK: da analyze - consistent input [S]!
87 ; CHECK: da analyze - confused!
88 ; CHECK: da analyze - none!
90 for.body.preheader: ; preds = %entry
93 for.body: ; preds = %for.body.preheader, %for.body
94 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
95 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
96 %conv = trunc i64 %i.03 to i32
97 %mul = mul i64 %i.03, %n
98 %add = add i64 %mul, 10
99 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
100 store i32 %conv, ptr %arrayidx, align 4
101 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 10
102 %0 = load i32, ptr %arrayidx1, align 4
103 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
104 store i32 %0, ptr %B.addr.02, align 4
105 %inc = add i64 %i.03, 1
106 %exitcond = icmp ne i64 %inc, %n
107 br i1 %exitcond, label %for.body, label %for.end.loopexit
109 for.end.loopexit: ; preds = %for.body
112 for.end: ; preds = %for.end.loopexit, %entry
117 ;; for (long unsigned i = 0; i < 5; i++) {
121 define void @weakzerodst2(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
125 ; CHECK: da analyze - none!
126 ; CHECK: da analyze - none!
127 ; CHECK: da analyze - confused!
128 ; CHECK: da analyze - consistent input [S]!
129 ; CHECK: da analyze - confused!
130 ; CHECK: da analyze - none!
132 for.body: ; preds = %entry, %for.body
133 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
134 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
135 %conv = trunc i64 %i.02 to i32
136 %mul = shl i64 %i.02, 1
137 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %mul
138 store i32 %conv, ptr %arrayidx, align 4
139 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 10
140 %0 = load i32, ptr %arrayidx1, align 4
141 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
142 store i32 %0, ptr %B.addr.01, align 4
143 %inc = add i64 %i.02, 1
144 %exitcond = icmp ne i64 %inc, 5
145 br i1 %exitcond, label %for.body, label %for.end
147 for.end: ; preds = %for.body
152 ;; for (long unsigned i = 0; i < 6; i++) {
156 define void @weakzerodst3(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
160 ; CHECK: da analyze - none!
161 ; CHECK: da analyze - flow [=>p|<]!
162 ; CHECK: da analyze - confused!
163 ; CHECK: da analyze - consistent input [S]!
164 ; CHECK: da analyze - confused!
165 ; CHECK: da analyze - none!
167 for.body: ; preds = %entry, %for.body
168 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
169 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
170 %conv = trunc i64 %i.02 to i32
171 %mul = shl i64 %i.02, 1
172 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %mul
173 store i32 %conv, ptr %arrayidx, align 4
174 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 10
175 %0 = load i32, ptr %arrayidx1, align 4
176 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
177 store i32 %0, ptr %B.addr.01, align 4
178 %inc = add i64 %i.02, 1
179 %exitcond = icmp ne i64 %inc, 6
180 br i1 %exitcond, label %for.body, label %for.end
182 for.end: ; preds = %for.body
187 ;; for (long unsigned i = 0; i < 7; i++) {
191 define void @weakzerodst4(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
195 ; CHECK: da analyze - none!
196 ; CHECK: da analyze - flow [*|<]!
197 ; CHECK: da analyze - confused!
198 ; CHECK: da analyze - consistent input [S]!
199 ; CHECK: da analyze - confused!
200 ; CHECK: da analyze - none!
202 for.body: ; preds = %entry, %for.body
203 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
204 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
205 %conv = trunc i64 %i.02 to i32
206 %mul = shl i64 %i.02, 1
207 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %mul
208 store i32 %conv, ptr %arrayidx, align 4
209 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 10
210 %0 = load i32, ptr %arrayidx1, align 4
211 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
212 store i32 %0, ptr %B.addr.01, align 4
213 %inc = add i64 %i.02, 1
214 %exitcond = icmp ne i64 %inc, 7
215 br i1 %exitcond, label %for.body, label %for.end
217 for.end: ; preds = %for.body
222 ;; for (long unsigned i = 0; i < 7; i++) {
226 define void @weakzerodst5(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
230 ; CHECK: da analyze - none!
231 ; CHECK: da analyze - none!
232 ; CHECK: da analyze - confused!
233 ; CHECK: da analyze - consistent input [S]!
234 ; CHECK: da analyze - confused!
235 ; CHECK: da analyze - none!
237 for.body: ; preds = %entry, %for.body
238 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
239 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
240 %conv = trunc i64 %i.02 to i32
241 %mul = shl i64 %i.02, 1
242 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %mul
243 store i32 %conv, ptr %arrayidx, align 4
244 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 -10
245 %0 = load i32, ptr %arrayidx1, align 4
246 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
247 store i32 %0, ptr %B.addr.01, align 4
248 %inc = add i64 %i.02, 1
249 %exitcond = icmp ne i64 %inc, 7
250 br i1 %exitcond, label %for.body, label %for.end
252 for.end: ; preds = %for.body
257 ;; for (long unsigned i = 0; i < n; i++) {
261 define void @weakzerodst6(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
263 %cmp1 = icmp eq i64 %n, 0
264 br i1 %cmp1, label %for.end, label %for.body.preheader
266 ; CHECK: da analyze - none!
267 ; CHECK: da analyze - none!
268 ; CHECK: da analyze - confused!
269 ; CHECK: da analyze - consistent input [S]!
270 ; CHECK: da analyze - confused!
271 ; CHECK: da analyze - none!
273 for.body.preheader: ; preds = %entry
276 for.body: ; preds = %for.body.preheader, %for.body
277 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
278 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
279 %conv = trunc i64 %i.03 to i32
280 %mul = mul i64 %i.03, 3
281 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %mul
282 store i32 %conv, ptr %arrayidx, align 4
283 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 10
284 %0 = load i32, ptr %arrayidx1, align 4
285 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
286 store i32 %0, ptr %B.addr.02, align 4
287 %inc = add i64 %i.03, 1
288 %exitcond = icmp ne i64 %inc, %n
289 br i1 %exitcond, label %for.body, label %for.end.loopexit
291 for.end.loopexit: ; preds = %for.body
294 for.end: ; preds = %for.end.loopexit, %entry