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-8.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-multitypes-8.s > slp-multitypes-8.ll
6 ; ModuleID = 'slp-multitypes-8.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 i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123456789:;<=>?", align 16
12 define i32 @main1() nounwind uwtable noinline {
14 %out = alloca [64 x i32], 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 %arrayidx19 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp10
22 %arrayidx11 = getelementptr [64 x i8]* @in, i64 0, i64 %tmp10
23 %arrayidx6 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp9
24 %arrayidx = getelementptr [64 x i8]* @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 i8* %arrayidx, align 2
30 %conv = sext i8 %tmp2 to i32
31 %add = add nsw i32 %conv, 1
32 store i32 %add, i32* %arrayidx6, align 8
33 %tmp12 = load i8* %arrayidx11, align 1
34 %conv13 = sext i8 %tmp12 to i32
35 %add14 = add nsw i32 %conv13, 2
36 store i32 %add14, i32* %arrayidx19, align 4
39 for.inc: ; preds = %for.body
40 %indvar.next8 = add i64 %indvar7, 1
43 for.end: ; preds = %for.cond
46 for.cond21: ; preds = %for.inc56, %for.end
47 %indvar = phi i64 [ %indvar.next, %for.inc56 ], [ 0, %for.end ]
48 %tmp = mul i64 %indvar, 2
49 %tmp5 = add i64 %tmp, 1
50 %arrayidx50 = getelementptr [64 x i8]* @in, i64 0, i64 %tmp5
51 %arrayidx44 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp5
52 %arrayidx34 = getelementptr [64 x i8]* @in, i64 0, i64 %tmp
53 %arrayidx29 = getelementptr [64 x i32]* %out, i64 0, i64 %tmp
54 %i.1 = trunc i64 %indvar to i32
55 %cmp23 = icmp slt i32 %i.1, 32
56 br i1 %cmp23, label %for.body25, label %for.end59
58 for.body25: ; preds = %for.cond21
59 %tmp30 = load i32* %arrayidx29, align 8
60 %tmp35 = load i8* %arrayidx34, align 2
61 %conv36 = sext i8 %tmp35 to i32
62 %add37 = add nsw i32 %conv36, 1
63 %cmp38 = icmp eq i32 %tmp30, %add37
64 br i1 %cmp38, label %lor.lhs.false, label %if.then
66 lor.lhs.false: ; preds = %for.body25
67 %tmp45 = load i32* %arrayidx44, align 4
68 %tmp51 = load i8* %arrayidx50, align 1
69 %conv52 = sext i8 %tmp51 to i32
70 %add53 = add nsw i32 %conv52, 2
71 %cmp54 = icmp eq i32 %tmp45, %add53
72 br i1 %cmp54, label %if.end, label %if.then
74 if.then: ; preds = %lor.lhs.false, %for.body25
75 call void @abort() noreturn nounwind
78 if.end: ; preds = %lor.lhs.false
81 for.inc56: ; preds = %if.end
82 %indvar.next = add i64 %indvar, 1
85 for.end59: ; preds = %for.cond21
89 declare void @abort() noreturn
91 define i32 @main() nounwind uwtable {
93 call void @check_vect()
94 %call = call i32 @main1()
98 define internal void @check_vect() nounwind uwtable noinline {
100 %a = alloca i32, align 4
101 %b = alloca i32, align 4
102 %c = alloca i32, align 4
103 %d = alloca i32, align 4
104 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
105 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
106 %tobool = icmp eq i32 %call1, 0
107 br i1 %tobool, label %if.then, label %lor.lhs.false
109 lor.lhs.false: ; preds = %entry
110 %tmp4 = load i32* %d, align 4
111 %and6 = and i32 %tmp4, 67108864
112 %cmp = icmp eq i32 %and6, 0
113 br i1 %cmp, label %if.then, label %if.end
115 if.then: ; preds = %entry, %lor.lhs.false
116 call void @exit(i32 0) noreturn nounwind
119 if.end: ; preds = %lor.lhs.false
120 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
124 declare void (i32)* @signal(i32, void (i32)*) nounwind
126 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
128 call void @exit(i32 0) noreturn nounwind
131 return: ; No predecessors!
135 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
137 %and = and i32 %__level, -2147483648
138 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
139 %cmp = icmp ult i32 %call, %__level
140 br i1 %cmp, label %if.then, label %if.end
142 if.then: ; preds = %entry
145 if.end: ; preds = %entry
146 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
147 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
148 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
149 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
150 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
151 store i32 %asmresult, i32* %__eax, align 4
152 store i32 %asmresult8, i32* %__ebx, align 4
153 store i32 %asmresult9, i32* %__ecx, align 4
154 store i32 %asmresult10, i32* %__edx, align 4
157 return: ; preds = %if.end, %if.then
158 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
162 declare void @exit(i32) noreturn
164 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
166 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
167 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
168 %tobool = icmp eq i32* %__sig, null
169 br i1 %tobool, label %if.end, label %if.then
171 if.then: ; preds = %entry
172 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
173 store i32 %asmresult1, i32* %__sig, align 4
176 if.end: ; preds = %entry, %if.then
180 !0 = metadata !{i32 -2147343323, i32 -2147343315}
181 !1 = metadata !{i32 -2147343446, i32 -2147343438}