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-68.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-section-anchors-vect-68.s > no-section-anchors-vect-68.ll
6 ; ModuleID = 'no-section-anchors-vect-68.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, [32 x [32 x [32 x i32]]] }
13 @tmp1 = common global %struct.test1 zeroinitializer, align 4
15 define i32 @main1() nounwind uwtable noinline {
19 for.cond: ; preds = %for.inc, %entry
20 %indvar25 = phi i64 [ %indvar.next26, %for.inc ], [ 0, %entry ]
21 %arrayidx = getelementptr %struct.test1* @tmp1, i64 0, i32 0, i32 1, i64 1, i64 2, i64 %indvar25
22 %exitcond27 = icmp ne i64 %indvar25, 32
23 br i1 %exitcond27, label %for.body, label %for.end
25 for.body: ; preds = %for.cond
26 store i32 5, i32* %arrayidx, align 4
29 for.inc: ; preds = %for.body
30 %indvar.next26 = add i64 %indvar25, 1
33 for.end: ; preds = %for.cond
36 for.cond3: ; preds = %for.inc12, %for.end
37 %indvar22 = phi i64 [ %indvar.next23, %for.inc12 ], [ 0, %for.end ]
38 %arrayidx9 = getelementptr %struct.test1* @tmp1, i64 0, i32 0, i32 1, i64 1, i64 2, i64 %indvar22
39 %i.1 = trunc i64 %indvar22 to i32
40 %cmp5 = icmp slt i32 %i.1, 32
41 br i1 %cmp5, label %for.body6, label %for.end15
43 for.body6: ; preds = %for.cond3
44 %tmp10 = load i32* %arrayidx9, align 4
45 %cmp11 = icmp eq i32 %tmp10, 5
46 br i1 %cmp11, label %if.end, label %if.then
48 if.then: ; preds = %for.body6
49 call void @abort() noreturn nounwind
52 if.end: ; preds = %for.body6
55 for.inc12: ; preds = %if.end
56 %indvar.next23 = add i64 %indvar22, 1
59 for.end15: ; preds = %for.cond3
62 for.cond16: ; preds = %for.inc23, %for.end15
63 %indvar17 = phi i64 [ %indvar.next18, %for.inc23 ], [ 0, %for.end15 ]
64 %tmp20 = add i64 %indvar17, 3
65 %arrayidx22 = getelementptr %struct.test1* @tmp1, i64 0, i32 0, i32 1, i64 1, i64 2, i64 %tmp20
66 %exitcond19 = icmp ne i64 %indvar17, 28
67 br i1 %exitcond19, label %for.body19, label %for.end26
69 for.body19: ; preds = %for.cond16
70 store i32 6, i32* %arrayidx22, align 4
73 for.inc23: ; preds = %for.body19
74 %indvar.next18 = add i64 %indvar17, 1
77 for.end26: ; preds = %for.cond16
80 for.cond27: ; preds = %for.inc38, %for.end26
81 %indvar13 = phi i64 [ %indvar.next14, %for.inc38 ], [ 0, %for.end26 ]
82 %tmp15 = add i64 %indvar13, 3
83 %arrayidx33 = getelementptr %struct.test1* @tmp1, i64 0, i32 0, i32 1, i64 1, i64 2, i64 %tmp15
84 %i.3 = trunc i64 %tmp15 to i32
85 %cmp29 = icmp slt i32 %i.3, 31
86 br i1 %cmp29, label %for.body30, label %for.end41
88 for.body30: ; preds = %for.cond27
89 %tmp34 = load i32* %arrayidx33, align 4
90 %cmp35 = icmp eq i32 %tmp34, 6
91 br i1 %cmp35, label %if.end37, label %if.then36
93 if.then36: ; preds = %for.body30
94 call void @abort() noreturn nounwind
97 if.end37: ; preds = %for.body30
100 for.inc38: ; preds = %if.end37
101 %indvar.next14 = add i64 %indvar13, 1
104 for.end41: ; preds = %for.cond27
107 for.cond42: ; preds = %for.inc49, %for.end41
108 %indvar9 = phi i64 [ %indvar.next10, %for.inc49 ], [ 0, %for.end41 ]
109 %arrayidx48 = getelementptr %struct.test1* @tmp1, i64 0, i32 3, i32 1, i64 1, i64 2, i64 %indvar9
110 %exitcond11 = icmp ne i64 %indvar9, 32
111 br i1 %exitcond11, label %for.body45, label %for.end52
113 for.body45: ; preds = %for.cond42
114 store i32 7, i32* %arrayidx48, align 4
117 for.inc49: ; preds = %for.body45
118 %indvar.next10 = add i64 %indvar9, 1
121 for.end52: ; preds = %for.cond42
124 for.cond53: ; preds = %for.inc64, %for.end52
125 %indvar6 = phi i64 [ %indvar.next7, %for.inc64 ], [ 0, %for.end52 ]
126 %arrayidx59 = getelementptr %struct.test1* @tmp1, i64 0, i32 3, i32 1, i64 1, i64 2, i64 %indvar6
127 %i.5 = trunc i64 %indvar6 to i32
128 %cmp55 = icmp slt i32 %i.5, 32
129 br i1 %cmp55, label %for.body56, label %for.end67
131 for.body56: ; preds = %for.cond53
132 %tmp60 = load i32* %arrayidx59, align 4
133 %cmp61 = icmp eq i32 %tmp60, 7
134 br i1 %cmp61, label %if.end63, label %if.then62
136 if.then62: ; preds = %for.body56
137 call void @abort() noreturn nounwind
140 if.end63: ; preds = %for.body56
143 for.inc64: ; preds = %if.end63
144 %indvar.next7 = add i64 %indvar6, 1
147 for.end67: ; preds = %for.cond53
150 for.cond68: ; preds = %for.inc75, %for.end67
151 %indvar2 = phi i64 [ %indvar.next3, %for.inc75 ], [ 0, %for.end67 ]
152 %tmp4 = add i64 %indvar2, 3
153 %arrayidx74 = getelementptr %struct.test1* @tmp1, i64 0, i32 3, i32 1, i64 1, i64 2, i64 %tmp4
154 %exitcond = icmp ne i64 %indvar2, 26
155 br i1 %exitcond, label %for.body71, label %for.end78
157 for.body71: ; preds = %for.cond68
158 store i32 8, i32* %arrayidx74, align 4
161 for.inc75: ; preds = %for.body71
162 %indvar.next3 = add i64 %indvar2, 1
165 for.end78: ; preds = %for.cond68
168 for.cond79: ; preds = %for.inc90, %for.end78
169 %indvar = phi i64 [ %indvar.next, %for.inc90 ], [ 0, %for.end78 ]
170 %tmp = add i64 %indvar, 3
171 %arrayidx85 = getelementptr %struct.test1* @tmp1, i64 0, i32 3, i32 1, i64 1, i64 2, i64 %tmp
172 %i.7 = trunc i64 %tmp to i32
173 %cmp81 = icmp slt i32 %i.7, 29
174 br i1 %cmp81, label %for.body82, label %for.end93
176 for.body82: ; preds = %for.cond79
177 %tmp86 = load i32* %arrayidx85, align 4
178 %cmp87 = icmp eq i32 %tmp86, 8
179 br i1 %cmp87, label %if.end89, label %if.then88
181 if.then88: ; preds = %for.body82
182 call void @abort() noreturn nounwind
185 if.end89: ; preds = %for.body82
188 for.inc90: ; preds = %if.end89
189 %indvar.next = add i64 %indvar, 1
192 for.end93: ; preds = %for.cond79
196 declare void @abort() noreturn
198 define i32 @main() nounwind uwtable {
200 call void @check_vect()
201 %call = call i32 @main1()
205 define internal void @check_vect() nounwind uwtable noinline {
207 %a = alloca i32, align 4
208 %b = alloca i32, align 4
209 %c = alloca i32, align 4
210 %d = alloca i32, align 4
211 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
212 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
213 %tobool = icmp eq i32 %call1, 0
214 br i1 %tobool, label %if.then, label %lor.lhs.false
216 lor.lhs.false: ; preds = %entry
217 %tmp4 = load i32* %d, align 4
218 %and6 = and i32 %tmp4, 67108864
219 %cmp = icmp eq i32 %and6, 0
220 br i1 %cmp, label %if.then, label %if.end
222 if.then: ; preds = %entry, %lor.lhs.false
223 call void @exit(i32 0) noreturn nounwind
226 if.end: ; preds = %lor.lhs.false
227 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
231 declare void (i32)* @signal(i32, void (i32)*) nounwind
233 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
235 call void @exit(i32 0) noreturn nounwind
238 return: ; No predecessors!
242 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
244 %and = and i32 %__level, -2147483648
245 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
246 %cmp = icmp ult i32 %call, %__level
247 br i1 %cmp, label %if.then, label %if.end
249 if.then: ; preds = %entry
252 if.end: ; preds = %entry
253 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
254 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
255 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
256 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
257 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
258 store i32 %asmresult, i32* %__eax, align 4
259 store i32 %asmresult8, i32* %__ebx, align 4
260 store i32 %asmresult9, i32* %__ecx, align 4
261 store i32 %asmresult10, i32* %__edx, align 4
264 return: ; preds = %if.end, %if.then
265 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
269 declare void @exit(i32) noreturn
271 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
273 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
274 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
275 %tobool = icmp eq i32* %__sig, null
276 br i1 %tobool, label %if.end, label %if.then
278 if.then: ; preds = %entry
279 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
280 store i32 %asmresult1, i32* %__sig, align 4
283 if.end: ; preds = %entry, %if.then
287 !0 = metadata !{i32 -2147342778, i32 -2147342770}
288 !1 = metadata !{i32 -2147342901, i32 -2147342893}