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-2.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer bb-slp-2.s > bb-slp-2.ll
6 ; ModuleID = 'bb-slp-2.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 [128 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, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 62, i32 63, 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, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 62, i32 63], align 16
11 @out = common global [128 x i32] zeroinitializer, align 16
13 define i32 @main1(i32 %dummy) nounwind uwtable noinline {
17 for.cond: ; preds = %for.inc, %entry
18 %indvar24 = phi i64 [ %indvar.next25, %for.inc ], [ 0, %entry ]
19 %tmp26 = mul i64 %indvar24, 4
20 %tmp28 = add i64 %tmp26, 3
21 %incdec.ptr11 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp28
22 %tmp29 = add i64 %tmp26, 2
23 %incdec.ptr6 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp29
24 %tmp30 = add i64 %tmp26, 1
25 %incdec.ptr = getelementptr [128 x i32]* @in, i64 0, i64 %tmp30
26 %pin.0 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp26
27 %incdec.ptr14 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp28
28 %incdec.ptr9 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp29
29 %incdec.ptr4 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp30
30 %pout.0 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp26
31 %exitcond = icmp ne i64 %indvar24, 32
32 br i1 %exitcond, label %for.body, label %for.end
34 for.body: ; preds = %for.cond
35 %tmp2 = load i32* %pin.0, align 4
36 store i32 %tmp2, i32* %pout.0, align 4
37 %tmp7 = load i32* %incdec.ptr, align 4
38 store i32 %tmp7, i32* %incdec.ptr4, align 4
39 %tmp12 = load i32* %incdec.ptr6, align 4
40 store i32 %tmp12, i32* %incdec.ptr9, align 4
41 %tmp17 = load i32* %incdec.ptr11, align 4
42 store i32 %tmp17, i32* %incdec.ptr14, align 4
43 %tobool = icmp eq i32 %dummy, 0
44 br i1 %tobool, label %if.end, label %if.then
46 if.then: ; preds = %for.body
47 call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
50 if.end: ; preds = %for.body, %if.then
53 for.inc: ; preds = %if.end
54 %indvar.next25 = add i64 %indvar24, 1
57 for.end: ; preds = %for.cond
60 for.cond22: ; preds = %for.inc132, %for.end
61 %indvar = phi i64 [ %indvar.next, %for.inc132 ], [ 0, %for.end ]
62 %tmp = mul i64 %indvar, 8
63 %tmp15 = add i64 %tmp, 7
64 %arrayidx127 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp15
65 %arrayidx121 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp15
66 %tmp16 = add i64 %tmp, 6
67 %arrayidx113 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp16
68 %arrayidx107 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp16
69 %tmp18 = add i64 %tmp, 5
70 %arrayidx99 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp18
71 %arrayidx93 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp18
72 %tmp19 = add i64 %tmp, 4
73 %arrayidx85 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp19
74 %arrayidx79 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp19
75 %tmp20 = add i64 %tmp, 3
76 %arrayidx71 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp20
77 %arrayidx65 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp20
78 %tmp21 = add i64 %tmp, 2
79 %arrayidx57 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp21
80 %arrayidx51 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp21
81 %tmp22 = add i64 %tmp, 1
82 %arrayidx43 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp22
83 %arrayidx37 = getelementptr [128 x i32]* @out, i64 0, i64 %tmp22
84 %arrayidx31 = getelementptr [128 x i32]* @in, i64 0, i64 %tmp
85 %arrayidx = getelementptr [128 x i32]* @out, i64 0, i64 %tmp
86 %i.1 = trunc i64 %indvar to i32
87 %cmp24 = icmp slt i32 %i.1, 16
88 br i1 %cmp24, label %for.body25, label %for.end135
90 for.body25: ; preds = %for.cond22
91 %tmp27 = load i32* %arrayidx, align 16
92 %tmp32 = load i32* %arrayidx31, align 16
93 %cmp33 = icmp eq i32 %tmp27, %tmp32
94 br i1 %cmp33, label %lor.lhs.false, label %if.then130
96 lor.lhs.false: ; preds = %for.body25
97 %tmp38 = load i32* %arrayidx37, align 4
98 %tmp44 = load i32* %arrayidx43, align 4
99 %cmp45 = icmp eq i32 %tmp38, %tmp44
100 br i1 %cmp45, label %lor.lhs.false46, label %if.then130
102 lor.lhs.false46: ; preds = %lor.lhs.false
103 %tmp52 = load i32* %arrayidx51, align 8
104 %tmp58 = load i32* %arrayidx57, align 8
105 %cmp59 = icmp eq i32 %tmp52, %tmp58
106 br i1 %cmp59, label %lor.lhs.false60, label %if.then130
108 lor.lhs.false60: ; preds = %lor.lhs.false46
109 %tmp66 = load i32* %arrayidx65, align 4
110 %tmp72 = load i32* %arrayidx71, align 4
111 %cmp73 = icmp eq i32 %tmp66, %tmp72
112 br i1 %cmp73, label %lor.lhs.false74, label %if.then130
114 lor.lhs.false74: ; preds = %lor.lhs.false60
115 %tmp80 = load i32* %arrayidx79, align 16
116 %tmp86 = load i32* %arrayidx85, align 16
117 %cmp87 = icmp eq i32 %tmp80, %tmp86
118 br i1 %cmp87, label %lor.lhs.false88, label %if.then130
120 lor.lhs.false88: ; preds = %lor.lhs.false74
121 %tmp94 = load i32* %arrayidx93, align 4
122 %tmp100 = load i32* %arrayidx99, align 4
123 %cmp101 = icmp eq i32 %tmp94, %tmp100
124 br i1 %cmp101, label %lor.lhs.false102, label %if.then130
126 lor.lhs.false102: ; preds = %lor.lhs.false88
127 %tmp108 = load i32* %arrayidx107, align 8
128 %tmp114 = load i32* %arrayidx113, align 8
129 %cmp115 = icmp eq i32 %tmp108, %tmp114
130 br i1 %cmp115, label %lor.lhs.false116, label %if.then130
132 lor.lhs.false116: ; preds = %lor.lhs.false102
133 %tmp122 = load i32* %arrayidx121, align 4
134 %tmp128 = load i32* %arrayidx127, align 4
135 %cmp129 = icmp eq i32 %tmp122, %tmp128
136 br i1 %cmp129, label %if.end131, label %if.then130
138 if.then130: ; preds = %lor.lhs.false116, %lor.lhs.false102, %lor.lhs.false88, %lor.lhs.false74, %lor.lhs.false60, %lor.lhs.false46, %lor.lhs.false, %for.body25
139 call void @abort() noreturn nounwind
142 if.end131: ; preds = %lor.lhs.false116
145 for.inc132: ; preds = %if.end131
146 %indvar.next = add i64 %indvar, 1
149 for.end135: ; preds = %for.cond22
153 declare void @abort() noreturn
155 define i32 @main() nounwind uwtable {
157 call void @check_vect()
158 %call = call i32 @main1(i32 33)
162 define internal void @check_vect() nounwind uwtable noinline {
164 %a = alloca i32, align 4
165 %b = alloca i32, align 4
166 %c = alloca i32, align 4
167 %d = alloca i32, align 4
168 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
169 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
170 %tobool = icmp eq i32 %call1, 0
171 br i1 %tobool, label %if.then, label %lor.lhs.false
173 lor.lhs.false: ; preds = %entry
174 %tmp4 = load i32* %d, align 4
175 %and6 = and i32 %tmp4, 67108864
176 %cmp = icmp eq i32 %and6, 0
177 br i1 %cmp, label %if.then, label %if.end
179 if.then: ; preds = %entry, %lor.lhs.false
180 call void @exit(i32 0) noreturn nounwind
183 if.end: ; preds = %lor.lhs.false
184 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
188 declare void (i32)* @signal(i32, void (i32)*) nounwind
190 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
192 call void @exit(i32 0) noreturn nounwind
195 return: ; No predecessors!
199 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
201 %and = and i32 %__level, -2147483648
202 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
203 %cmp = icmp ult i32 %call, %__level
204 br i1 %cmp, label %if.then, label %if.end
206 if.then: ; preds = %entry
209 if.end: ; preds = %entry
210 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !1
211 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
212 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
213 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
214 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
215 store i32 %asmresult, i32* %__eax, align 4
216 store i32 %asmresult8, i32* %__ebx, align 4
217 store i32 %asmresult9, i32* %__ecx, align 4
218 store i32 %asmresult10, i32* %__edx, align 4
221 return: ; preds = %if.end, %if.then
222 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
226 declare void @exit(i32) noreturn
228 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
230 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !2
231 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
232 %tobool = icmp eq i32* %__sig, null
233 br i1 %tobool, label %if.end, label %if.then
235 if.then: ; preds = %entry
236 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
237 store i32 %asmresult1, i32* %__sig, align 4
240 if.end: ; preds = %entry, %if.then
244 !0 = metadata !{i32 861}
245 !1 = metadata !{i32 -2147342831, i32 -2147342823}
246 !2 = metadata !{i32 -2147342954, i32 -2147342946}