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-8b.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-8b.s > bb-slp-8b.ll
6 ; ModuleID = 'bb-slp-8b.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 %tmp1 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
16 %add = add i32 %tmp1, 23
17 %mul = mul i32 %add, %x
18 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
19 %tmp8 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
20 %add9 = add i32 %tmp8, 142
21 %mul12 = mul i32 %add9, %y
22 store i32 %mul12, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
23 %tmp17 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
24 %add18 = add i32 %tmp17, 2
25 %mul21 = mul i32 %add18, %x
26 store i32 %mul21, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
27 %tmp26 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
28 %add27 = add i32 %tmp26, 31
29 %mul30 = mul i32 %add27, %y
30 store i32 %mul30, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
31 br i1 undef, label %if.then, label %if.end
33 if.then: ; preds = %entry
34 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
37 if.end: ; preds = %if.then, %entry
38 %tmp34 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
39 %tmp35 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
40 %add36 = add i32 %tmp35, 23
41 %mul38 = mul i32 %add36, %x
42 %cmp = icmp eq i32 %tmp34, %mul38
43 br i1 %cmp, label %lor.lhs.false, label %if.then59
45 lor.lhs.false: ; preds = %if.end
46 %tmp39 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
47 %tmp40 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
48 %add41 = add i32 %tmp40, 142
49 %mul43 = mul i32 %add41, %y
50 %cmp44 = icmp eq i32 %tmp39, %mul43
51 br i1 %cmp44, label %lor.lhs.false45, label %if.then59
53 lor.lhs.false45: ; preds = %lor.lhs.false
54 %tmp46 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
55 %tmp47 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
56 %add48 = add i32 %tmp47, 2
57 %mul50 = mul i32 %add48, %x
58 %cmp51 = icmp eq i32 %tmp46, %mul50
59 br i1 %cmp51, label %lor.lhs.false52, label %if.then59
61 lor.lhs.false52: ; preds = %lor.lhs.false45
62 %tmp53 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
63 %tmp54 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
64 %add55 = add i32 %tmp54, 31
65 %mul57 = mul i32 %add55, %y
66 %cmp58 = icmp eq i32 %tmp53, %mul57
67 br i1 %cmp58, label %if.end60, label %if.then59
69 if.then59: ; preds = %lor.lhs.false52, %lor.lhs.false45, %lor.lhs.false, %if.end
70 call void @abort() noreturn nounwind
73 if.end60: ; preds = %lor.lhs.false52
77 declare void @abort() noreturn
79 define i32 @main() nounwind uwtable {
81 call void @check_vect()
82 %call = call i32 @main1(i32 2, i32 3)
86 define internal void @check_vect() nounwind uwtable noinline {
88 %a = alloca i32, align 4
89 %b = alloca i32, align 4
90 %c = alloca i32, align 4
91 %d = alloca i32, align 4
92 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
93 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
94 %tobool = icmp eq i32 %call1, 0
95 br i1 %tobool, label %if.then, label %lor.lhs.false
97 lor.lhs.false: ; preds = %entry
98 %tmp4 = load i32* %d, align 4
99 %and6 = and i32 %tmp4, 67108864
100 %cmp = icmp eq i32 %and6, 0
101 br i1 %cmp, label %if.then, label %if.end
103 if.then: ; preds = %entry, %lor.lhs.false
104 call void @exit(i32 0) noreturn nounwind
107 if.end: ; preds = %lor.lhs.false
108 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
112 declare void (i32)* @signal(i32, void (i32)*) nounwind
114 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
116 call void @exit(i32 0) noreturn nounwind
119 return: ; No predecessors!
123 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
125 %and = and i32 %__level, -2147483648
126 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
127 %cmp = icmp ult i32 %call, %__level
128 br i1 %cmp, label %if.then, label %if.end
130 if.then: ; preds = %entry
133 if.end: ; preds = %entry
134 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
135 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
136 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
137 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
138 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
139 store i32 %asmresult, i32* %__eax, align 4
140 store i32 %asmresult8, i32* %__ebx, align 4
141 store i32 %asmresult9, i32* %__ecx, align 4
142 store i32 %asmresult10, i32* %__edx, align 4
145 return: ; preds = %if.end, %if.then
146 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
150 declare void @exit(i32) noreturn
152 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
154 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
155 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
156 %tobool = icmp eq i32* %__sig, null
157 br i1 %tobool, label %if.end, label %if.then
159 if.then: ; preds = %entry
160 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
161 store i32 %asmresult1, i32* %__sig, align 4
164 if.end: ; preds = %entry, %if.then
168 !0 = metadata !{i32 689}
169 !1 = metadata !{i32 -2147343184, i32 -2147343176}
170 !2 = metadata !{i32 -2147343307, i32 -2147343299}