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 no-scevccp-slp-31.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-scevccp-slp-31.s > no-scevccp-slp-31.ll
6 ; ModuleID = 'no-scevccp-slp-31.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 define i32 @main1() nounwind uwtable {
12 %out = alloca [1024 x i16], align 16
13 %a = alloca [128 x [128 x i16]], align 16
16 for.cond: ; preds = %for.inc27, %entry
17 %indvar15 = phi i64 [ %indvar.next16, %for.inc27 ], [ 0, %entry ]
18 %tmp19 = mul i64 %indvar15, 4
19 %tmp20 = add i64 %tmp19, 3
20 %arrayidx26 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp20
21 %tmp21 = add i64 %tmp19, 2
22 %arrayidx21 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp21
23 %tmp22 = add i64 %tmp19, 1
24 %arrayidx16 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp22
25 %arrayidx12 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp19
26 %exitcond18 = icmp ne i64 %indvar15, 128
27 br i1 %exitcond18, label %for.body, label %for.end30
29 for.body: ; preds = %for.cond
32 for.cond1: ; preds = %for.inc, %for.body
33 %indvar13 = phi i64 [ %indvar.next14, %for.inc ], [ 0, %for.body ]
34 %arrayidx8 = getelementptr [128 x [128 x i16]]* %a, i64 0, i64 %indvar15, i64 %indvar13
35 %exitcond = icmp ne i64 %indvar13, 128
36 br i1 %exitcond, label %for.body4, label %for.end
38 for.body4: ; preds = %for.cond1
39 store i16 8, i16* %arrayidx8, align 2
42 for.inc: ; preds = %for.body4
43 %indvar.next14 = add i64 %indvar13, 1
46 for.end: ; preds = %for.cond1
47 store i16 8, i16* %arrayidx12, align 8
48 store i16 18, i16* %arrayidx16, align 2
49 store i16 28, i16* %arrayidx21, align 4
50 store i16 38, i16* %arrayidx26, align 2
53 for.inc27: ; preds = %for.end
54 %indvar.next16 = add i64 %indvar15, 1
57 for.end30: ; preds = %for.cond
60 for.cond31: ; preds = %for.inc91, %for.end30
61 %indvar7 = phi i64 [ %indvar.next8, %for.inc91 ], [ 0, %for.end30 ]
62 %tmp = mul i64 %indvar7, 4
63 %tmp9 = add i64 %tmp, 3
64 %arrayidx84 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp9
65 %tmp10 = add i64 %tmp, 2
66 %arrayidx74 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp10
67 %tmp11 = add i64 %tmp, 1
68 %arrayidx64 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp11
69 %arrayidx55 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp
70 %i.1 = trunc i64 %indvar7 to i32
71 %cmp33 = icmp slt i32 %i.1, 128
72 br i1 %cmp33, label %for.body34, label %for.end94
74 for.body34: ; preds = %for.cond31
77 for.cond35: ; preds = %for.inc48, %for.body34
78 %indvar = phi i64 [ %indvar.next, %for.inc48 ], [ 0, %for.body34 ]
79 %arrayidx44 = getelementptr [128 x [128 x i16]]* %a, i64 0, i64 %indvar7, i64 %indvar
80 %j.1 = trunc i64 %indvar to i32
81 %cmp37 = icmp slt i32 %j.1, 128
82 br i1 %cmp37, label %for.body38, label %for.end51
84 for.body38: ; preds = %for.cond35
85 %tmp45 = load i16* %arrayidx44, align 2
86 %cmp46 = icmp eq i16 %tmp45, 8
87 br i1 %cmp46, label %if.end, label %if.then
89 if.then: ; preds = %for.body38
90 call void @abort() noreturn nounwind
93 if.end: ; preds = %for.body38
96 for.inc48: ; preds = %if.end
97 %indvar.next = add i64 %indvar, 1
100 for.end51: ; preds = %for.cond35
101 %tmp56 = load i16* %arrayidx55, align 8
102 %cmp58 = icmp eq i16 %tmp56, 8
103 br i1 %cmp58, label %lor.lhs.false, label %if.then89
105 lor.lhs.false: ; preds = %for.end51
106 %tmp65 = load i16* %arrayidx64, align 2
107 %cmp67 = icmp eq i16 %tmp65, 18
108 br i1 %cmp67, label %lor.lhs.false69, label %if.then89
110 lor.lhs.false69: ; preds = %lor.lhs.false
111 %tmp75 = load i16* %arrayidx74, align 4
112 %cmp77 = icmp eq i16 %tmp75, 28
113 br i1 %cmp77, label %lor.lhs.false79, label %if.then89
115 lor.lhs.false79: ; preds = %lor.lhs.false69
116 %tmp85 = load i16* %arrayidx84, align 2
117 %cmp87 = icmp eq i16 %tmp85, 38
118 br i1 %cmp87, label %if.end90, label %if.then89
120 if.then89: ; preds = %lor.lhs.false79, %lor.lhs.false69, %lor.lhs.false, %for.end51
121 call void @abort() noreturn nounwind
124 if.end90: ; preds = %lor.lhs.false79
127 for.inc91: ; preds = %if.end90
128 %indvar.next8 = add i64 %indvar7, 1
131 for.end94: ; preds = %for.cond31
135 declare void @abort() noreturn
137 define i32 @main() nounwind uwtable {
139 call void @check_vect()
140 %call = call i32 @main1()
144 define internal void @check_vect() nounwind uwtable noinline {
146 %a = alloca i32, align 4
147 %b = alloca i32, align 4
148 %c = alloca i32, align 4
149 %d = alloca i32, align 4
150 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
151 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
152 %tobool = icmp eq i32 %call1, 0
153 br i1 %tobool, label %if.then, label %lor.lhs.false
155 lor.lhs.false: ; preds = %entry
156 %tmp4 = load i32* %d, align 4
157 %and6 = and i32 %tmp4, 67108864
158 %cmp = icmp eq i32 %and6, 0
159 br i1 %cmp, label %if.then, label %if.end
161 if.then: ; preds = %entry, %lor.lhs.false
162 call void @exit(i32 0) noreturn nounwind
165 if.end: ; preds = %lor.lhs.false
166 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
170 declare void (i32)* @signal(i32, void (i32)*) nounwind
172 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
174 call void @exit(i32 0) noreturn nounwind
177 return: ; No predecessors!
181 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
183 %and = and i32 %__level, -2147483648
184 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
185 %cmp = icmp ult i32 %call, %__level
186 br i1 %cmp, label %if.then, label %if.end
188 if.then: ; preds = %entry
191 if.end: ; preds = %entry
192 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
193 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
194 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
195 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
196 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
197 store i32 %asmresult, i32* %__eax, align 4
198 store i32 %asmresult8, i32* %__ebx, align 4
199 store i32 %asmresult9, i32* %__ecx, align 4
200 store i32 %asmresult10, i32* %__edx, align 4
203 return: ; preds = %if.end, %if.then
204 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
208 declare void @exit(i32) noreturn
210 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
212 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
213 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
214 %tobool = icmp eq i32* %__sig, null
215 br i1 %tobool, label %if.end, label %if.then
217 if.then: ; preds = %entry
218 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
219 store i32 %asmresult1, i32* %__sig, align 4
222 if.end: ; preds = %entry, %if.then
226 !0 = metadata !{i32 -2147343389, i32 -2147343381}
227 !1 = metadata !{i32 -2147343512, i32 -2147343504}