Add compile command to each testcase
[gcc-vect-testsuite.git] / slp-perm-7.ll
blob536cc192d5b62ec033f001a7221ff1d9b0060470
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-perm-7.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer slp-perm-7.s > slp-perm-7.ll
6 ; ModuleID = 'slp-perm-7.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 @main.check_results = internal unnamed_addr constant [16 x i32] [i32 1470, i32 395, i32 28271, i32 5958, i32 1655, i32 111653, i32 10446, i32 2915, i32 195035, i32 14934, i32 4175, i32 278417, i32 19422, i32 5435, i32 361799, i32 0], align 16
12 define void @foo(i32* noalias %pInput, i32* noalias %pOutput, i32* noalias %pInput2, i32* noalias %pOutput2) nounwind uwtable {
13 entry:
14   br label %for.cond
16 for.cond:                                         ; preds = %for.inc, %entry
17   %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
18   %pOutput2.addr.0 = getelementptr i32* %pOutput2, i64 %indvar
19   %pInput2.addr.0 = getelementptr i32* %pInput2, i64 %indvar
20   %tmp = mul i64 %indvar, 3
21   %tmp1 = add i64 %tmp, 2
22   %incdec.ptr29 = getelementptr i32* %pOutput, i64 %tmp1
23   %tmp3 = add i64 %tmp, 1
24   %incdec.ptr19 = getelementptr i32* %pOutput, i64 %tmp3
25   %pOutput.addr.0 = getelementptr i32* %pOutput, i64 %tmp
26   %incdec.ptr4 = getelementptr i32* %pInput, i64 %tmp1
27   %incdec.ptr = getelementptr i32* %pInput, i64 %tmp3
28   %pInput.addr.0 = getelementptr i32* %pInput, i64 %tmp
29   %exitcond = icmp ne i64 %indvar, 5
30   br i1 %exitcond, label %for.body, label %for.end
32 for.body:                                         ; preds = %for.cond
33   %tmp2 = load i32* %pInput.addr.0, align 4
34   %tmp5 = load i32* %incdec.ptr, align 4
35   %tmp8 = load i32* %incdec.ptr4, align 4
36   %tmp11 = load i32* %pInput2.addr.0, align 4
37   %mul = mul nsw i32 %tmp2, 100
38   %mul14 = mul nsw i32 %tmp5, 1322
39   %add = add nsw i32 %mul, %mul14
40   %mul16 = mul nsw i32 %tmp8, 74
41   %add17 = add nsw i32 %add, %mul16
42   store i32 %add17, i32* %pOutput.addr.0, align 4
43   %mul21 = mul nsw i32 %tmp2, 216
44   %mul23 = mul nsw i32 %tmp5, 13
45   %add24 = add nsw i32 %mul21, %mul23
46   %mul26 = mul nsw i32 %tmp8, 191
47   %add27 = add nsw i32 %add24, %mul26
48   store i32 %add27, i32* %incdec.ptr19, align 4
49   %mul31 = mul nsw i32 %tmp2, 23
50   %mul33 = mul nsw i32 %tmp5, 27271
51   %add34 = add nsw i32 %mul31, %mul33
52   %mul36 = mul nsw i32 %tmp8, 500
53   %add37 = add nsw i32 %add34, %mul36
54   store i32 %add37, i32* %incdec.ptr29, align 4
55   %mul41 = mul nsw i32 %tmp11, 405
56   store i32 %mul41, i32* %pOutput2.addr.0, align 4
57   br label %for.inc
59 for.inc:                                          ; preds = %for.body
60   %indvar.next = add i64 %indvar, 1
61   br label %for.cond
63 for.end:                                          ; preds = %for.cond
64   ret void
67 define i32 @main(i32 %argc, i8** %argv) nounwind uwtable {
68 entry:
69   %input = alloca [16 x i32], align 16
70   %output = alloca [16 x i32], align 16
71   %check_results = alloca [16 x i32], align 16
72   %input2 = alloca [16 x i32], align 16
73   %output2 = alloca [16 x i32], align 16
74   %check_results2 = alloca [16 x i32], align 16
75   %tmp = bitcast [16 x i32]* %check_results to i8*
76   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* bitcast ([16 x i32]* @main.check_results to i8*), i64 64, i32 16, i1 false)
77   %tmp4 = bitcast [16 x i32]* %check_results2 to i8*
78   call void @llvm.memset.p0i8.i64(i8* %tmp4, i8 0, i64 64, i32 16, i1 false)
79   %tmp6 = getelementptr [16 x i32]* %check_results2, i64 0, i64 1
80   store i32 405, i32* %tmp6, align 4
81   %tmp7 = getelementptr [16 x i32]* %check_results2, i64 0, i64 2
82   store i32 810, i32* %tmp7, align 8
83   %tmp8 = getelementptr [16 x i32]* %check_results2, i64 0, i64 3
84   store i32 1215, i32* %tmp8, align 4
85   %tmp9 = getelementptr [16 x i32]* %check_results2, i64 0, i64 4
86   store i32 1620, i32* %tmp9, align 16
87   call void @check_vect()
88   br label %for.cond
90 for.cond:                                         ; preds = %for.inc, %entry
91   %indvar2 = phi i64 [ %indvar.next3, %for.inc ], [ 0, %entry ]
92   %tmp10 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
93   %arrayidx = getelementptr [16 x i32]* %input, i64 0, i64 %indvar2
94   %arrayidx18 = getelementptr [16 x i32]* %output2, i64 0, i64 %indvar2
95   %arrayidx15 = getelementptr [16 x i32]* %output, i64 0, i64 %indvar2
96   %arrayidx12 = getelementptr [16 x i32]* %input2, i64 0, i64 %indvar2
97   %i.0 = trunc i64 %indvar2 to i32
98   %cmp = icmp slt i32 %i.0, 16
99   br i1 %cmp, label %for.body, label %for.end
101 for.body:                                         ; preds = %for.cond
102   store i32 %tmp10, i32* %arrayidx, align 4
103   store i32 %tmp10, i32* %arrayidx12, align 4
104   store i32 0, i32* %arrayidx15, align 4
105   store i32 0, i32* %arrayidx18, align 4
106   %tmp22 = load i32* %arrayidx, align 4
107   %cmp23 = icmp sgt i32 %tmp22, 200
108   br i1 %cmp23, label %if.then, label %if.end
110 if.then:                                          ; preds = %for.body
111   call void @abort() noreturn nounwind
112   unreachable
114 if.end:                                           ; preds = %for.body
115   br label %for.inc
117 for.inc:                                          ; preds = %if.end
118   %inc = add nsw i32 %tmp10, 1
119   %indvar.next3 = add i64 %indvar2, 1
120   br label %for.cond
122 for.end:                                          ; preds = %for.cond
123   %arraydecay = getelementptr inbounds [16 x i32]* %input, i64 0, i64 0
124   %arraydecay25 = getelementptr inbounds [16 x i32]* %output, i64 0, i64 0
125   %arraydecay26 = getelementptr inbounds [16 x i32]* %input2, i64 0, i64 0
126   %arraydecay27 = getelementptr inbounds [16 x i32]* %output2, i64 0, i64 0
127   call void @foo(i32* %arraydecay, i32* %arraydecay25, i32* %arraydecay26, i32* %arraydecay27)
128   br label %for.cond28
130 for.cond28:                                       ; preds = %for.inc52, %for.end
131   %indvar = phi i64 [ %indvar.next, %for.inc52 ], [ 0, %for.end ]
132   %arrayidx47 = getelementptr [16 x i32]* %check_results2, i64 0, i64 %indvar
133   %arrayidx43 = getelementptr [16 x i32]* %output2, i64 0, i64 %indvar
134   %arrayidx38 = getelementptr [16 x i32]* %check_results, i64 0, i64 %indvar
135   %arrayidx34 = getelementptr [16 x i32]* %output, i64 0, i64 %indvar
136   %i.1 = trunc i64 %indvar to i32
137   %cmp30 = icmp slt i32 %i.1, 16
138   br i1 %cmp30, label %for.body31, label %for.end55
140 for.body31:                                       ; preds = %for.cond28
141   %tmp35 = load i32* %arrayidx34, align 4
142   %tmp39 = load i32* %arrayidx38, align 4
143   %cmp40 = icmp eq i32 %tmp35, %tmp39
144   br i1 %cmp40, label %lor.lhs.false, label %if.then50
146 lor.lhs.false:                                    ; preds = %for.body31
147   %tmp44 = load i32* %arrayidx43, align 4
148   %tmp48 = load i32* %arrayidx47, align 4
149   %cmp49 = icmp eq i32 %tmp44, %tmp48
150   br i1 %cmp49, label %if.end51, label %if.then50
152 if.then50:                                        ; preds = %lor.lhs.false, %for.body31
153   call void @abort() noreturn nounwind
154   unreachable
156 if.end51:                                         ; preds = %lor.lhs.false
157   br label %for.inc52
159 for.inc52:                                        ; preds = %if.end51
160   %indvar.next = add i64 %indvar, 1
161   br label %for.cond28
163 for.end55:                                        ; preds = %for.cond28
164   ret i32 0
167 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
169 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
171 define internal void @check_vect() nounwind uwtable noinline {
172 entry:
173   %a = alloca i32, align 4
174   %b = alloca i32, align 4
175   %c = alloca i32, align 4
176   %d = alloca i32, align 4
177   %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
178   %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
179   %tobool = icmp eq i32 %call1, 0
180   br i1 %tobool, label %if.then, label %lor.lhs.false
182 lor.lhs.false:                                    ; preds = %entry
183   %tmp4 = load i32* %d, align 4
184   %and6 = and i32 %tmp4, 67108864
185   %cmp = icmp eq i32 %and6, 0
186   br i1 %cmp, label %if.then, label %if.end
188 if.then:                                          ; preds = %entry, %lor.lhs.false
189   call void @exit(i32 0) noreturn nounwind
190   unreachable
192 if.end:                                           ; preds = %lor.lhs.false
193   %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
194   ret void
197 declare void @abort() noreturn
199 declare void (i32)* @signal(i32, void (i32)*) nounwind
201 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
202 entry:
203   call void @exit(i32 0) noreturn nounwind
204   unreachable
206 return:                                           ; No predecessors!
207   ret void
210 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
211 entry:
212   %and = and i32 %__level, -2147483648
213   %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
214   %cmp = icmp ult i32 %call, %__level
215   br i1 %cmp, label %if.then, label %if.end
217 if.then:                                          ; preds = %entry
218   br label %return
220 if.end:                                           ; preds = %entry
221   %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
222   %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
223   %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
224   %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
225   %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
226   store i32 %asmresult, i32* %__eax, align 4
227   store i32 %asmresult8, i32* %__ebx, align 4
228   store i32 %asmresult9, i32* %__ecx, align 4
229   store i32 %asmresult10, i32* %__edx, align 4
230   br label %return
232 return:                                           ; preds = %if.end, %if.then
233   %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
234   ret i32 %retval.0
237 declare void @exit(i32) noreturn
239 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
240 entry:
241   %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
242   %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
243   %tobool = icmp eq i32* %__sig, null
244   br i1 %tobool, label %if.end, label %if.then
246 if.then:                                          ; preds = %entry
247   %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
248   store i32 %asmresult1, i32* %__sig, align 4
249   br label %if.end
251 if.end:                                           ; preds = %entry, %if.then
252   ret i32 %asmresult
255 !0 = metadata !{i32 -2147342500, i32 -2147342492} 
256 !1 = metadata !{i32 -2147342623, i32 -2147342615} 
257 ; CHECK: define