1 ; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-vector -dce -S %s | FileCheck %s
2 ; Obtained from C source as:
3 ; clang -S -emit-llvm -O0 no-section-anchors-vect-69.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-section-anchors-vect-69.s > no-section-anchors-vect-69.ll
6 ; ModuleID = 'no-section-anchors-vect-69.s'
7 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"
8 target triple = "x86_64-unknown-linux-gnu"
10 %struct.test1 = type { %struct.s, i32, i32, %struct.s }
11 %struct.s = type { i32, [12 x [12 x [12 x i32]]] }
12 %struct.test2 = type { %struct.s2, i32, i32, %struct.s2 }
13 %struct.s2 = type { i32, [11 x [11 x [11 x i32]]] }
15 @tmp1 = common global [4 x %struct.test1] zeroinitializer, align 16
16 @tmp2 = common global [4 x %struct.test2] zeroinitializer, align 16
18 define i32 @main1() nounwind uwtable noinline {
22 for.cond: ; preds = %for.inc, %entry
23 %indvar29 = phi i64 [ %indvar.next30, %for.inc ], [ 0, %entry ]
24 %arrayidx = getelementptr [4 x %struct.test1]* @tmp1, i64 0, i64 2, i32 0, i32 1, i64 1, i64 2, i64 %indvar29
25 %exitcond31 = icmp ne i64 %indvar29, 12
26 br i1 %exitcond31, label %for.body, label %for.end
28 for.body: ; preds = %for.cond
29 store i32 5, i32* %arrayidx, align 4
32 for.inc: ; preds = %for.body
33 %indvar.next30 = add i64 %indvar29, 1
36 for.end: ; preds = %for.cond
39 for.cond3: ; preds = %for.inc12, %for.end
40 %indvar26 = phi i64 [ %indvar.next27, %for.inc12 ], [ 0, %for.end ]
41 %arrayidx9 = getelementptr [4 x %struct.test1]* @tmp1, i64 0, i64 2, i32 0, i32 1, i64 1, i64 2, i64 %indvar26
42 %i.1 = trunc i64 %indvar26 to i32
43 %cmp5 = icmp slt i32 %i.1, 12
44 br i1 %cmp5, label %for.body6, label %for.end15
46 for.body6: ; preds = %for.cond3
47 %tmp10 = load i32* %arrayidx9, align 4
48 %cmp11 = icmp eq i32 %tmp10, 5
49 br i1 %cmp11, label %if.end, label %if.then
51 if.then: ; preds = %for.body6
52 call void @abort() noreturn nounwind
55 if.end: ; preds = %for.body6
58 for.inc12: ; preds = %if.end
59 %indvar.next27 = add i64 %indvar26, 1
62 for.end15: ; preds = %for.cond3
65 for.cond16: ; preds = %for.inc23, %for.end15
66 %indvar21 = phi i64 [ %indvar.next22, %for.inc23 ], [ 0, %for.end15 ]
67 %tmp24 = add i64 %indvar21, 3
68 %arrayidx22 = getelementptr [4 x %struct.test1]* @tmp1, i64 0, i64 2, i32 0, i32 1, i64 1, i64 2, i64 %tmp24
69 %exitcond23 = icmp ne i64 %indvar21, 8
70 br i1 %exitcond23, label %for.body19, label %for.end26
72 for.body19: ; preds = %for.cond16
73 store i32 6, i32* %arrayidx22, align 4
76 for.inc23: ; preds = %for.body19
77 %indvar.next22 = add i64 %indvar21, 1
80 for.end26: ; preds = %for.cond16
83 for.cond27: ; preds = %for.inc38, %for.end26
84 %indvar18 = phi i64 [ %indvar.next19, %for.inc38 ], [ 0, %for.end26 ]
85 %tmp = add i64 %indvar18, 3
86 %arrayidx33 = getelementptr [4 x %struct.test1]* @tmp1, i64 0, i64 2, i32 0, i32 1, i64 1, i64 2, i64 %tmp
87 %i.3 = trunc i64 %tmp to i32
88 %cmp29 = icmp slt i32 %i.3, 11
89 br i1 %cmp29, label %for.body30, label %for.end41
91 for.body30: ; preds = %for.cond27
92 %tmp34 = load i32* %arrayidx33, align 4
93 %cmp35 = icmp eq i32 %tmp34, 6
94 br i1 %cmp35, label %if.end37, label %if.then36
96 if.then36: ; preds = %for.body30
97 call void @abort() noreturn nounwind
100 if.end37: ; preds = %for.body30
103 for.inc38: ; preds = %if.end37
104 %indvar.next19 = add i64 %indvar18, 1
107 for.end41: ; preds = %for.cond27
110 for.cond42: ; preds = %for.inc60, %for.end41
111 %indvar15 = phi i64 [ %indvar.next16, %for.inc60 ], [ 0, %for.end41 ]
112 %exitcond17 = icmp ne i64 %indvar15, 12
113 br i1 %exitcond17, label %for.body45, label %for.end63
115 for.body45: ; preds = %for.cond42
118 for.cond46: ; preds = %for.inc56, %for.body45
119 %indvar12 = phi i64 [ %indvar.next13, %for.inc56 ], [ 0, %for.body45 ]
120 %arrayidx55 = getelementptr [4 x %struct.test1]* @tmp1, i64 0, i64 2, i32 3, i32 1, i64 1, i64 %indvar15, i64 %indvar12
121 %exitcond14 = icmp ne i64 %indvar12, 12
122 br i1 %exitcond14, label %for.body49, label %for.end59
124 for.body49: ; preds = %for.cond46
125 store i32 8, i32* %arrayidx55, align 4
128 for.inc56: ; preds = %for.body49
129 %indvar.next13 = add i64 %indvar12, 1
132 for.end59: ; preds = %for.cond46
135 for.inc60: ; preds = %for.end59
136 %indvar.next16 = add i64 %indvar15, 1
139 for.end63: ; preds = %for.cond42
142 for.cond64: ; preds = %for.inc86, %for.end63
143 %indvar10 = phi i64 [ %indvar.next11, %for.inc86 ], [ 0, %for.end63 ]
144 %i.5 = trunc i64 %indvar10 to i32
145 %cmp66 = icmp slt i32 %i.5, 12
146 br i1 %cmp66, label %for.body67, label %for.end89
148 for.body67: ; preds = %for.cond64
151 for.cond68: ; preds = %for.inc82, %for.body67
152 %indvar8 = phi i64 [ %indvar.next9, %for.inc82 ], [ 0, %for.body67 ]
153 %arrayidx77 = getelementptr [4 x %struct.test1]* @tmp1, i64 0, i64 2, i32 3, i32 1, i64 1, i64 %indvar10, i64 %indvar8
154 %j.1 = trunc i64 %indvar8 to i32
155 %cmp70 = icmp slt i32 %j.1, 12
156 br i1 %cmp70, label %for.body71, label %for.end85
158 for.body71: ; preds = %for.cond68
159 %tmp78 = load i32* %arrayidx77, align 4
160 %cmp79 = icmp eq i32 %tmp78, 8
161 br i1 %cmp79, label %if.end81, label %if.then80
163 if.then80: ; preds = %for.body71
164 call void @abort() noreturn nounwind
167 if.end81: ; preds = %for.body71
170 for.inc82: ; preds = %if.end81
171 %indvar.next9 = add i64 %indvar8, 1
174 for.end85: ; preds = %for.cond68
177 for.inc86: ; preds = %for.end85
178 %indvar.next11 = add i64 %indvar10, 1
181 for.end89: ; preds = %for.cond64
184 for.cond90: ; preds = %for.inc108, %for.end89
185 %indvar5 = phi i64 [ %indvar.next6, %for.inc108 ], [ 0, %for.end89 ]
186 %exitcond7 = icmp ne i64 %indvar5, 8
187 br i1 %exitcond7, label %for.body93, label %for.end111
189 for.body93: ; preds = %for.cond90
192 for.cond94: ; preds = %for.inc104, %for.body93
193 %indvar3 = phi i64 [ %indvar.next4, %for.inc104 ], [ 0, %for.body93 ]
194 %arrayidx103 = getelementptr [4 x %struct.test2]* @tmp2, i64 0, i64 2, i32 3, i32 1, i64 1, i64 %indvar5, i64 %indvar3
195 %exitcond = icmp ne i64 %indvar3, 8
196 br i1 %exitcond, label %for.body97, label %for.end107
198 for.body97: ; preds = %for.cond94
199 store i32 8, i32* %arrayidx103, align 4
202 for.inc104: ; preds = %for.body97
203 %indvar.next4 = add i64 %indvar3, 1
206 for.end107: ; preds = %for.cond94
209 for.inc108: ; preds = %for.end107
210 %indvar.next6 = add i64 %indvar5, 1
213 for.end111: ; preds = %for.cond90
214 br label %for.cond112
216 for.cond112: ; preds = %for.inc134, %for.end111
217 %indvar1 = phi i64 [ %indvar.next2, %for.inc134 ], [ 0, %for.end111 ]
218 %i.7 = trunc i64 %indvar1 to i32
219 %cmp114 = icmp slt i32 %i.7, 8
220 br i1 %cmp114, label %for.body115, label %for.end137
222 for.body115: ; preds = %for.cond112
223 br label %for.cond116
225 for.cond116: ; preds = %for.inc130, %for.body115
226 %indvar = phi i64 [ %indvar.next, %for.inc130 ], [ 0, %for.body115 ]
227 %arrayidx125 = getelementptr [4 x %struct.test2]* @tmp2, i64 0, i64 2, i32 3, i32 1, i64 1, i64 %indvar1, i64 %indvar
228 %j.3 = trunc i64 %indvar to i32
229 %cmp118 = icmp slt i32 %j.3, 8
230 br i1 %cmp118, label %for.body119, label %for.end133
232 for.body119: ; preds = %for.cond116
233 %tmp126 = load i32* %arrayidx125, align 4
234 %cmp127 = icmp eq i32 %tmp126, 8
235 br i1 %cmp127, label %if.end129, label %if.then128
237 if.then128: ; preds = %for.body119
238 call void @abort() noreturn nounwind
241 if.end129: ; preds = %for.body119
244 for.inc130: ; preds = %if.end129
245 %indvar.next = add i64 %indvar, 1
246 br label %for.cond116
248 for.end133: ; preds = %for.cond116
251 for.inc134: ; preds = %for.end133
252 %indvar.next2 = add i64 %indvar1, 1
253 br label %for.cond112
255 for.end137: ; preds = %for.cond112
259 declare void @abort() noreturn
261 define i32 @main() nounwind uwtable {
263 call void @check_vect()
264 %call = call i32 @main1()
268 define internal void @check_vect() nounwind uwtable noinline {
270 %a = alloca i32, align 4
271 %b = alloca i32, align 4
272 %c = alloca i32, align 4
273 %d = alloca i32, align 4
274 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
275 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
276 %tobool = icmp eq i32 %call1, 0
277 br i1 %tobool, label %if.then, label %lor.lhs.false
279 lor.lhs.false: ; preds = %entry
280 %tmp4 = load i32* %d, align 4
281 %and6 = and i32 %tmp4, 67108864
282 %cmp = icmp eq i32 %and6, 0
283 br i1 %cmp, label %if.then, label %if.end
285 if.then: ; preds = %entry, %lor.lhs.false
286 call void @exit(i32 0) noreturn nounwind
289 if.end: ; preds = %lor.lhs.false
290 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
294 declare void (i32)* @signal(i32, void (i32)*) nounwind
296 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
298 call void @exit(i32 0) noreturn nounwind
301 return: ; No predecessors!
305 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
307 %and = and i32 %__level, -2147483648
308 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
309 %cmp = icmp ult i32 %call, %__level
310 br i1 %cmp, label %if.then, label %if.end
312 if.then: ; preds = %entry
315 if.end: ; preds = %entry
316 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
317 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
318 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
319 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
320 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
321 store i32 %asmresult, i32* %__eax, align 4
322 store i32 %asmresult8, i32* %__ebx, align 4
323 store i32 %asmresult9, i32* %__ecx, align 4
324 store i32 %asmresult10, i32* %__edx, align 4
327 return: ; preds = %if.end, %if.then
328 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
332 declare void @exit(i32) noreturn
334 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
336 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
337 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
338 %tobool = icmp eq i32* %__sig, null
339 br i1 %tobool, label %if.end, label %if.then
341 if.then: ; preds = %entry
342 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
343 store i32 %asmresult1, i32* %__sig, align 4
346 if.end: ; preds = %entry, %if.then
350 !0 = metadata !{i32 -2147341980, i32 -2147341972}
351 !1 = metadata !{i32 -2147342103, i32 -2147342095}