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-9.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-multitypes-9.s > slp-multitypes-9.ll
6 ; ModuleID = 'slp-multitypes-9.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 @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
12 define i32 @main1() nounwind uwtable noinline {
14 %out = alloca [64 x i8], align 16
17 for.cond: ; preds = %for.inc, %entry
18 %indvar7 = phi i64 [ %indvar.next8, %for.inc ], [ 0, %entry ]
19 %tmp9 = mul i64 %indvar7, 2
20 %tmp10 = add i64 %tmp9, 1
21 %arrayidx23 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp10
22 %arrayidx13 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp10
23 %arrayidx8 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp9
24 %arrayidx = getelementptr [64 x i32]* @in, i64 0, i64 %tmp9
25 %exitcond = icmp ne i64 %indvar7, 32
26 br i1 %exitcond, label %for.body, label %for.end
28 for.body: ; preds = %for.cond
29 %tmp2 = load i32* %arrayidx, align 8
30 %add = add nsw i32 %tmp2, 1
31 %conv4 = trunc i32 %add to i8
32 store i8 %conv4, i8* %arrayidx8, align 2
33 %tmp14 = load i32* %arrayidx13, align 4
34 %add17 = add nsw i32 %tmp14, 2
35 %conv18 = trunc i32 %add17 to i8
36 store i8 %conv18, i8* %arrayidx23, align 1
39 for.inc: ; preds = %for.body
40 %indvar.next8 = add i64 %indvar7, 1
43 for.end: ; preds = %for.cond
46 for.cond25: ; preds = %for.inc64, %for.end
47 %indvar = phi i64 [ %indvar.next, %for.inc64 ], [ 0, %for.end ]
48 %tmp = mul i64 %indvar, 2
49 %tmp5 = add i64 %tmp, 1
50 %arrayidx57 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp5
51 %arrayidx50 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp5
52 %arrayidx39 = getelementptr [64 x i32]* @in, i64 0, i64 %tmp
53 %arrayidx33 = getelementptr [64 x i8]* %out, i64 0, i64 %tmp
54 %i.1 = trunc i64 %indvar to i32
55 %cmp27 = icmp slt i32 %i.1, 32
56 br i1 %cmp27, label %for.body29, label %for.end67
58 for.body29: ; preds = %for.cond25
59 %tmp34 = load i8* %arrayidx33, align 2
60 %conv35 = zext i8 %tmp34 to i32
61 %tmp40 = load i32* %arrayidx39, align 8
62 %conv42 = and i32 %tmp40, 255
63 %add43 = add nsw i32 %conv42, 1
64 %cmp44 = icmp eq i32 %conv35, %add43
65 br i1 %cmp44, label %lor.lhs.false, label %if.then
67 lor.lhs.false: ; preds = %for.body29
68 %tmp51 = load i8* %arrayidx50, align 1
69 %conv52 = zext i8 %tmp51 to i32
70 %tmp58 = load i32* %arrayidx57, align 4
71 %conv60 = and i32 %tmp58, 255
72 %add61 = add nsw i32 %conv60, 2
73 %cmp62 = icmp eq i32 %conv52, %add61
74 br i1 %cmp62, label %if.end, label %if.then
76 if.then: ; preds = %lor.lhs.false, %for.body29
77 call void @abort() noreturn nounwind
80 if.end: ; preds = %lor.lhs.false
83 for.inc64: ; preds = %if.end
84 %indvar.next = add i64 %indvar, 1
87 for.end67: ; preds = %for.cond25
91 declare void @abort() noreturn
93 define i32 @main() nounwind uwtable {
95 call void @check_vect()
96 %call = call i32 @main1()
100 define internal void @check_vect() nounwind uwtable noinline {
102 %a = alloca i32, align 4
103 %b = alloca i32, align 4
104 %c = alloca i32, align 4
105 %d = alloca i32, align 4
106 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
107 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
108 %tobool = icmp eq i32 %call1, 0
109 br i1 %tobool, label %if.then, label %lor.lhs.false
111 lor.lhs.false: ; preds = %entry
112 %tmp4 = load i32* %d, align 4
113 %and6 = and i32 %tmp4, 67108864
114 %cmp = icmp eq i32 %and6, 0
115 br i1 %cmp, label %if.then, label %if.end
117 if.then: ; preds = %entry, %lor.lhs.false
118 call void @exit(i32 0) noreturn nounwind
121 if.end: ; preds = %lor.lhs.false
122 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
126 declare void (i32)* @signal(i32, void (i32)*) nounwind
128 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
130 call void @exit(i32 0) noreturn nounwind
133 return: ; No predecessors!
137 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
139 %and = and i32 %__level, -2147483648
140 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
141 %cmp = icmp ult i32 %call, %__level
142 br i1 %cmp, label %if.then, label %if.end
144 if.then: ; preds = %entry
147 if.end: ; preds = %entry
148 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
149 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
150 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
151 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
152 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
153 store i32 %asmresult, i32* %__eax, align 4
154 store i32 %asmresult8, i32* %__ebx, align 4
155 store i32 %asmresult9, i32* %__ecx, align 4
156 store i32 %asmresult10, i32* %__edx, align 4
159 return: ; preds = %if.end, %if.then
160 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
164 declare void @exit(i32) noreturn
166 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
168 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
169 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
170 %tobool = icmp eq i32* %__sig, null
171 br i1 %tobool, label %if.end, label %if.then
173 if.then: ; preds = %entry
174 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
175 store i32 %asmresult1, i32* %__sig, align 4
178 if.end: ; preds = %entry, %if.then
182 !0 = metadata !{i32 -2147343257, i32 -2147343249}
183 !1 = metadata !{i32 -2147343380, i32 -2147343372}