Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-74.ll
blob2e6973ba07fbff80b2f12aa288da09ab07ae4cf8
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-74.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer vect-74.s > vect-74.ll
6 ; ModuleID = 'vect-74.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 @b = global [20 x float] [float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 7.000000e+00, float 9.000000e+00, float 1.000000e+01, float 1.100000e+01, float 1.200000e+01, float 1.300000e+01, float 1.400000e+01, float 1.500000e+01, float 1.600000e+01, float 1.700000e+01, float 1.800000e+01, float 1.900000e+01, float 0.000000e+00, float 0.000000e+00], align 16
11 @c = global [16 x float] [float 5.000000e-01, float 1.500000e+00, float 2.500000e+00, float 3.500000e+00, float 4.500000e+00, float 5.500000e+00, float 7.500000e+00, float 9.500000e+00, float 1.050000e+01, float 1.150000e+01, float 1.250000e+01, float 1.350000e+01, float 1.450000e+01, float 1.550000e+01, float 0.000000e+00, float 0.000000e+00], align 16
12 @a = common global [16 x float] zeroinitializer, align 16
14 define i32 @main1(float* noalias %pa, float* noalias %pb, float* noalias %pc) nounwind uwtable noinline {
15 entry:
16   br label %for.cond
18 for.cond:                                         ; preds = %for.inc, %entry
19   %indvar3 = phi i64 [ %indvar.next4, %for.inc ], [ 0, %entry ]
20   %arrayidx13 = getelementptr float* %pa, i64 %indvar3
21   %arrayidx8 = getelementptr float* %pc, i64 %indvar3
22   %tmp5 = add i64 %indvar3, 4
23   %arrayidx = getelementptr float* %pb, i64 %tmp5
24   %exitcond = icmp ne i64 %indvar3, 16
25   br i1 %exitcond, label %for.body, label %for.end
27 for.body:                                         ; preds = %for.cond
28   %tmp4 = load float* %arrayidx, align 4
29   %tmp9 = load float* %arrayidx8, align 4
30   %mul = fmul float %tmp4, %tmp9
31   store float %mul, float* %arrayidx13, align 4
32   br label %for.inc
34 for.inc:                                          ; preds = %for.body
35   %indvar.next4 = add i64 %indvar3, 1
36   br label %for.cond
38 for.end:                                          ; preds = %for.cond
39   br label %for.cond15
41 for.cond15:                                       ; preds = %for.inc36, %for.end
42   %indvar = phi i64 [ %indvar.next, %for.inc36 ], [ 0, %for.end ]
43   %arrayidx32 = getelementptr float* %pc, i64 %indvar
44   %tmp = add i64 %indvar, 4
45   %arrayidx27 = getelementptr float* %pb, i64 %tmp
46   %arrayidx22 = getelementptr float* %pa, i64 %indvar
47   %i.1 = trunc i64 %indvar to i32
48   %cmp17 = icmp slt i32 %i.1, 16
49   br i1 %cmp17, label %for.body18, label %for.end39
51 for.body18:                                       ; preds = %for.cond15
52   %tmp23 = load float* %arrayidx22, align 4
53   %tmp28 = load float* %arrayidx27, align 4
54   %tmp33 = load float* %arrayidx32, align 4
55   %mul34 = fmul float %tmp28, %tmp33
56   %cmp35 = fcmp une float %tmp23, %mul34
57   br i1 %cmp35, label %if.then, label %if.end
59 if.then:                                          ; preds = %for.body18
60   call void @abort() noreturn nounwind
61   unreachable
63 if.end:                                           ; preds = %for.body18
64   br label %for.inc36
66 for.inc36:                                        ; preds = %if.end
67   %indvar.next = add i64 %indvar, 1
68   br label %for.cond15
70 for.end39:                                        ; preds = %for.cond15
71   ret i32 0
74 declare void @abort() noreturn
76 define i32 @main() nounwind uwtable {
77 entry:
78   call void @check_vect()
79   %call = call i32 @main1(float* getelementptr inbounds ([16 x float]* @a, i64 0, i64 0), float* getelementptr inbounds ([20 x float]* @b, i64 0, i64 0), float* getelementptr inbounds ([16 x float]* @c, i64 0, i64 0))
80   ret i32 0
83 define internal void @check_vect() nounwind uwtable noinline {
84 entry:
85   %a = alloca i32, align 4
86   %b = alloca i32, align 4
87   %c = alloca i32, align 4
88   %d = alloca i32, align 4
89   %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
90   %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
91   %tobool = icmp eq i32 %call1, 0
92   br i1 %tobool, label %if.then, label %lor.lhs.false
94 lor.lhs.false:                                    ; preds = %entry
95   %tmp4 = load i32* %d, align 4
96   %and6 = and i32 %tmp4, 67108864
97   %cmp = icmp eq i32 %and6, 0
98   br i1 %cmp, label %if.then, label %if.end
100 if.then:                                          ; preds = %entry, %lor.lhs.false
101   call void @exit(i32 0) noreturn nounwind
102   unreachable
104 if.end:                                           ; preds = %lor.lhs.false
105   %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
106   ret void
109 declare void (i32)* @signal(i32, void (i32)*) nounwind
111 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
112 entry:
113   call void @exit(i32 0) noreturn nounwind
114   unreachable
116 return:                                           ; No predecessors!
117   ret void
120 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
121 entry:
122   %and = and i32 %__level, -2147483648
123   %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
124   %cmp = icmp ult i32 %call, %__level
125   br i1 %cmp, label %if.then, label %if.end
127 if.then:                                          ; preds = %entry
128   br label %return
130 if.end:                                           ; preds = %entry
131   %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
132   %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
133   %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
134   %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
135   %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
136   store i32 %asmresult, i32* %__eax, align 4
137   store i32 %asmresult8, i32* %__ebx, align 4
138   store i32 %asmresult9, i32* %__ecx, align 4
139   store i32 %asmresult10, i32* %__edx, align 4
140   br label %return
142 return:                                           ; preds = %if.end, %if.then
143   %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
144   ret i32 %retval.0
147 declare void @exit(i32) noreturn
149 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
150 entry:
151   %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
152   %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
153   %tobool = icmp eq i32* %__sig, null
154   br i1 %tobool, label %if.end, label %if.then
156 if.then:                                          ; preds = %entry
157   %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
158   store i32 %asmresult1, i32* %__sig, align 4
159   br label %if.end
161 if.end:                                           ; preds = %entry, %if.then
162   ret i32 %asmresult
165 !0 = metadata !{i32 -2147342693, i32 -2147342685} 
166 !1 = metadata !{i32 -2147342816, i32 -2147342808} 
167 ; CHECK: define