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-13.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-13.s > bb-slp-13.ll
6 ; ModuleID = 'bb-slp-13.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 @out = common global [16 x i32] zeroinitializer, align 16
13 define i32 @main1(i32 %x, i32 %y) nounwind uwtable noinline {
15 %tmp = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
16 %add = add i32 %tmp, 23
17 %tmp1 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
18 %add2 = add i32 %tmp1, 142
19 %tmp3 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
20 %add4 = add i32 %tmp3, 2
21 %tmp5 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
22 %add6 = add i32 %tmp5, 31
23 %mul = mul i32 %add, %x
24 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
25 %mul11 = mul i32 %add2, %y
26 store i32 %mul11, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
27 %mul14 = mul i32 %add4, %x
28 store i32 %mul14, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
29 %mul17 = mul i32 %add6, %y
30 store i32 %mul17, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
31 %tobool = icmp eq i32 %x, 0
32 br i1 %tobool, label %if.end, label %if.then
34 if.then: ; preds = %entry
35 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
38 if.end: ; preds = %entry, %if.then
39 %tmp19 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
40 %tmp20 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
41 %add21 = add i32 %tmp20, 23
42 %mul23 = mul i32 %add21, %x
43 %cmp = icmp eq i32 %tmp19, %mul23
44 br i1 %cmp, label %lor.lhs.false, label %if.then44
46 lor.lhs.false: ; preds = %if.end
47 %tmp24 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
48 %tmp25 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
49 %add26 = add i32 %tmp25, 142
50 %mul28 = mul i32 %add26, %y
51 %cmp29 = icmp eq i32 %tmp24, %mul28
52 br i1 %cmp29, label %lor.lhs.false30, label %if.then44
54 lor.lhs.false30: ; preds = %lor.lhs.false
55 %tmp31 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
56 %tmp32 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
57 %add33 = add i32 %tmp32, 2
58 %mul35 = mul i32 %add33, %x
59 %cmp36 = icmp eq i32 %tmp31, %mul35
60 br i1 %cmp36, label %lor.lhs.false37, label %if.then44
62 lor.lhs.false37: ; preds = %lor.lhs.false30
63 %tmp38 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
64 %tmp39 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
65 %add40 = add i32 %tmp39, 31
66 %mul42 = mul i32 %add40, %y
67 %cmp43 = icmp eq i32 %tmp38, %mul42
68 br i1 %cmp43, label %if.end45, label %if.then44
70 if.then44: ; preds = %lor.lhs.false37, %lor.lhs.false30, %lor.lhs.false, %if.end
71 call void @abort() noreturn nounwind
74 if.end45: ; preds = %lor.lhs.false37
78 declare void @abort() noreturn
80 define i32 @main() nounwind uwtable {
82 call void @check_vect()
83 %call = call i32 @main1(i32 2, i32 3)
87 define internal void @check_vect() nounwind uwtable noinline {
89 %a = alloca i32, align 4
90 %b = alloca i32, align 4
91 %c = alloca i32, align 4
92 %d = alloca i32, align 4
93 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
94 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
95 %tobool = icmp eq i32 %call1, 0
96 br i1 %tobool, label %if.then, label %lor.lhs.false
98 lor.lhs.false: ; preds = %entry
99 %tmp4 = load i32* %d, align 4
100 %and6 = and i32 %tmp4, 67108864
101 %cmp = icmp eq i32 %and6, 0
102 br i1 %cmp, label %if.then, label %if.end
104 if.then: ; preds = %entry, %lor.lhs.false
105 call void @exit(i32 0) noreturn nounwind
108 if.end: ; preds = %lor.lhs.false
109 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
113 declare void (i32)* @signal(i32, void (i32)*) nounwind
115 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
117 call void @exit(i32 0) noreturn nounwind
120 return: ; No predecessors!
124 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
126 %and = and i32 %__level, -2147483648
127 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
128 %cmp = icmp ult i32 %call, %__level
129 br i1 %cmp, label %if.then, label %if.end
131 if.then: ; preds = %entry
134 if.end: ; preds = %entry
135 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
136 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
137 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
138 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
139 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
140 store i32 %asmresult, i32* %__eax, align 4
141 store i32 %asmresult8, i32* %__ebx, align 4
142 store i32 %asmresult9, i32* %__ecx, align 4
143 store i32 %asmresult10, i32* %__edx, align 4
146 return: ; preds = %if.end, %if.then
147 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
151 declare void @exit(i32) noreturn
153 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
155 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
156 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
157 %tobool = icmp eq i32* %__sig, null
158 br i1 %tobool, label %if.end, label %if.then
160 if.then: ; preds = %entry
161 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
162 store i32 %asmresult1, i32* %__sig, align 4
165 if.end: ; preds = %entry, %if.then
169 !0 = metadata !{i32 493}
170 !1 = metadata !{i32 -2147343385, i32 -2147343377}
171 !2 = metadata !{i32 -2147343508, i32 -2147343500}