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-36.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-section-anchors-vect-36.s > no-section-anchors-vect-36.ll
6 ; ModuleID = 'no-section-anchors-vect-36.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.anon = type { [16 x i8], [16 x i8] }
12 @s = common global %struct.anon zeroinitializer, align 1
14 define i32 @main1() nounwind uwtable noinline {
18 for.cond: ; preds = %for.inc, %entry
19 %indvar3 = phi i64 [ %indvar.next4, %for.inc ], [ 0, %entry ]
20 %tmp = mul i64 %indvar3, 3
21 %conv = trunc i64 %tmp to i8
22 %arrayidx = getelementptr %struct.anon* @s, i64 0, i32 1, i64 %indvar3
23 %exitcond5 = icmp ne i64 %indvar3, 16
24 br i1 %exitcond5, label %for.body, label %for.end
26 for.body: ; preds = %for.cond
27 store i8 %conv, i8* %arrayidx, align 1
28 call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
31 for.inc: ; preds = %for.body
32 %indvar.next4 = add i64 %indvar3, 1
35 for.end: ; preds = %for.cond
38 for.cond4: ; preds = %for.inc16, %for.end
39 %indvar1 = phi i64 [ %indvar.next2, %for.inc16 ], [ 0, %for.end ]
40 %arrayidx15 = getelementptr %struct.anon* @s, i64 0, i32 0, i64 %indvar1
41 %arrayidx11 = getelementptr %struct.anon* @s, i64 0, i32 1, i64 %indvar1
42 %exitcond = icmp ne i64 %indvar1, 16
43 br i1 %exitcond, label %for.body8, label %for.end19
45 for.body8: ; preds = %for.cond4
46 %tmp12 = load i8* %arrayidx11, align 1
47 store i8 %tmp12, i8* %arrayidx15, align 1
50 for.inc16: ; preds = %for.body8
51 %indvar.next2 = add i64 %indvar1, 1
54 for.end19: ; preds = %for.cond4
57 for.cond20: ; preds = %for.inc37, %for.end19
58 %indvar = phi i64 [ %indvar.next, %for.inc37 ], [ 0, %for.end19 ]
59 %arrayidx32 = getelementptr %struct.anon* @s, i64 0, i32 1, i64 %indvar
60 %arrayidx27 = getelementptr %struct.anon* @s, i64 0, i32 0, i64 %indvar
61 %i.2 = trunc i64 %indvar to i32
62 %cmp22 = icmp slt i32 %i.2, 16
63 br i1 %cmp22, label %for.body24, label %for.end40
65 for.body24: ; preds = %for.cond20
66 %tmp28 = load i8* %arrayidx27, align 1
67 %tmp33 = load i8* %arrayidx32, align 1
68 %cmp35 = icmp eq i8 %tmp28, %tmp33
69 br i1 %cmp35, label %if.end, label %if.then
71 if.then: ; preds = %for.body24
72 call void @abort() noreturn nounwind
75 if.end: ; preds = %for.body24
78 for.inc37: ; preds = %if.end
79 %indvar.next = add i64 %indvar, 1
82 for.end40: ; preds = %for.cond20
86 declare void @abort() noreturn
88 define i32 @main() nounwind uwtable {
90 call void @check_vect()
91 %call = call i32 @main1()
95 define internal void @check_vect() nounwind uwtable noinline {
97 %a = alloca i32, align 4
98 %b = alloca i32, align 4
99 %c = alloca i32, align 4
100 %d = alloca i32, align 4
101 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
102 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
103 %tobool = icmp eq i32 %call1, 0
104 br i1 %tobool, label %if.then, label %lor.lhs.false
106 lor.lhs.false: ; preds = %entry
107 %tmp4 = load i32* %d, align 4
108 %and6 = and i32 %tmp4, 67108864
109 %cmp = icmp eq i32 %and6, 0
110 br i1 %cmp, label %if.then, label %if.end
112 if.then: ; preds = %entry, %lor.lhs.false
113 call void @exit(i32 0) noreturn nounwind
116 if.end: ; preds = %lor.lhs.false
117 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
121 declare void (i32)* @signal(i32, void (i32)*) nounwind
123 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
125 call void @exit(i32 0) noreturn nounwind
128 return: ; No predecessors!
132 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
134 %and = and i32 %__level, -2147483648
135 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
136 %cmp = icmp ult i32 %call, %__level
137 br i1 %cmp, label %if.then, label %if.end
139 if.then: ; preds = %entry
142 if.end: ; preds = %entry
143 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
144 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
145 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
146 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
147 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
148 store i32 %asmresult, i32* %__eax, align 4
149 store i32 %asmresult8, i32* %__ebx, align 4
150 store i32 %asmresult9, i32* %__ecx, align 4
151 store i32 %asmresult10, i32* %__edx, align 4
154 return: ; preds = %if.end, %if.then
155 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
159 declare void @exit(i32) noreturn
161 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
163 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
164 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
165 %tobool = icmp eq i32* %__sig, null
166 br i1 %tobool, label %if.end, label %if.then
168 if.then: ; preds = %entry
169 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
170 store i32 %asmresult1, i32* %__sig, align 4
173 if.end: ; preds = %entry, %if.then
177 !0 = metadata !{i32 283}
178 !1 = metadata !{i32 -2147343472, i32 -2147343464}
179 !2 = metadata !{i32 -2147343595, i32 -2147343587}