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-12c.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-12c.s > slp-12c.ll
6 ; ModuleID = 'slp-12c.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 @main1.in = internal unnamed_addr constant [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
12 define i32 @main1() nounwind uwtable {
14 %out = alloca [64 x i32], align 16
15 %in = alloca [64 x i32], align 16
16 %ia = alloca [16 x i32], align 16
17 %tmp = bitcast [64 x i32]* %in to i8*
18 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* bitcast ([64 x i32]* @main1.in to i8*), i64 256, i32 16, i1 false)
21 for.cond: ; preds = %for.inc, %entry
22 %indvar27 = phi i64 [ %indvar.next28, %for.inc ], [ 0, %entry ]
23 %tmp29 = mul i64 %indvar27, 4
24 %tmp30 = add i64 %tmp29, 3
25 %arrayidx48 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp30
26 %arrayidx40 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp30
27 %tmp31 = add i64 %tmp29, 2
28 %arrayidx35 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp31
29 %arrayidx27 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp31
30 %tmp32 = add i64 %tmp29, 1
31 %arrayidx22 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp32
32 %arrayidx14 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp32
33 %arrayidx9 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp29
34 %arrayidx = getelementptr [64 x i32]* %in, i64 0, i64 %tmp29
35 %arrayidx51 = getelementptr [16 x i32]* %ia, i64 0, i64 %indvar27
36 %exitcond = icmp ne i64 %indvar27, 16
37 br i1 %exitcond, label %for.body, label %for.end
39 for.body: ; preds = %for.cond
40 %tmp4 = load i32* %arrayidx, align 16
41 %tmp12 = mul i32 %tmp4, 3
42 %mul5 = add i32 %tmp12, 6
43 store i32 %mul5, i32* %arrayidx9, align 16
44 %tmp15 = load i32* %arrayidx14, align 4
45 %tmp14 = mul i32 %tmp15, 7
46 %mul17 = add i32 %tmp14, 14
47 store i32 %mul17, i32* %arrayidx22, align 4
48 %tmp28 = load i32* %arrayidx27, align 8
49 %tmp17 = mul i32 %tmp28, 3
50 %mul30 = add i32 %tmp17, 21
51 store i32 %mul30, i32* %arrayidx35, align 8
52 %tmp41 = load i32* %arrayidx40, align 4
53 %tmp20 = mul i32 %tmp41, 7
54 %mul43 = add i32 %tmp20, 49
55 store i32 %mul43, i32* %arrayidx48, align 4
56 store i32 7, i32* %arrayidx51, align 4
59 for.inc: ; preds = %for.body
60 %indvar.next28 = add i64 %indvar27, 1
63 for.end: ; preds = %for.cond
66 for.cond53: ; preds = %for.inc123, %for.end
67 %indvar = phi i64 [ %indvar.next, %for.inc123 ], [ 0, %for.end ]
68 %tmp22 = mul i64 %indvar, 4
69 %tmp23 = add i64 %tmp22, 3
70 %arrayidx112 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp23
71 %arrayidx106 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp23
72 %tmp24 = add i64 %tmp22, 2
73 %arrayidx96 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp24
74 %arrayidx90 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp24
75 %tmp25 = add i64 %tmp22, 1
76 %arrayidx80 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp25
77 %arrayidx74 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp25
78 %arrayidx65 = getelementptr [64 x i32]* %in, i64 0, i64 %tmp22
79 %arrayidx60 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp22
80 %arrayidx120 = getelementptr [16 x i32]* %ia, i64 0, i64 %indvar
81 %i.1 = trunc i64 %indvar to i32
82 %cmp55 = icmp slt i32 %i.1, 16
83 br i1 %cmp55, label %for.body56, label %for.end126
85 for.body56: ; preds = %for.cond53
86 %tmp61 = load i32* %arrayidx60, align 16
87 %tmp66 = load i32* %arrayidx65, align 16
88 %tmp1 = mul i32 %tmp66, 3
89 %mul68 = add i32 %tmp1, 6
90 %cmp69 = icmp eq i32 %tmp61, %mul68
91 br i1 %cmp69, label %lor.lhs.false, label %if.then
93 lor.lhs.false: ; preds = %for.body56
94 %tmp75 = load i32* %arrayidx74, align 4
95 %tmp81 = load i32* %arrayidx80, align 4
96 %tmp5 = mul i32 %tmp81, 7
97 %mul83 = add i32 %tmp5, 14
98 %cmp84 = icmp eq i32 %tmp75, %mul83
99 br i1 %cmp84, label %lor.lhs.false85, label %if.then
101 lor.lhs.false85: ; preds = %lor.lhs.false
102 %tmp91 = load i32* %arrayidx90, align 8
103 %tmp97 = load i32* %arrayidx96, align 8
104 %tmp8 = mul i32 %tmp97, 3
105 %mul99 = add i32 %tmp8, 21
106 %cmp100 = icmp eq i32 %tmp91, %mul99
107 br i1 %cmp100, label %lor.lhs.false101, label %if.then
109 lor.lhs.false101: ; preds = %lor.lhs.false85
110 %tmp107 = load i32* %arrayidx106, align 4
111 %tmp113 = load i32* %arrayidx112, align 4
112 %tmp11 = mul i32 %tmp113, 7
113 %mul115 = add i32 %tmp11, 49
114 %cmp116 = icmp eq i32 %tmp107, %mul115
115 br i1 %cmp116, label %lor.lhs.false117, label %if.then
117 lor.lhs.false117: ; preds = %lor.lhs.false101
118 %tmp121 = load i32* %arrayidx120, align 4
119 %cmp122 = icmp eq i32 %tmp121, 7
120 br i1 %cmp122, label %if.end, label %if.then
122 if.then: ; preds = %lor.lhs.false117, %lor.lhs.false101, %lor.lhs.false85, %lor.lhs.false, %for.body56
123 call void @abort() noreturn nounwind
126 if.end: ; preds = %lor.lhs.false117
129 for.inc123: ; preds = %if.end
130 %indvar.next = add i64 %indvar, 1
133 for.end126: ; preds = %for.cond53
137 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
139 declare void @abort() noreturn
141 define i32 @main() nounwind uwtable {
143 call void @check_vect()
144 %call = call i32 @main1()
148 define internal void @check_vect() nounwind uwtable noinline {
150 %a = alloca i32, align 4
151 %b = alloca i32, align 4
152 %c = alloca i32, align 4
153 %d = alloca i32, align 4
154 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
155 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
156 %tobool = icmp eq i32 %call1, 0
157 br i1 %tobool, label %if.then, label %lor.lhs.false
159 lor.lhs.false: ; preds = %entry
160 %tmp4 = load i32* %d, align 4
161 %and6 = and i32 %tmp4, 67108864
162 %cmp = icmp eq i32 %and6, 0
163 br i1 %cmp, label %if.then, label %if.end
165 if.then: ; preds = %entry, %lor.lhs.false
166 call void @exit(i32 0) noreturn nounwind
169 if.end: ; preds = %lor.lhs.false
170 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
174 declare void (i32)* @signal(i32, void (i32)*) nounwind
176 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
178 call void @exit(i32 0) noreturn nounwind
181 return: ; No predecessors!
185 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
187 %and = and i32 %__level, -2147483648
188 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
189 %cmp = icmp ult i32 %call, %__level
190 br i1 %cmp, label %if.then, label %if.end
192 if.then: ; preds = %entry
195 if.end: ; preds = %entry
196 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
197 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
198 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
199 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
200 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
201 store i32 %asmresult, i32* %__eax, align 4
202 store i32 %asmresult8, i32* %__ebx, align 4
203 store i32 %asmresult9, i32* %__ecx, align 4
204 store i32 %asmresult10, i32* %__edx, align 4
207 return: ; preds = %if.end, %if.then
208 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
212 declare void @exit(i32) noreturn
214 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
216 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
217 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
218 %tobool = icmp eq i32* %__sig, null
219 br i1 %tobool, label %if.end, label %if.then
221 if.then: ; preds = %entry
222 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
223 store i32 %asmresult1, i32* %__sig, align 4
226 if.end: ; preds = %entry, %if.then
230 !0 = metadata !{i32 -2147342785, i32 -2147342777}
231 !1 = metadata !{i32 -2147342908, i32 -2147342900}