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-30.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-scevccp-slp-30.s > no-scevccp-slp-30.ll
6 ; ModuleID = 'no-scevccp-slp-30.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 i16], align 16
16 for.cond: ; preds = %for.inc24, %entry
17 %indvar21 = phi i64 [ %indvar.next22, %for.inc24 ], [ 0, %entry ]
18 %arrayidx23 = getelementptr [128 x i16]* %a, i64 0, i64 %indvar21
19 %exitcond23 = icmp ne i64 %indvar21, 128
20 br i1 %exitcond23, label %for.body, label %for.end27
22 for.body: ; preds = %for.cond
25 for.cond1: ; preds = %for.inc, %for.body
26 %indvar14 = phi i64 [ %indvar.next15, %for.inc ], [ 0, %for.body ]
27 %tmp16 = mul i64 %indvar14, 4
28 %tmp17 = add i64 %tmp16, 3
29 %arrayidx19 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp17
30 %tmp18 = add i64 %tmp16, 2
31 %arrayidx14 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp18
32 %tmp19 = add i64 %tmp16, 1
33 %arrayidx9 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp19
34 %arrayidx = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp16
35 %exitcond = icmp ne i64 %indvar14, 128
36 br i1 %exitcond, label %for.body4, label %for.end
38 for.body4: ; preds = %for.cond1
39 store i16 8, i16* %arrayidx, align 8
40 store i16 18, i16* %arrayidx9, align 2
41 store i16 28, i16* %arrayidx14, align 4
42 store i16 38, i16* %arrayidx19, align 2
45 for.inc: ; preds = %for.body4
46 %indvar.next15 = add i64 %indvar14, 1
49 for.end: ; preds = %for.cond1
50 store i16 8, i16* %arrayidx23, align 2
53 for.inc24: ; preds = %for.end
54 %indvar.next22 = add i64 %indvar21, 1
57 for.end27: ; preds = %for.cond
60 for.cond28: ; preds = %for.inc85, %for.end27
61 %indvar11 = phi i64 [ %indvar.next12, %for.inc85 ], [ 0, %for.end27 ]
62 %arrayidx78 = getelementptr [128 x i16]* %a, i64 0, i64 %indvar11
63 %j.1 = trunc i64 %indvar11 to i32
64 %cmp30 = icmp slt i32 %j.1, 128
65 br i1 %cmp30, label %for.body31, label %for.end88
67 for.body31: ; preds = %for.cond28
70 for.cond32: ; preds = %for.inc72, %for.body31
71 %indvar = phi i64 [ %indvar.next, %for.inc72 ], [ 0, %for.body31 ]
72 %tmp = mul i64 %indvar, 4
73 %tmp7 = add i64 %tmp, 3
74 %arrayidx67 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp7
75 %tmp8 = add i64 %tmp, 2
76 %arrayidx57 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp8
77 %tmp9 = add i64 %tmp, 1
78 %arrayidx47 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp9
79 %arrayidx39 = getelementptr [1024 x i16]* %out, i64 0, i64 %tmp
80 %i.1 = trunc i64 %indvar to i32
81 %cmp34 = icmp slt i32 %i.1, 128
82 br i1 %cmp34, label %for.body35, label %for.end75
84 for.body35: ; preds = %for.cond32
85 %tmp40 = load i16* %arrayidx39, align 8
86 %cmp41 = icmp eq i16 %tmp40, 8
87 br i1 %cmp41, label %lor.lhs.false, label %if.then
89 lor.lhs.false: ; preds = %for.body35
90 %tmp48 = load i16* %arrayidx47, align 2
91 %cmp50 = icmp eq i16 %tmp48, 18
92 br i1 %cmp50, label %lor.lhs.false52, label %if.then
94 lor.lhs.false52: ; preds = %lor.lhs.false
95 %tmp58 = load i16* %arrayidx57, align 4
96 %cmp60 = icmp eq i16 %tmp58, 28
97 br i1 %cmp60, label %lor.lhs.false62, label %if.then
99 lor.lhs.false62: ; preds = %lor.lhs.false52
100 %tmp68 = load i16* %arrayidx67, align 2
101 %cmp70 = icmp eq i16 %tmp68, 38
102 br i1 %cmp70, label %if.end, label %if.then
104 if.then: ; preds = %lor.lhs.false62, %lor.lhs.false52, %lor.lhs.false, %for.body35
105 call void @abort() noreturn nounwind
108 if.end: ; preds = %lor.lhs.false62
111 for.inc72: ; preds = %if.end
112 %indvar.next = add i64 %indvar, 1
115 for.end75: ; preds = %for.cond32
116 %tmp79 = load i16* %arrayidx78, align 2
117 %cmp81 = icmp eq i16 %tmp79, 8
118 br i1 %cmp81, label %if.end84, label %if.then83
120 if.then83: ; preds = %for.end75
121 call void @abort() noreturn nounwind
124 if.end84: ; preds = %for.end75
127 for.inc85: ; preds = %if.end84
128 %indvar.next12 = add i64 %indvar11, 1
131 for.end88: ; preds = %for.cond28
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 -2147343370, i32 -2147343362}
227 !1 = metadata !{i32 -2147343493, i32 -2147343485}