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 bb-slp-22.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-22.s > bb-slp-22.ll
6 ; ModuleID = 'bb-slp-22.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 @in = global [16 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15], align 16
11 @b = common global [16 x i32] zeroinitializer, align 16
12 @out = common global [16 x i32] zeroinitializer, align 16
14 define i32 @main1(i32 %x, i32 %y) nounwind uwtable noinline {
16 %tmp = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
17 %add = add i32 %tmp, 23
18 %tmp1 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
19 %add2 = add i32 %tmp1, 142
20 %tmp3 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
21 %add4 = add i32 %tmp3, 2
22 %tmp5 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
23 %add6 = add i32 %tmp5, 31
24 %cmp = icmp ugt i32 %x, %y
25 br i1 %cmp, label %if.then, label %if.else
27 if.then: ; preds = %entry
28 store i32 %add, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 0), align 16
29 store i32 %add2, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 1), align 4
30 store i32 %add4, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 2), align 8
31 store i32 %add6, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 3), align 4
34 if.else: ; preds = %entry
35 %mul = mul i32 %add, %x
36 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
37 %mul17 = mul i32 %add2, %y
38 store i32 %mul17, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
39 %mul20 = mul i32 %add4, %x
40 store i32 %mul20, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
41 %mul23 = mul i32 %add6, %y
42 store i32 %mul23, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
45 if.end: ; preds = %if.else, %if.then
46 %tobool = icmp eq i32 %x, 0
47 br i1 %tobool, label %if.end26, label %if.then25
49 if.then25: ; preds = %if.end
50 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
53 if.end26: ; preds = %if.end, %if.then25
54 %cmp29 = icmp ugt i32 %x, %y
55 br i1 %cmp29, label %lor.lhs.false56, label %land.lhs.true
57 land.lhs.true: ; preds = %if.end26
58 %tmp30 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
59 %tmp31 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
60 %add32 = add i32 %tmp31, 23
61 %mul34 = mul i32 %add32, %x
62 %cmp35 = icmp eq i32 %tmp30, %mul34
63 br i1 %cmp35, label %lor.lhs.false, label %if.then80
65 lor.lhs.false: ; preds = %land.lhs.true
66 %tmp36 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
67 %tmp37 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
68 %add38 = add i32 %tmp37, 142
69 %mul40 = mul i32 %add38, %y
70 %cmp41 = icmp eq i32 %tmp36, %mul40
71 br i1 %cmp41, label %lor.lhs.false42, label %if.then80
73 lor.lhs.false42: ; preds = %lor.lhs.false
74 %tmp43 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
75 %tmp44 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
76 %add45 = add i32 %tmp44, 2
77 %mul47 = mul i32 %add45, %x
78 %cmp48 = icmp eq i32 %tmp43, %mul47
79 br i1 %cmp48, label %lor.lhs.false49, label %if.then80
81 lor.lhs.false49: ; preds = %lor.lhs.false42
82 %tmp50 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
83 %tmp51 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
84 %add52 = add i32 %tmp51, 31
85 %mul54 = mul i32 %add52, %y
86 %cmp55 = icmp eq i32 %tmp50, %mul54
87 br i1 %cmp55, label %lor.lhs.false56, label %if.then80
89 lor.lhs.false56: ; preds = %lor.lhs.false49, %if.end26
90 %cmp59 = icmp ugt i32 %x, %y
91 br i1 %cmp59, label %land.lhs.true60, label %if.end81
93 land.lhs.true60: ; preds = %lor.lhs.false56
94 %tmp61 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 0), align 16
95 %tmp62 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
96 %add63 = add i32 %tmp62, 23
97 %cmp64 = icmp eq i32 %tmp61, %add63
98 br i1 %cmp64, label %lor.lhs.false65, label %if.then80
100 lor.lhs.false65: ; preds = %land.lhs.true60
101 %tmp66 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 1), align 4
102 %tmp67 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
103 %add68 = add i32 %tmp67, 142
104 %cmp69 = icmp eq i32 %tmp66, %add68
105 br i1 %cmp69, label %lor.lhs.false70, label %if.then80
107 lor.lhs.false70: ; preds = %lor.lhs.false65
108 %tmp71 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 2), align 8
109 %tmp72 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
110 %add73 = add i32 %tmp72, 2
111 %cmp74 = icmp eq i32 %tmp71, %add73
112 br i1 %cmp74, label %lor.lhs.false75, label %if.then80
114 lor.lhs.false75: ; preds = %lor.lhs.false70
115 %tmp76 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 3), align 4
116 %tmp77 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
117 %add78 = add i32 %tmp77, 31
118 %cmp79 = icmp eq i32 %tmp76, %add78
119 br i1 %cmp79, label %if.end81, label %if.then80
121 if.then80: ; preds = %lor.lhs.false49, %lor.lhs.false42, %lor.lhs.false, %land.lhs.true, %lor.lhs.false75, %lor.lhs.false70, %lor.lhs.false65, %land.lhs.true60
122 call void @abort() noreturn nounwind
125 if.end81: ; preds = %lor.lhs.false75, %lor.lhs.false56
129 declare void @abort() noreturn
131 define i32 @main() nounwind uwtable {
133 call void @check_vect()
134 %call = call i32 @main1(i32 2, i32 3)
138 define internal void @check_vect() nounwind uwtable noinline {
140 %a = alloca i32, align 4
141 %b = alloca i32, align 4
142 %c = alloca i32, align 4
143 %d = alloca i32, align 4
144 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
145 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
146 %tobool = icmp eq i32 %call1, 0
147 br i1 %tobool, label %if.then, label %lor.lhs.false
149 lor.lhs.false: ; preds = %entry
150 %tmp4 = load i32* %d, align 4
151 %and6 = and i32 %tmp4, 67108864
152 %cmp = icmp eq i32 %and6, 0
153 br i1 %cmp, label %if.then, label %if.end
155 if.then: ; preds = %entry, %lor.lhs.false
156 call void @exit(i32 0) noreturn nounwind
159 if.end: ; preds = %lor.lhs.false
160 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
164 declare void (i32)* @signal(i32, void (i32)*) nounwind
166 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
168 call void @exit(i32 0) noreturn nounwind
171 return: ; No predecessors!
175 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
177 %and = and i32 %__level, -2147483648
178 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
179 %cmp = icmp ult i32 %call, %__level
180 br i1 %cmp, label %if.then, label %if.end
182 if.then: ; preds = %entry
185 if.end: ; preds = %entry
186 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
187 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
188 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
189 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
190 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
191 store i32 %asmresult, i32* %__eax, align 4
192 store i32 %asmresult8, i32* %__ebx, align 4
193 store i32 %asmresult9, i32* %__ecx, align 4
194 store i32 %asmresult10, i32* %__edx, align 4
197 return: ; preds = %if.end, %if.then
198 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
202 declare void @exit(i32) noreturn
204 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
206 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
207 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
208 %tobool = icmp eq i32* %__sig, null
209 br i1 %tobool, label %if.end, label %if.then
211 if.then: ; preds = %entry
212 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
213 store i32 %asmresult1, i32* %__sig, align 4
216 if.end: ; preds = %entry, %if.then
220 !0 = metadata !{i32 638}
221 !1 = metadata !{i32 -2147342907, i32 -2147342899}
222 !2 = metadata !{i32 -2147343030, i32 -2147343022}