1 ; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
4 ; ModuleID = 'WeakCrossingSIV.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 (long unsigned i = 0; i < n; i++) {
13 define void @weakcrossing0(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
15 %cmp1 = icmp eq i64 %n, 0
16 br i1 %cmp1, label %for.end, label %for.body.preheader
18 for.body.preheader: ; preds = %entry
21 ; CHECK: da analyze - none!
22 ; CHECK: da analyze - flow [0|<]!
23 ; CHECK: da analyze - confused!
24 ; CHECK: da analyze - none!
25 ; CHECK: da analyze - confused!
26 ; CHECK: da analyze - none!
28 for.body: ; preds = %for.body.preheader, %for.body
29 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
30 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
31 %conv = trunc i64 %i.03 to i32
32 %mul = mul i64 %i.03, %n
33 %add = add i64 %mul, 1
34 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
35 store i32 %conv, ptr %arrayidx, align 4
36 %mul1 = mul i64 %i.03, %n
37 %sub = sub i64 1, %mul1
38 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %sub
39 %0 = load i32, ptr %arrayidx2, align 4
40 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
41 store i32 %0, ptr %B.addr.02, align 4
42 %inc = add i64 %i.03, 1
43 %exitcond = icmp ne i64 %inc, %n
44 br i1 %exitcond, label %for.body, label %for.end.loopexit
46 for.end.loopexit: ; preds = %for.body
49 for.end: ; preds = %for.end.loopexit, %entry
54 ;; for (long unsigned i = 0; i < n; i++) {
56 ;; *B++ = A[1 + n - i];
58 define void @weakcrossing1(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
60 %cmp1 = icmp eq i64 %n, 0
61 br i1 %cmp1, label %for.end, label %for.body.preheader
63 ; CHECK: da analyze - none!
64 ; CHECK: da analyze - flow [<>] splitable!
65 ; CHECK: da analyze - split level = 1, iteration = 0!
66 ; CHECK: da analyze - confused!
67 ; CHECK: da analyze - none!
68 ; CHECK: da analyze - confused!
69 ; CHECK: da analyze - none!
71 for.body.preheader: ; preds = %entry
74 for.body: ; preds = %for.body.preheader, %for.body
75 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
76 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
77 %conv = trunc i64 %i.03 to i32
78 %add = add i64 %i.03, %n
79 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %add
80 store i32 %conv, ptr %arrayidx, align 4
82 %sub = sub i64 %add1, %i.03
83 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %sub
84 %0 = load i32, ptr %arrayidx2, align 4
85 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
86 store i32 %0, ptr %B.addr.02, align 4
87 %inc = add i64 %i.03, 1
88 %exitcond = icmp ne i64 %inc, %n
89 br i1 %exitcond, label %for.body, label %for.end.loopexit
91 for.end.loopexit: ; preds = %for.body
94 for.end: ; preds = %for.end.loopexit, %entry
99 ;; for (long unsigned i = 0; i < 3; i++) {
103 define void @weakcrossing2(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
107 ; CHECK: da analyze - none!
108 ; CHECK: da analyze - none!
109 ; CHECK: da analyze - confused!
110 ; CHECK: da analyze - none!
111 ; CHECK: da analyze - confused!
112 ; CHECK: da analyze - none!
114 for.body: ; preds = %entry, %for.body
115 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
116 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
117 %conv = trunc i64 %i.02 to i32
118 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i.02
119 store i32 %conv, ptr %arrayidx, align 4
120 %sub = sub i64 6, %i.02
121 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %sub
122 %0 = load i32, ptr %arrayidx1, align 4
123 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
124 store i32 %0, ptr %B.addr.01, align 4
125 %inc = add i64 %i.02, 1
126 %exitcond = icmp ne i64 %inc, 3
127 br i1 %exitcond, label %for.body, label %for.end
129 for.end: ; preds = %for.body
134 ;; for (long unsigned i = 0; i < 4; i++) {
138 define void @weakcrossing3(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
142 ; CHECK: da analyze - none!
143 ; CHECK: da analyze - flow [0|<]!
144 ; CHECK: da analyze - confused!
145 ; CHECK: da analyze - none!
146 ; CHECK: da analyze - confused!
147 ; CHECK: da analyze - none!
149 for.body: ; preds = %entry, %for.body
150 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
151 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
152 %conv = trunc i64 %i.02 to i32
153 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i.02
154 store i32 %conv, ptr %arrayidx, align 4
155 %sub = sub i64 6, %i.02
156 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %sub
157 %0 = load i32, ptr %arrayidx1, align 4
158 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
159 store i32 %0, ptr %B.addr.01, align 4
160 %inc = add i64 %i.02, 1
161 %exitcond = icmp ne i64 %inc, 4
162 br i1 %exitcond, label %for.body, label %for.end
164 for.end: ; preds = %for.body
169 ;; for (long unsigned i = 0; i < 10; i++) {
173 define void @weakcrossing4(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
177 ; CHECK: da analyze - none!
178 ; CHECK: da analyze - none!
179 ; CHECK: da analyze - confused!
180 ; CHECK: da analyze - none!
181 ; CHECK: da analyze - confused!
182 ; CHECK: da analyze - none!
184 for.body: ; preds = %entry, %for.body
185 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
186 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
187 %conv = trunc i64 %i.02 to i32
188 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i.02
189 store i32 %conv, ptr %arrayidx, align 4
190 %sub = sub i64 -6, %i.02
191 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %sub
192 %0 = load i32, ptr %arrayidx1, align 4
193 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
194 store i32 %0, ptr %B.addr.01, align 4
195 %inc = add i64 %i.02, 1
196 %exitcond = icmp ne i64 %inc, 10
197 br i1 %exitcond, label %for.body, label %for.end
199 for.end: ; preds = %for.body
204 ;; for (long unsigned i = 0; i < n; i++) {
206 ;; *B++ = A[5 - 3*i];
208 define void @weakcrossing5(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
210 %cmp1 = icmp eq i64 %n, 0
211 br i1 %cmp1, label %for.end, label %for.body.preheader
213 ; CHECK: da analyze - none!
214 ; CHECK: da analyze - none!
215 ; CHECK: da analyze - confused!
216 ; CHECK: da analyze - none!
217 ; CHECK: da analyze - confused!
218 ; CHECK: da analyze - none!
220 for.body.preheader: ; preds = %entry
223 for.body: ; preds = %for.body.preheader, %for.body
224 %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
225 %B.addr.02 = phi ptr [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
226 %conv = trunc i64 %i.03 to i32
227 %mul = mul i64 %i.03, 3
228 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %mul
229 store i32 %conv, ptr %arrayidx, align 4
230 %0 = mul i64 %i.03, -3
232 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %sub
233 %1 = load i32, ptr %arrayidx2, align 4
234 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.02, i64 1
235 store i32 %1, ptr %B.addr.02, align 4
236 %inc = add i64 %i.03, 1
237 %exitcond = icmp ne i64 %inc, %n
238 br i1 %exitcond, label %for.body, label %for.end.loopexit
240 for.end.loopexit: ; preds = %for.body
243 for.end: ; preds = %for.end.loopexit, %entry
248 ;; for (long unsigned i = 0; i < 4; i++) {
252 define void @weakcrossing6(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp {
256 ; CHECK: da analyze - none!
257 ; CHECK: da analyze - flow [<>] splitable!
258 ; CHECK: da analyze - split level = 1, iteration = 2!
259 ; CHECK: da analyze - confused!
260 ; CHECK: da analyze - none!
261 ; CHECK: da analyze - confused!
262 ; CHECK: da analyze - none!
264 for.body: ; preds = %entry, %for.body
265 %i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
266 %B.addr.01 = phi ptr [ %B, %entry ], [ %incdec.ptr, %for.body ]
267 %conv = trunc i64 %i.02 to i32
268 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i.02
269 store i32 %conv, ptr %arrayidx, align 4
270 %sub = sub i64 5, %i.02
271 %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %sub
272 %0 = load i32, ptr %arrayidx1, align 4
273 %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.01, i64 1
274 store i32 %0, ptr %B.addr.01, align 4
275 %inc = add i64 %i.02, 1
276 %exitcond = icmp ne i64 %inc, 4
277 br i1 %exitcond, label %for.body, label %for.end
279 for.end: ; preds = %for.body