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 vect-113.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer vect-113.s > vect-113.ll
6 ; ModuleID = 'vect-113.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 noinline {
12 %a = alloca [16 x float], align 16
15 for.cond: ; preds = %for.inc, %entry
16 %indvar1 = phi i64 [ %indvar.next2, %for.inc ], [ 0, %entry ]
17 %arrayidx = getelementptr [16 x float]* %a, i64 0, i64 %indvar1
18 %i.0 = trunc i64 %indvar1 to i32
19 %exitcond = icmp ne i64 %indvar1, 16
20 br i1 %exitcond, label %for.body, label %for.end
22 for.body: ; preds = %for.cond
23 %conv = sitofp i32 %i.0 to float
24 store float %conv, float* %arrayidx, align 4
27 for.inc: ; preds = %for.body
28 %indvar.next2 = add i64 %indvar1, 1
31 for.end: ; preds = %for.cond
34 for.cond4: ; preds = %for.inc17, %for.end
35 %indvar = phi i64 [ %indvar.next, %for.inc17 ], [ 0, %for.end ]
36 %i.1 = trunc i64 %indvar to i32
37 %arrayidx11 = getelementptr [16 x float]* %a, i64 0, i64 %indvar
38 %cmp6 = icmp slt i32 %i.1, 16
39 br i1 %cmp6, label %for.body8, label %for.end20
41 for.body8: ; preds = %for.cond4
42 %tmp12 = load float* %arrayidx11, align 4
43 %conv14 = sitofp i32 %i.1 to float
44 %cmp15 = fcmp une float %tmp12, %conv14
45 br i1 %cmp15, label %if.then, label %if.end
47 if.then: ; preds = %for.body8
48 call void @abort() noreturn nounwind
51 if.end: ; preds = %for.body8
54 for.inc17: ; preds = %if.end
55 %indvar.next = add i64 %indvar, 1
58 for.end20: ; preds = %for.cond4
62 declare void @abort() noreturn
64 define i32 @main() nounwind uwtable {
66 call void @check_vect()
67 %call = call i32 @main1()
71 define internal void @check_vect() nounwind uwtable noinline {
73 %a = alloca i32, align 4
74 %b = alloca i32, align 4
75 %c = alloca i32, align 4
76 %d = alloca i32, align 4
77 %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
78 %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
79 %tobool = icmp eq i32 %call1, 0
80 br i1 %tobool, label %if.then, label %lor.lhs.false
82 lor.lhs.false: ; preds = %entry
83 %tmp4 = load i32* %d, align 4
84 %and6 = and i32 %tmp4, 67108864
85 %cmp = icmp eq i32 %and6, 0
86 br i1 %cmp, label %if.then, label %if.end
88 if.then: ; preds = %entry, %lor.lhs.false
89 call void @exit(i32 0) noreturn nounwind
92 if.end: ; preds = %lor.lhs.false
93 %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
97 declare void (i32)* @signal(i32, void (i32)*) nounwind
99 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
101 call void @exit(i32 0) noreturn nounwind
104 return: ; No predecessors!
108 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
110 %and = and i32 %__level, -2147483648
111 %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
112 %cmp = icmp ult i32 %call, %__level
113 br i1 %cmp, label %if.then, label %if.end
115 if.then: ; preds = %entry
118 if.end: ; preds = %entry
119 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
120 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
121 %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
122 %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
123 %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
124 store i32 %asmresult, i32* %__eax, align 4
125 store i32 %asmresult8, i32* %__ebx, align 4
126 store i32 %asmresult9, i32* %__ecx, align 4
127 store i32 %asmresult10, i32* %__edx, align 4
130 return: ; preds = %if.end, %if.then
131 %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
135 declare void @exit(i32) noreturn
137 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
139 %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
140 %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
141 %tobool = icmp eq i32* %__sig, null
142 br i1 %tobool, label %if.end, label %if.then
144 if.then: ; preds = %entry
145 %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
146 store i32 %asmresult1, i32* %__sig, align 4
149 if.end: ; preds = %entry, %if.then
153 !0 = metadata !{i32 -2147343748, i32 -2147343740}
154 !1 = metadata !{i32 -2147343871, i32 -2147343863}