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 slp-8.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-8.s > slp-8.ll
8 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"
9 target triple = "x86_64-unknown-linux-gnu"
11 @ib = global [32 x i32] [i32 0, i32 3, i32 6, i32 9, i32 12, i32 15, i32 18, i32 21, i32 24, i32 27, i32 30, i32 33, i32 36, i32 39, i32 42, i32 45, i32 0, i32 3, i32 6, i32 9, i32 12, i32 15, i32 18, i32 21, i32 24, i32 27, i32 30, i32 33, i32 36, i32 39, i32 42, i32 45], align 16
13 define i32 @main1() nounwind uwtable {
15 %fa = alloca [32 x float], align 16
18 for.cond: ; preds = %for.inc, %entry
19 %indvar17 = phi i64 [ %indvar.next18, %for.inc ], [ 0, %entry ]
20 %tmp19 = mul i64 %indvar17, 4
21 %tmp20 = add i64 %tmp19, 3
22 %arrayidx41 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp20
23 %arrayidx34 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp20
24 %tmp21 = add i64 %tmp19, 2
25 %arrayidx29 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp21
26 %arrayidx22 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp21
27 %tmp22 = add i64 %tmp19, 1
28 %arrayidx17 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp22
29 %arrayidx10 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp22
30 %arrayidx6 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp19
31 %arrayidx = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp19
32 %exitcond = icmp ne i64 %indvar17, 8
33 br i1 %exitcond, label %for.body, label %for.end
35 for.body: ; preds = %for.cond
36 %tmp2 = load i32* %arrayidx, align 16
37 %conv = sitofp i32 %tmp2 to float
38 store float %conv, float* %arrayidx6, align 16
39 %tmp11 = load i32* %arrayidx10, align 4
40 %conv12 = sitofp i32 %tmp11 to float
41 store float %conv12, float* %arrayidx17, align 4
42 %tmp23 = load i32* %arrayidx22, align 8
43 %conv24 = sitofp i32 %tmp23 to float
44 store float %conv24, float* %arrayidx29, align 8
45 %tmp35 = load i32* %arrayidx34, align 4
46 %conv36 = sitofp i32 %tmp35 to float
47 store float %conv36, float* %arrayidx41, align 4
50 for.inc: ; preds = %for.body
51 %indvar.next18 = add i64 %indvar17, 1
54 for.end: ; preds = %for.cond
57 for.cond43: ; preds = %for.inc108, %for.end
58 %indvar = phi i64 [ %indvar.next, %for.inc108 ], [ 0, %for.end ]
59 %tmp = mul i64 %indvar, 4
60 %tmp13 = add i64 %tmp, 3
61 %arrayidx103 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp13
62 %arrayidx97 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp13
63 %tmp14 = add i64 %tmp, 2
64 %arrayidx87 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp14
65 %arrayidx81 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp14
66 %tmp15 = add i64 %tmp, 1
67 %arrayidx71 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp15
68 %arrayidx65 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp15
69 %arrayidx56 = getelementptr [32 x i32]* @ib, i64 0, i64 %tmp
70 %arrayidx51 = getelementptr [32 x float]* %fa, i64 0, i64 %tmp
71 %i.1 = trunc i64 %indvar to i32
72 %cmp45 = icmp slt i32 %i.1, 8
73 br i1 %cmp45, label %for.body47, label %for.end111
75 for.body47: ; preds = %for.cond43
76 %tmp52 = load float* %arrayidx51, align 16
77 %tmp57 = load i32* %arrayidx56, align 16
78 %conv58 = sitofp i32 %tmp57 to float
79 %cmp59 = fcmp une float %tmp52, %conv58
80 br i1 %cmp59, label %if.then, label %lor.lhs.false
82 lor.lhs.false: ; preds = %for.body47
83 %tmp66 = load float* %arrayidx65, align 4
84 %tmp72 = load i32* %arrayidx71, align 4
85 %conv73 = sitofp i32 %tmp72 to float
86 %cmp74 = fcmp une float %tmp66, %conv73
87 br i1 %cmp74, label %if.then, label %lor.lhs.false76
89 lor.lhs.false76: ; preds = %lor.lhs.false
90 %tmp82 = load float* %arrayidx81, align 8
91 %tmp88 = load i32* %arrayidx87, align 8
92 %conv89 = sitofp i32 %tmp88 to float
93 %cmp90 = fcmp une float %tmp82, %conv89
94 br i1 %cmp90, label %if.then, label %lor.lhs.false92
96 lor.lhs.false92: ; preds = %lor.lhs.false76
97 %tmp98 = load float* %arrayidx97, align 4
98 %tmp104 = load i32* %arrayidx103, align 4
99 %conv105 = sitofp i32 %tmp104 to float
100 %cmp106 = fcmp une float %tmp98, %conv105
101 br i1 %cmp106, label %if.then, label %if.end
103 if.then: ; preds = %lor.lhs.false92, %lor.lhs.false76, %lor.lhs.false, %for.body47
104 call void @abort() noreturn nounwind
107 if.end: ; preds = %lor.lhs.false92
110 for.inc108: ; preds = %if.end
111 %indvar.next = add i64 %indvar, 1
114 for.end111: ; preds = %for.cond43
118 declare void @abort() noreturn
120 define i32 @main() nounwind uwtable {
122 call void @check_vect()
123 %call = call i32 @main1()
127 define internal void @check_vect() nounwind uwtable noinline {
129 %a = alloca i32, align 4
130 %b = alloca i32, align 4
131 %c = alloca i32, align 4
132 %d = alloca i32, align 4
133 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
134 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
135 %tobool = icmp eq i32 %call1, 0
136 br i1 %tobool, label %if.then, label %lor.lhs.false
138 lor.lhs.false: ; preds = %entry
139 %tmp4 = load i32* %d, align 4
140 %and6 = and i32 %tmp4, 67108864
141 %cmp = icmp eq i32 %and6, 0
142 br i1 %cmp, label %if.then, label %if.end
144 if.then: ; preds = %entry, %lor.lhs.false
145 call void @exit(i32 0) noreturn nounwind
148 if.end: ; preds = %lor.lhs.false
149 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
153 declare void (i32)* @signal(i32, void (i32)*) nounwind
155 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
157 call void @exit(i32 0) noreturn nounwind
160 return: ; No predecessors!
164 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
166 %and = and i32 %__level, -2147483648
167 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
168 %cmp = icmp ult i32 %call, %__level
169 br i1 %cmp, label %if.then, label %if.end
171 if.then: ; preds = %entry
174 if.end: ; preds = %entry
175 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
176 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
177 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
178 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
179 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
180 store i32 %asmresult, i32* %__eax, align 4
181 store i32 %asmresult8, i32* %__ebx, align 4
182 store i32 %asmresult9, i32* %__ecx, align 4
183 store i32 %asmresult10, i32* %__edx, align 4
186 return: ; preds = %if.end, %if.then
187 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
191 declare void @exit(i32) noreturn
193 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
195 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
196 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
197 %tobool = icmp eq i32* %__sig, null
198 br i1 %tobool, label %if.end, label %if.then
200 if.then: ; preds = %entry
201 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
202 store i32 %asmresult1, i32* %__sig, align 4
205 if.end: ; preds = %entry, %if.then
209 !0 = metadata !{i32 -2147343206, i32 -2147343198}
210 !1 = metadata !{i32 -2147343329, i32 -2147343321}