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 slp-multitypes-6.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-multitypes-6.s > slp-multitypes-6.ll
6 ; ModuleID = 'slp-multitypes-6.s'
8 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"
9 target triple = "x86_64-unknown-linux-gnu"
11 @in = global [64 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], align 16
13 define i32 @main1() nounwind uwtable noinline {
15 %out = alloca [64 x i8], align 16
18 for.cond: ; preds = %for.inc, %entry
19 %indvar38 = phi i64 [ %indvar.next39, %for.inc ], [ 0, %entry ]
20 %tmp40 = mul i64 %indvar38, 8
21 %tmp41 = add i64 %tmp40, 7
22 %arrayidx113 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp41
23 %arrayidx103 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp41
24 %tmp42 = add i64 %tmp40, 6
25 %arrayidx98 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp42
26 %arrayidx88 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp42
27 %tmp43 = add i64 %tmp40, 5
28 %arrayidx83 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp43
29 %arrayidx73 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp43
30 %tmp45 = add i64 %tmp40, 4
31 %arrayidx68 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp45
32 %arrayidx58 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp45
33 %tmp46 = add i64 %tmp40, 3
34 %arrayidx53 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp46
35 %arrayidx43 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp46
36 %tmp47 = add i64 %tmp40, 2
37 %arrayidx38 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp47
38 %arrayidx28 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp47
39 %tmp48 = add i64 %tmp40, 1
40 %arrayidx23 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp48
41 %arrayidx13 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp48
42 %arrayidx8 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp40
43 %arrayidx = getelementptr [64 x i32]* @in, i64 0, i64 %tmp40
44 %exitcond = icmp ne i64 %indvar38, 8
45 br i1 %exitcond, label %for.body, label %for.end
47 for.body: ; preds = %for.cond
48 %tmp2 = load i32* %arrayidx, align 16
49 %add = add nsw i32 %tmp2, 1
50 %conv4 = trunc i32 %add to i8
51 store i8 %conv4, i8* %arrayidx8, align 8
52 %tmp14 = load i32* %arrayidx13, align 4
53 %add17 = add nsw i32 %tmp14, 2
54 %conv18 = trunc i32 %add17 to i8
55 store i8 %conv18, i8* %arrayidx23, align 1
56 %tmp29 = load i32* %arrayidx28, align 8
57 %add32 = add nsw i32 %tmp29, 3
58 %conv33 = trunc i32 %add32 to i8
59 store i8 %conv33, i8* %arrayidx38, align 2
60 %tmp44 = load i32* %arrayidx43, align 4
61 %add47 = add nsw i32 %tmp44, 4
62 %conv48 = trunc i32 %add47 to i8
63 store i8 %conv48, i8* %arrayidx53, align 1
64 %tmp59 = load i32* %arrayidx58, align 16
65 %add62 = add nsw i32 %tmp59, 5
66 %conv63 = trunc i32 %add62 to i8
67 store i8 %conv63, i8* %arrayidx68, align 4
68 %tmp74 = load i32* %arrayidx73, align 4
69 %add77 = add nsw i32 %tmp74, 6
70 %conv78 = trunc i32 %add77 to i8
71 store i8 %conv78, i8* %arrayidx83, align 1
72 %tmp89 = load i32* %arrayidx88, align 8
73 %add92 = add nsw i32 %tmp89, 7
74 %conv93 = trunc i32 %add92 to i8
75 store i8 %conv93, i8* %arrayidx98, align 2
76 %tmp104 = load i32* %arrayidx103, align 4
77 %add107 = add nsw i32 %tmp104, 8
78 %conv108 = trunc i32 %add107 to i8
79 store i8 %conv108, i8* %arrayidx113, align 1
82 for.inc: ; preds = %for.body
83 %indvar.next39 = add i64 %indvar38, 1
86 for.end: ; preds = %for.cond
89 for.cond115: ; preds = %for.inc268, %for.end
90 %indvar = phi i64 [ %indvar.next, %for.inc268 ], [ 0, %for.end ]
91 %tmp = mul i64 %indvar, 8
92 %tmp30 = add i64 %tmp, 7
93 %arrayidx261 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp30
94 %arrayidx254 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp30
95 %tmp31 = add i64 %tmp, 6
96 %arrayidx242 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp31
97 %arrayidx235 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp31
98 %tmp32 = add i64 %tmp, 5
99 %arrayidx223 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp32
100 %arrayidx216 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp32
101 %tmp33 = add i64 %tmp, 4
102 %arrayidx204 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp33
103 %arrayidx197 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp33
104 %tmp34 = add i64 %tmp, 3
105 %arrayidx185 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp34
106 %arrayidx178 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp34
107 %tmp35 = add i64 %tmp, 2
108 %arrayidx166 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp35
109 %arrayidx159 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp35
110 %tmp36 = add i64 %tmp, 1
111 %arrayidx147 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp36
112 %arrayidx140 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp36
113 %arrayidx129 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp
114 %arrayidx123 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp
115 %i.1 = trunc i64 %indvar to i32
116 %cmp117 = icmp slt i32 %i.1, 8
117 br i1 %cmp117, label %for.body119, label %for.end271
119 for.body119: ; preds = %for.cond115
120 %tmp124 = load i8* %arrayidx123, align 8
121 %conv125 = zext i8 %tmp124 to i32
122 %tmp130 = load i32* %arrayidx129, align 16
123 %conv132 = and i32 %tmp130, 255
124 %add133 = add nsw i32 %conv132, 1
125 %cmp134 = icmp eq i32 %conv125, %add133
126 br i1 %cmp134, label %lor.lhs.false, label %if.then
128 lor.lhs.false: ; preds = %for.body119
129 %tmp141 = load i8* %arrayidx140, align 1
130 %conv142 = zext i8 %tmp141 to i32
131 %tmp148 = load i32* %arrayidx147, align 4
132 %conv150 = and i32 %tmp148, 255
133 %add151 = add nsw i32 %conv150, 2
134 %cmp152 = icmp eq i32 %conv142, %add151
135 br i1 %cmp152, label %lor.lhs.false154, label %if.then
137 lor.lhs.false154: ; preds = %lor.lhs.false
138 %tmp160 = load i8* %arrayidx159, align 2
139 %conv161 = zext i8 %tmp160 to i32
140 %tmp167 = load i32* %arrayidx166, align 8
141 %conv169 = and i32 %tmp167, 255
142 %add170 = add nsw i32 %conv169, 3
143 %cmp171 = icmp eq i32 %conv161, %add170
144 br i1 %cmp171, label %lor.lhs.false173, label %if.then
146 lor.lhs.false173: ; preds = %lor.lhs.false154
147 %tmp179 = load i8* %arrayidx178, align 1
148 %conv180 = zext i8 %tmp179 to i32
149 %tmp186 = load i32* %arrayidx185, align 4
150 %conv188 = and i32 %tmp186, 255
151 %add189 = add nsw i32 %conv188, 4
152 %cmp190 = icmp eq i32 %conv180, %add189
153 br i1 %cmp190, label %lor.lhs.false192, label %if.then
155 lor.lhs.false192: ; preds = %lor.lhs.false173
156 %tmp198 = load i8* %arrayidx197, align 4
157 %conv199 = zext i8 %tmp198 to i32
158 %tmp205 = load i32* %arrayidx204, align 16
159 %conv207 = and i32 %tmp205, 255
160 %add208 = add nsw i32 %conv207, 5
161 %cmp209 = icmp eq i32 %conv199, %add208
162 br i1 %cmp209, label %lor.lhs.false211, label %if.then
164 lor.lhs.false211: ; preds = %lor.lhs.false192
165 %tmp217 = load i8* %arrayidx216, align 1
166 %conv218 = zext i8 %tmp217 to i32
167 %tmp224 = load i32* %arrayidx223, align 4
168 %conv226 = and i32 %tmp224, 255
169 %add227 = add nsw i32 %conv226, 6
170 %cmp228 = icmp eq i32 %conv218, %add227
171 br i1 %cmp228, label %lor.lhs.false230, label %if.then
173 lor.lhs.false230: ; preds = %lor.lhs.false211
174 %tmp236 = load i8* %arrayidx235, align 2
175 %conv237 = zext i8 %tmp236 to i32
176 %tmp243 = load i32* %arrayidx242, align 8
177 %conv245 = and i32 %tmp243, 255
178 %add246 = add nsw i32 %conv245, 7
179 %cmp247 = icmp eq i32 %conv237, %add246
180 br i1 %cmp247, label %lor.lhs.false249, label %if.then
182 lor.lhs.false249: ; preds = %lor.lhs.false230
183 %tmp255 = load i8* %arrayidx254, align 1
184 %conv256 = zext i8 %tmp255 to i32
185 %tmp262 = load i32* %arrayidx261, align 4
186 %conv264 = and i32 %tmp262, 255
187 %add265 = add nsw i32 %conv264, 8
188 %cmp266 = icmp eq i32 %conv256, %add265
189 br i1 %cmp266, label %if.end, label %if.then
191 if.then: ; preds = %lor.lhs.false249, %lor.lhs.false230, %lor.lhs.false211, %lor.lhs.false192, %lor.lhs.false173, %lor.lhs.false154, %lor.lhs.false, %for.body119
192 call void @abort() noreturn nounwind
195 if.end: ; preds = %lor.lhs.false249
198 for.inc268: ; preds = %if.end
199 %indvar.next = add i64 %indvar, 1
200 br label %for.cond115
202 for.end271: ; preds = %for.cond115
206 declare void @abort() noreturn
208 define i32 @main() nounwind uwtable {
210 call void @check_vect()
211 %call = call i32 @main1()
215 define internal void @check_vect() nounwind uwtable noinline {
217 %a = alloca i32, align 4
218 %b = alloca i32, align 4
219 %c = alloca i32, align 4
220 %d = alloca i32, align 4
221 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
222 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
223 %tobool = icmp eq i32 %call1, 0
224 br i1 %tobool, label %if.then, label %lor.lhs.false
226 lor.lhs.false: ; preds = %entry
227 %tmp4 = load i32* %d, align 4
228 %and6 = and i32 %tmp4, 67108864
229 %cmp = icmp eq i32 %and6, 0
230 br i1 %cmp, label %if.then, label %if.end
232 if.then: ; preds = %entry, %lor.lhs.false
233 call void @exit(i32 0) noreturn nounwind
236 if.end: ; preds = %lor.lhs.false
237 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
241 declare void (i32)* @signal(i32, void (i32)*) nounwind
243 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
245 call void @exit(i32 0) noreturn nounwind
248 return: ; No predecessors!
252 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
254 %and = and i32 %__level, -2147483648
255 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
256 %cmp = icmp ult i32 %call, %__level
257 br i1 %cmp, label %if.then, label %if.end
259 if.then: ; preds = %entry
262 if.end: ; preds = %entry
263 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
264 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
265 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
266 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
267 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
268 store i32 %asmresult, i32* %__eax, align 4
269 store i32 %asmresult8, i32* %__ebx, align 4
270 store i32 %asmresult9, i32* %__ecx, align 4
271 store i32 %asmresult10, i32* %__edx, align 4
274 return: ; preds = %if.end, %if.then
275 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
279 declare void @exit(i32) noreturn
281 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
283 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
284 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
285 %tobool = icmp eq i32* %__sig, null
286 br i1 %tobool, label %if.end, label %if.then
288 if.then: ; preds = %entry
289 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
290 store i32 %asmresult1, i32* %__sig, align 4
293 if.end: ; preds = %entry, %if.then
297 !0 = metadata !{i32 -2147342577, i32 -2147342569}
298 !1 = metadata !{i32 -2147342700, i32 -2147342692}