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-tree-reassoc-bb-slp-12.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-tree-reassoc-bb-slp-12.s > no-tree-reassoc-bb-slp-12.ll
6 ; ModuleID = 'no-tree-reassoc-bb-slp-12.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 @in1 = 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 @in2 = global [16 x i32] [i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 110, i32 111, i32 112, i32 113, i32 114, i32 115], align 16
12 @out = common global [16 x i32] zeroinitializer, align 16
14 define i32 @main1(i32 %x, i32 %y) nounwind uwtable noinline {
16 %tmp1 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 0), align 16
17 %tmp4 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 0), align 16
18 %sub = sub i32 %tmp1, %tmp4
19 %add = add i32 %sub, 23
20 %tmp7 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 1), align 4
21 %tmp10 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 1), align 4
22 %sub11 = sub i32 %tmp7, %tmp10
23 %add12 = add i32 %sub11, 142
24 %tmp15 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 2), align 8
25 %tmp18 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 2), align 8
26 %sub19 = sub i32 %tmp15, %tmp18
27 %add20 = add i32 %sub19, 2
28 %tmp23 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 3), align 4
29 %tmp26 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 3), align 4
30 %sub27 = sub i32 %tmp23, %tmp26
31 %add28 = add i32 %sub27, 31
32 %mul = mul i32 %add, %x
33 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
34 %mul35 = mul i32 %add12, %y
35 store i32 %mul35, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
36 %mul40 = mul i32 %add20, %x
37 store i32 %mul40, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
38 %mul45 = mul i32 %add28, %y
39 store i32 %mul45, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
40 %tmp48 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
41 %tmp49 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 0), align 16
42 %tmp50 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 0), align 16
43 %sub51 = sub i32 %tmp49, %tmp50
44 %add52 = add i32 %sub51, 23
45 %mul54 = mul i32 %add52, %x
46 %cmp = icmp eq i32 %tmp48, %mul54
47 br i1 %cmp, label %lor.lhs.false, label %if.then
49 lor.lhs.false: ; preds = %entry
50 %tmp55 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
51 %tmp56 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 1), align 4
52 %tmp57 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 1), align 4
53 %sub58 = sub i32 %tmp56, %tmp57
54 %add59 = add i32 %sub58, 142
55 %mul61 = mul i32 %add59, %y
56 %cmp62 = icmp eq i32 %tmp55, %mul61
57 br i1 %cmp62, label %lor.lhs.false63, label %if.then
59 lor.lhs.false63: ; preds = %lor.lhs.false
60 %tmp64 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
61 %tmp65 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 2), align 8
62 %tmp66 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 2), align 8
63 %sub67 = sub i32 %tmp65, %tmp66
64 %add68 = add i32 %sub67, 2
65 %mul70 = mul i32 %add68, %x
66 %cmp71 = icmp eq i32 %tmp64, %mul70
67 br i1 %cmp71, label %lor.lhs.false72, label %if.then
69 lor.lhs.false72: ; preds = %lor.lhs.false63
70 %tmp73 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
71 %tmp74 = load i32* getelementptr inbounds ([16 x i32]* @in2, i64 0, i64 3), align 4
72 %tmp75 = load i32* getelementptr inbounds ([16 x i32]* @in1, i64 0, i64 3), align 4
73 %sub76 = sub i32 %tmp74, %tmp75
74 %add77 = add i32 %sub76, 31
75 %mul79 = mul i32 %add77, %y
76 %cmp80 = icmp eq i32 %tmp73, %mul79
77 br i1 %cmp80, label %if.end, label %if.then
79 if.then: ; preds = %lor.lhs.false72, %lor.lhs.false63, %lor.lhs.false, %entry
80 call void @abort() noreturn nounwind
83 if.end: ; preds = %lor.lhs.false72
87 declare void @abort() noreturn
89 define i32 @main() nounwind uwtable {
91 call void @check_vect()
92 %call = call i32 @main1(i32 2, i32 3)
96 define internal void @check_vect() nounwind uwtable noinline {
98 %a = alloca i32, align 4
99 %b = alloca i32, align 4
100 %c = alloca i32, align 4
101 %d = alloca i32, align 4
102 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
103 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
104 %tobool = icmp eq i32 %call1, 0
105 br i1 %tobool, label %if.then, label %lor.lhs.false
107 lor.lhs.false: ; preds = %entry
108 %tmp4 = load i32* %d, align 4
109 %and6 = and i32 %tmp4, 67108864
110 %cmp = icmp eq i32 %and6, 0
111 br i1 %cmp, label %if.then, label %if.end
113 if.then: ; preds = %entry, %lor.lhs.false
114 call void @exit(i32 0) noreturn nounwind
117 if.end: ; preds = %lor.lhs.false
118 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
122 declare void (i32)* @signal(i32, void (i32)*) nounwind
124 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
126 call void @exit(i32 0) noreturn nounwind
129 return: ; No predecessors!
133 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
135 %and = and i32 %__level, -2147483648
136 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
137 %cmp = icmp ult i32 %call, %__level
138 br i1 %cmp, label %if.then, label %if.end
140 if.then: ; preds = %entry
143 if.end: ; preds = %entry
144 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
145 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
146 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
147 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
148 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
149 store i32 %asmresult, i32* %__eax, align 4
150 store i32 %asmresult8, i32* %__ebx, align 4
151 store i32 %asmresult9, i32* %__ecx, align 4
152 store i32 %asmresult10, i32* %__edx, align 4
155 return: ; preds = %if.end, %if.then
156 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
160 declare void @exit(i32) noreturn
162 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
164 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
165 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
166 %tobool = icmp eq i32* %__sig, null
167 br i1 %tobool, label %if.end, label %if.then
169 if.then: ; preds = %entry
170 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
171 store i32 %asmresult1, i32* %__sig, align 4
174 if.end: ; preds = %entry, %if.then
178 !0 = metadata !{i32 -2147343169, i32 -2147343161}
179 !1 = metadata !{i32 -2147343292, i32 -2147343284}