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-21.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-21.s > bb-slp-21.ll
6 ; ModuleID = 'bb-slp-21.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 store i32 %add10, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 2), align 8
40 store i32 %add12, i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 3), align 4
41 %mul = mul i32 %add6, %x.addr.0
42 store i32 %mul, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
43 %mul21 = mul i32 %add8, %y.addr.0
44 store i32 %mul21, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
45 %mul24 = mul i32 %add10, %x.addr.0
46 store i32 %mul24, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
47 %mul27 = mul i32 %add12, %y.addr.0
48 store i32 %mul27, i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
49 %tobool = icmp eq i32 %x.addr.0, 0
50 br i1 %tobool, label %if.end30, label %if.then29
52 if.then29: ; preds = %if.end
53 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
56 if.end30: ; preds = %if.end, %if.then29
57 %tmp31 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 0), align 16
58 %tmp32 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
59 %add33 = add i32 %tmp32, 23
60 %mul35 = mul i32 %add33, %x.addr.0
61 %cmp36 = icmp eq i32 %tmp31, %mul35
62 br i1 %cmp36, label %lor.lhs.false, label %if.then77
64 lor.lhs.false: ; preds = %if.end30
65 %tmp37 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 1), align 4
66 %tmp38 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
67 %add39 = add i32 %tmp38, 142
68 %mul41 = mul i32 %add39, %y.addr.0
69 %cmp42 = icmp eq i32 %tmp37, %mul41
70 br i1 %cmp42, label %lor.lhs.false43, label %if.then77
72 lor.lhs.false43: ; preds = %lor.lhs.false
73 %tmp44 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 2), align 8
74 %tmp45 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
75 %add46 = add i32 %tmp45, 2
76 %mul48 = mul i32 %add46, %x.addr.0
77 %cmp49 = icmp eq i32 %tmp44, %mul48
78 br i1 %cmp49, label %lor.lhs.false50, label %if.then77
80 lor.lhs.false50: ; preds = %lor.lhs.false43
81 %tmp51 = load i32* getelementptr inbounds ([16 x i32]* @out, i64 0, i64 3), align 4
82 %tmp52 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
83 %add53 = add i32 %tmp52, 31
84 %mul55 = mul i32 %add53, %y.addr.0
85 %cmp56 = icmp eq i32 %tmp51, %mul55
86 br i1 %cmp56, label %lor.lhs.false57, label %if.then77
88 lor.lhs.false57: ; preds = %lor.lhs.false50
89 %tmp58 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 0), align 16
90 %tmp59 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 0), align 16
91 %add60 = add i32 %tmp59, 23
92 %cmp61 = icmp eq i32 %tmp58, %add60
93 br i1 %cmp61, label %lor.lhs.false62, label %if.then77
95 lor.lhs.false62: ; preds = %lor.lhs.false57
96 %tmp63 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 1), align 4
97 %tmp64 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 1), align 4
98 %add65 = add i32 %tmp64, 142
99 %cmp66 = icmp eq i32 %tmp63, %add65
100 br i1 %cmp66, label %lor.lhs.false67, label %if.then77
102 lor.lhs.false67: ; preds = %lor.lhs.false62
103 %tmp68 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 2), align 8
104 %tmp69 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 2), align 8
105 %add70 = add i32 %tmp69, 2
106 %cmp71 = icmp eq i32 %tmp68, %add70
107 br i1 %cmp71, label %lor.lhs.false72, label %if.then77
109 lor.lhs.false72: ; preds = %lor.lhs.false67
110 %tmp73 = load i32* getelementptr inbounds ([16 x i32]* @b, i64 0, i64 3), align 4
111 %tmp74 = load i32* getelementptr inbounds ([16 x i32]* @in, i64 0, i64 3), align 4
112 %add75 = add i32 %tmp74, 31
113 %cmp76 = icmp eq i32 %tmp73, %add75
114 br i1 %cmp76, label %if.end78, label %if.then77
116 if.then77: ; preds = %lor.lhs.false72, %lor.lhs.false67, %lor.lhs.false62, %lor.lhs.false57, %lor.lhs.false50, %lor.lhs.false43, %lor.lhs.false, %if.end30
117 call void @abort() noreturn nounwind
120 if.end78: ; preds = %lor.lhs.false72
124 declare void @abort() noreturn
126 define i32 @main() nounwind uwtable {
128 call void @check_vect()
129 %call = call i32 @main1(i32 2, i32 3)
133 define internal void @check_vect() nounwind uwtable noinline {
135 %a = alloca i32, align 4
136 %b = alloca i32, align 4
137 %c = alloca i32, align 4
138 %d = alloca i32, align 4
139 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
140 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
141 %tobool = icmp eq i32 %call1, 0
142 br i1 %tobool, label %if.then, label %lor.lhs.false
144 lor.lhs.false: ; preds = %entry
145 %tmp4 = load i32* %d, align 4
146 %and6 = and i32 %tmp4, 67108864
147 %cmp = icmp eq i32 %and6, 0
148 br i1 %cmp, label %if.then, label %if.end
150 if.then: ; preds = %entry, %lor.lhs.false
151 call void @exit(i32 0) noreturn nounwind
154 if.end: ; preds = %lor.lhs.false
155 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
159 declare void (i32)* @signal(i32, void (i32)*) nounwind
161 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
163 call void @exit(i32 0) noreturn nounwind
166 return: ; No predecessors!
170 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
172 %and = and i32 %__level, -2147483648
173 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
174 %cmp = icmp ult i32 %call, %__level
175 br i1 %cmp, label %if.then, label %if.end
177 if.then: ; preds = %entry
180 if.end: ; preds = %entry
181 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
182 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
183 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
184 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
185 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
186 store i32 %asmresult, i32* %__eax, align 4
187 store i32 %asmresult8, i32* %__ebx, align 4
188 store i32 %asmresult9, i32* %__ecx, align 4
189 store i32 %asmresult10, i32* %__edx, align 4
192 return: ; preds = %if.end, %if.then
193 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
197 declare void @exit(i32) noreturn
199 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
201 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
202 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
203 %tobool = icmp eq i32* %__sig, null
204 br i1 %tobool, label %if.end, label %if.then
206 if.then: ; preds = %entry
207 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
208 store i32 %asmresult1, i32* %__sig, align 4
211 if.end: ; preds = %entry, %if.then
215 !0 = metadata !{i32 660}
216 !1 = metadata !{i32 -2147342892, i32 -2147342884}
217 !2 = metadata !{i32 -2147343015, i32 -2147343007}