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-19b.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-19b.s > slp-19b.ll
6 ; ModuleID = 'slp-19b.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 [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
12 define i32 @main1() nounwind uwtable {
14 %out = alloca [128 x i32], align 16
15 %in = alloca [128 x i32], align 16
16 %ia = alloca [32 x i32], align 16
17 %tmp = bitcast [128 x i32]* %in to i8*
18 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* bitcast ([128 x i32]* @main1.in to i8*), i64 512, i32 16, i1 false)
21 for.cond: ; preds = %for.inc, %entry
22 %indvar20 = phi i64 [ %indvar.next21, %for.inc ], [ 0, %entry ]
23 %tmp22 = mul i64 %indvar20, 4
24 %tmp23 = add i64 %tmp22, 3
25 %arrayidx52 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp23
26 %tmp24 = add i64 %tmp22, 2
27 %arrayidx46 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp24
28 %tmp25 = add i64 %tmp22, 1
29 %arrayidx40 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp25
30 %arrayidx34 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp22
31 %arrayidx27 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp23
32 %arrayidx20 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp24
33 %arrayidx13 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp25
34 %arrayidx = getelementptr [128 x i32]* %in, i64 0, i64 %tmp22
35 %arrayidx56 = getelementptr [32 x i32]* %ia, i64 0, i64 %indvar20
36 %exitcond = icmp ne i64 %indvar20, 32
37 br i1 %exitcond, label %for.body, label %for.end
39 for.body: ; preds = %for.cond
40 %tmp8 = load i32* %arrayidx, align 16
41 %add = add i32 %tmp8, 1
42 %tmp14 = load i32* %arrayidx13, align 4
43 %add15 = add i32 %tmp14, 2
44 %tmp21 = load i32* %arrayidx20, align 8
45 %add22 = add i32 %tmp21, 3
46 %tmp28 = load i32* %arrayidx27, align 4
47 %add29 = add i32 %tmp28, 4
48 store i32 %add, i32* %arrayidx34, align 16
49 store i32 %add15, i32* %arrayidx40, align 4
50 store i32 %add22, i32* %arrayidx46, align 8
51 store i32 %add29, i32* %arrayidx52, align 4
52 store i32 %add22, i32* %arrayidx56, align 4
55 for.inc: ; preds = %for.body
56 %indvar.next21 = add i64 %indvar20, 1
59 for.end: ; preds = %for.cond
62 for.cond58: ; preds = %for.inc131, %for.end
63 %indvar = phi i64 [ %indvar.next, %for.inc131 ], [ 0, %for.end ]
64 %tmp15 = mul i64 %indvar, 4
65 %tmp16 = add i64 %tmp15, 2
66 %arrayidx99 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp16
67 %tmp17 = add i64 %tmp15, 3
68 %arrayidx114 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp17
69 %arrayidx108 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp17
70 %arrayidx93 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp16
71 %tmp18 = add i64 %tmp15, 1
72 %arrayidx84 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp18
73 %arrayidx78 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp18
74 %arrayidx70 = getelementptr [128 x i32]* %in, i64 0, i64 %tmp15
75 %arrayidx65 = getelementptr [128 x i32]* %out, i64 0, i64 %tmp15
76 %arrayidx121 = getelementptr [32 x i32]* %ia, i64 0, i64 %indvar
77 %i.1 = trunc i64 %indvar to i32
78 %cmp60 = icmp ult i32 %i.1, 32
79 br i1 %cmp60, label %for.body61, label %for.end134
81 for.body61: ; preds = %for.cond58
82 %tmp66 = load i32* %arrayidx65, align 16
83 %tmp71 = load i32* %arrayidx70, align 16
84 %add72 = add i32 %tmp71, 1
85 %cmp73 = icmp eq i32 %tmp66, %add72
86 br i1 %cmp73, label %lor.lhs.false, label %if.then
88 lor.lhs.false: ; preds = %for.body61
89 %tmp79 = load i32* %arrayidx78, align 4
90 %tmp85 = load i32* %arrayidx84, align 4
91 %add86 = add i32 %tmp85, 2
92 %cmp87 = icmp eq i32 %tmp79, %add86
93 br i1 %cmp87, label %lor.lhs.false88, label %if.then
95 lor.lhs.false88: ; preds = %lor.lhs.false
96 %tmp94 = load i32* %arrayidx93, align 8
97 %tmp100 = load i32* %arrayidx99, align 8
98 %add101 = add i32 %tmp100, 3
99 %cmp102 = icmp eq i32 %tmp94, %add101
100 br i1 %cmp102, label %lor.lhs.false103, label %if.then
102 lor.lhs.false103: ; preds = %lor.lhs.false88
103 %tmp109 = load i32* %arrayidx108, align 4
104 %tmp115 = load i32* %arrayidx114, align 4
105 %add116 = add i32 %tmp115, 4
106 %cmp117 = icmp eq i32 %tmp109, %add116
107 br i1 %cmp117, label %lor.lhs.false118, label %if.then
109 lor.lhs.false118: ; preds = %lor.lhs.false103
110 %tmp122 = load i32* %arrayidx121, align 4
111 %tmp128 = load i32* %arrayidx99, align 8
112 %add129 = add i32 %tmp128, 3
113 %cmp130 = icmp eq i32 %tmp122, %add129
114 br i1 %cmp130, label %if.end, label %if.then
116 if.then: ; preds = %lor.lhs.false118, %lor.lhs.false103, %lor.lhs.false88, %lor.lhs.false, %for.body61
117 call void @abort() noreturn nounwind
120 if.end: ; preds = %lor.lhs.false118
123 for.inc131: ; preds = %if.end
124 %indvar.next = add i64 %indvar, 1
127 for.end134: ; preds = %for.cond58
131 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
133 declare void @abort() noreturn
135 define i32 @main() nounwind uwtable {
137 call void @check_vect()
138 %call = call i32 @main1()
142 define internal void @check_vect() nounwind uwtable noinline {
144 %a = alloca i32, align 4
145 %b = alloca i32, align 4
146 %c = alloca i32, align 4
147 %d = alloca i32, align 4
148 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
149 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
150 %tobool = icmp eq i32 %call1, 0
151 br i1 %tobool, label %if.then, label %lor.lhs.false
153 lor.lhs.false: ; preds = %entry
154 %tmp4 = load i32* %d, align 4
155 %and6 = and i32 %tmp4, 67108864
156 %cmp = icmp eq i32 %and6, 0
157 br i1 %cmp, label %if.then, label %if.end
159 if.then: ; preds = %entry, %lor.lhs.false
160 call void @exit(i32 0) noreturn nounwind
163 if.end: ; preds = %lor.lhs.false
164 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
168 declare void (i32)* @signal(i32, void (i32)*) nounwind
170 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
172 call void @exit(i32 0) noreturn nounwind
175 return: ; No predecessors!
179 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
181 %and = and i32 %__level, -2147483648
182 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
183 %cmp = icmp ult i32 %call, %__level
184 br i1 %cmp, label %if.then, label %if.end
186 if.then: ; preds = %entry
189 if.end: ; preds = %entry
190 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
191 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
192 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
193 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
194 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
195 store i32 %asmresult, i32* %__eax, align 4
196 store i32 %asmresult8, i32* %__ebx, align 4
197 store i32 %asmresult9, i32* %__ecx, align 4
198 store i32 %asmresult10, i32* %__edx, align 4
201 return: ; preds = %if.end, %if.then
202 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
206 declare void @exit(i32) noreturn
208 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
210 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
211 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
212 %tobool = icmp eq i32* %__sig, null
213 br i1 %tobool, label %if.end, label %if.then
215 if.then: ; preds = %entry
216 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
217 store i32 %asmresult1, i32* %__sig, align 4
220 if.end: ; preds = %entry, %if.then
224 !0 = metadata !{i32 -2147342619, i32 -2147342611}
225 !1 = metadata !{i32 -2147342742, i32 -2147342734}