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-14.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-14.s > bb-slp-14.ll
6 ; ModuleID = 'bb-slp-14.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 %add4 = add i32 %tmp1, 2
20 %tmp5 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
21 %add6 = add i32 %tmp5, 31
22 %mul = mul i32 %add, %x
23 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
24 %mul11 = mul i32 %add2, %y
25 store i32 %mul11, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
26 %mul14 = mul i32 %add4, %x
27 store i32 %mul14, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
28 %mul17 = mul i32 %add6, %y
29 store i32 %mul17, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
30 %tobool = icmp eq i32 %x, 0
31 br i1 %tobool, label %if.end, label %if.then
33 if.then: ; preds = %entry
34 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
37 if.end: ; preds = %entry, %if.then
38 %tmp19 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
39 %tmp20 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
40 %add21 = add i32 %tmp20, 23
41 %mul23 = mul i32 %add21, %x
42 %cmp = icmp eq i32 %tmp19, %mul23
43 br i1 %cmp, label %lor.lhs.false, label %if.then44
45 lor.lhs.false: ; preds = %if.end
46 %tmp24 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
47 %tmp25 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
48 %add26 = add i32 %tmp25, 142
49 %mul28 = mul i32 %add26, %y
50 %cmp29 = icmp eq i32 %tmp24, %mul28
51 br i1 %cmp29, label %lor.lhs.false30, label %if.then44
53 lor.lhs.false30: ; preds = %lor.lhs.false
54 %tmp31 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
55 %tmp32 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
56 %add33 = add i32 %tmp32, 2
57 %mul35 = mul i32 %add33, %x
58 %cmp36 = icmp eq i32 %tmp31, %mul35
59 br i1 %cmp36, label %lor.lhs.false37, label %if.then44
61 lor.lhs.false37: ; preds = %lor.lhs.false30
62 %tmp38 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
63 %tmp39 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
64 %add40 = add i32 %tmp39, 31
65 %mul42 = mul i32 %add40, %y
66 %cmp43 = icmp eq i32 %tmp38, %mul42
67 br i1 %cmp43, label %if.end45, label %if.then44
69 if.then44: ; preds = %lor.lhs.false37, %lor.lhs.false30, %lor.lhs.false, %if.end
70 call void @abort() noreturn nounwind
73 if.end45: ; preds = %lor.lhs.false37
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 557}
169 !1 = metadata !{i32 -2147343345, i32 -2147343337}
170 !2 = metadata !{i32 -2147343468, i32 -2147343460}