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-17.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-17.s > bb-slp-17.ll
6 ; ModuleID = 'bb-slp-17.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 %cmp = icmp ugt i32 %x, %y
17 br i1 %cmp, label %if.then, label %if.else
19 if.then: ; preds = %entry
23 if.else: ; preds = %entry
26 if.end: ; preds = %if.else, %if.then
27 %y.addr.0 = phi i32 [ %y, %if.then ], [ %x, %if.else ]
28 %x.addr.0 = phi i32 [ %add, %if.then ], [ %x, %if.else ]
29 %tmp5 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
30 %add6 = add i32 %tmp5, 23
31 %tmp7 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
32 %add8 = add i32 %tmp7, 142
33 %tmp9 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
34 %add10 = add i32 %tmp9, 2
35 %tmp11 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
36 %add12 = add i32 %tmp11, 31
37 store i32 %add6, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 0), align 16
38 store i32 %add8, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 1), align 4
39 %mul = mul i32 %add6, %x.addr.0
40 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
41 %mul19 = mul i32 %add8, %y.addr.0
42 store i32 %mul19, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
43 %mul22 = mul i32 %add10, %x.addr.0
44 store i32 %mul22, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
45 %mul25 = mul i32 %add12, %y.addr.0
46 store i32 %mul25, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
47 %tobool = icmp eq i32 %x.addr.0, 0
48 br i1 %tobool, label %if.end28, label %if.then27
50 if.then27: ; preds = %if.end
51 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
54 if.end28: ; preds = %if.end, %if.then27
55 %tmp29 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
56 %tmp30 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
57 %add31 = add i32 %tmp30, 23
58 %mul33 = mul i32 %add31, %x.addr.0
59 %cmp34 = icmp eq i32 %tmp29, %mul33
60 br i1 %cmp34, label %lor.lhs.false, label %if.then65
62 lor.lhs.false: ; preds = %if.end28
63 %tmp35 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
64 %tmp36 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
65 %add37 = add i32 %tmp36, 142
66 %mul39 = mul i32 %add37, %y.addr.0
67 %cmp40 = icmp eq i32 %tmp35, %mul39
68 br i1 %cmp40, label %lor.lhs.false41, label %if.then65
70 lor.lhs.false41: ; preds = %lor.lhs.false
71 %tmp42 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
72 %tmp43 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
73 %add44 = add i32 %tmp43, 2
74 %mul46 = mul i32 %add44, %x.addr.0
75 %cmp47 = icmp eq i32 %tmp42, %mul46
76 br i1 %cmp47, label %lor.lhs.false48, label %if.then65
78 lor.lhs.false48: ; preds = %lor.lhs.false41
79 %tmp49 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
80 %tmp50 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
81 %add51 = add i32 %tmp50, 31
82 %mul53 = mul i32 %add51, %y.addr.0
83 %cmp54 = icmp eq i32 %tmp49, %mul53
84 br i1 %cmp54, label %lor.lhs.false55, label %if.then65
86 lor.lhs.false55: ; preds = %lor.lhs.false48
87 %tmp56 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 0), align 16
88 %tmp57 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
89 %add58 = add i32 %tmp57, 23
90 %cmp59 = icmp eq i32 %tmp56, %add58
91 br i1 %cmp59, label %lor.lhs.false60, label %if.then65
93 lor.lhs.false60: ; preds = %lor.lhs.false55
94 %tmp61 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 1), align 4
95 %tmp62 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
96 %add63 = add i32 %tmp62, 142
97 %cmp64 = icmp eq i32 %tmp61, %add63
98 br i1 %cmp64, label %if.end66, label %if.then65
100 if.then65: ; preds = %lor.lhs.false60, %lor.lhs.false55, %lor.lhs.false48, %lor.lhs.false41, %lor.lhs.false, %if.end28
101 call void @abort() noreturn nounwind
104 if.end66: ; preds = %lor.lhs.false60
108 declare void @abort() noreturn
110 define i32 @main() nounwind uwtable {
112 call void @check_vect()
113 %call = call i32 @main1(i32 2, i32 3)
117 define internal void @check_vect() nounwind uwtable noinline {
119 %a = alloca i32, align 4
120 %b = alloca i32, align 4
121 %c = alloca i32, align 4
122 %d = alloca i32, align 4
123 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
124 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
125 %tobool = icmp eq i32 %call1, 0
126 br i1 %tobool, label %if.then, label %lor.lhs.false
128 lor.lhs.false: ; preds = %entry
129 %tmp4 = load i32* %d, align 4
130 %and6 = and i32 %tmp4, 67108864
131 %cmp = icmp eq i32 %and6, 0
132 br i1 %cmp, label %if.then, label %if.end
134 if.then: ; preds = %entry, %lor.lhs.false
135 call void @exit(i32 0) noreturn nounwind
138 if.end: ; preds = %lor.lhs.false
139 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
143 declare void (i32)* @signal(i32, void (i32)*) nounwind
145 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
147 call void @exit(i32 0) noreturn nounwind
150 return: ; No predecessors!
154 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
156 %and = and i32 %__level, -2147483648
157 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
158 %cmp = icmp ult i32 %call, %__level
159 br i1 %cmp, label %if.then, label %if.end
161 if.then: ; preds = %entry
164 if.end: ; preds = %entry
165 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
166 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
167 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
168 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
169 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
170 store i32 %asmresult, i32* %__eax, align 4
171 store i32 %asmresult8, i32* %__ebx, align 4
172 store i32 %asmresult9, i32* %__ecx, align 4
173 store i32 %asmresult10, i32* %__edx, align 4
176 return: ; preds = %if.end, %if.then
177 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
181 declare void @exit(i32) noreturn
183 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
185 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
186 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
187 %tobool = icmp eq i32* %__sig, null
188 br i1 %tobool, label %if.end, label %if.then
190 if.then: ; preds = %entry
191 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
192 store i32 %asmresult1, i32* %__sig, align 4
195 if.end: ; preds = %entry, %if.then
199 !0 = metadata !{i32 586}
200 !1 = metadata !{i32 -2147343235, i32 -2147343227}
201 !2 = metadata !{i32 -2147343358, i32 -2147343350}