Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-24.ll
blobe461d510bebf35dc07df9a5bf5064822fd19ec7e
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-24.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer vect-24.s > vect-24.ll
6 ; ModuleID = 'vect-24.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 @main1.ib = internal unnamed_addr constant [64 x i32] [i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0], align 16
11 @main1.ic = internal unnamed_addr constant [64 x i32] [i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0], align 16
12 @main1.cb = internal unnamed_addr constant [64 x i8] c"\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00", align 16
13 @main1.cc = internal unnamed_addr constant [64 x i8] c"\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00\01\01\00\00\01\00\01\00", align 16
14 @main1.sb = internal unnamed_addr constant [64 x i16] [i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0], align 16
15 @main1.sc = internal unnamed_addr constant [64 x i16] [i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0, i16 1, i16 1, i16 0, i16 0, i16 1, i16 0, i16 1, i16 0], align 16
17 define i32 @main1() nounwind uwtable noinline {
18 entry:
19   %ia = alloca [64 x i32], align 16
20   %ib = alloca [64 x i32], align 16
21   %ic = alloca [64 x i32], align 16
22   %ca = alloca [64 x i8], align 16
23   %cb = alloca [64 x i8], align 16
24   %cc = alloca [64 x i8], align 16
25   %sa = alloca [64 x i16], align 16
26   %sb = alloca [64 x i16], align 16
27   %sc = alloca [64 x i16], align 16
28   %tmp = bitcast [64 x i32]* %ib to i8*
29   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* bitcast ([64 x i32]* @main1.ib to i8*), i64 256, i32 16, i1 false)
30   %tmp2 = bitcast [64 x i32]* %ic to i8*
31   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* bitcast ([64 x i32]* @main1.ic to i8*), i64 256, i32 16, i1 false)
32   %tmp5 = getelementptr inbounds [64 x i8]* %cb, i64 0, i64 0
33   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp5, i8* getelementptr inbounds ([64 x i8]* @main1.cb, i64 0, i64 0), i64 64, i32 16, i1 false)
34   %tmp7 = getelementptr inbounds [64 x i8]* %cc, i64 0, i64 0
35   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp7, i8* getelementptr inbounds ([64 x i8]* @main1.cc, i64 0, i64 0), i64 64, i32 16, i1 false)
36   %tmp10 = bitcast [64 x i16]* %sb to i8*
37   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp10, i8* bitcast ([64 x i16]* @main1.sb to i8*), i64 128, i32 16, i1 false)
38   %tmp12 = bitcast [64 x i16]* %sc to i8*
39   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp12, i8* bitcast ([64 x i16]* @main1.sc to i8*), i64 128, i32 16, i1 false)
40   br label %for.cond
42 for.cond:                                         ; preds = %for.inc, %entry
43   %indvar17 = phi i64 [ %indvar.next18, %for.inc ], [ 0, %entry ]
44   %arrayidx18 = getelementptr [64 x i32]* %ic, i64 0, i64 %indvar17
45   %arrayidx23 = getelementptr [64 x i32]* %ia, i64 0, i64 %indvar17
46   %arrayidx = getelementptr [64 x i32]* %ib, i64 0, i64 %indvar17
47   %exitcond19 = icmp ne i64 %indvar17, 64
48   br i1 %exitcond19, label %for.body, label %for.end
50 for.body:                                         ; preds = %for.cond
51   %tmp15 = load i32* %arrayidx, align 4
52   %tobool = icmp eq i32 %tmp15, 0
53   br i1 %tobool, label %lor.rhs, label %lor.end
55 lor.rhs:                                          ; preds = %for.body
56   %tmp19 = load i32* %arrayidx18, align 4
57   %tobool20 = icmp ne i32 %tmp19, 0
58   br label %lor.end
60 lor.end:                                          ; preds = %for.body, %lor.rhs
61   %tmp21 = phi i1 [ true, %for.body ], [ %tobool20, %lor.rhs ]
62   %lor.ext = zext i1 %tmp21 to i32
63   store i32 %lor.ext, i32* %arrayidx23, align 4
64   br label %for.inc
66 for.inc:                                          ; preds = %lor.end
67   %indvar.next18 = add i64 %indvar17, 1
68   br label %for.cond
70 for.end:                                          ; preds = %for.cond
71   br label %for.cond25
73 for.cond25:                                       ; preds = %for.inc47, %for.end
74   %indvar14 = phi i64 [ %indvar.next15, %for.inc47 ], [ 0, %for.end ]
75   %arrayidx41 = getelementptr [64 x i32]* %ic, i64 0, i64 %indvar14
76   %arrayidx35 = getelementptr [64 x i32]* %ib, i64 0, i64 %indvar14
77   %arrayidx31 = getelementptr [64 x i32]* %ia, i64 0, i64 %indvar14
78   %i.1 = trunc i64 %indvar14 to i32
79   %cmp27 = icmp slt i32 %i.1, 64
80   br i1 %cmp27, label %for.body28, label %for.end50
82 for.body28:                                       ; preds = %for.cond25
83   %tmp32 = load i32* %arrayidx31, align 4
84   %tmp36 = load i32* %arrayidx35, align 4
85   %tobool37 = icmp eq i32 %tmp36, 0
86   br i1 %tobool37, label %lor.rhs38, label %lor.end44
88 lor.rhs38:                                        ; preds = %for.body28
89   %tmp42 = load i32* %arrayidx41, align 4
90   %tobool43 = icmp ne i32 %tmp42, 0
91   br label %lor.end44
93 lor.end44:                                        ; preds = %for.body28, %lor.rhs38
94   %tmp22 = phi i1 [ true, %for.body28 ], [ %tobool43, %lor.rhs38 ]
95   %lor.ext45 = zext i1 %tmp22 to i32
96   %cmp46 = icmp eq i32 %tmp32, %lor.ext45
97   br i1 %cmp46, label %if.end, label %if.then
99 if.then:                                          ; preds = %lor.end44
100   call void @abort() noreturn nounwind
101   unreachable
103 if.end:                                           ; preds = %lor.end44
104   br label %for.inc47
106 for.inc47:                                        ; preds = %if.end
107   %indvar.next15 = add i64 %indvar14, 1
108   br label %for.cond25
110 for.end50:                                        ; preds = %for.cond25
111   br label %for.cond51
113 for.cond51:                                       ; preds = %for.inc73, %for.end50
114   %indvar9 = phi i64 [ %indvar.next10, %for.inc73 ], [ 0, %for.end50 ]
115   %arrayidx63 = getelementptr [64 x i8]* %cc, i64 0, i64 %indvar9
116   %arrayidx72 = getelementptr [64 x i8]* %ca, i64 0, i64 %indvar9
117   %arrayidx57 = getelementptr [64 x i8]* %cb, i64 0, i64 %indvar9
118   %exitcond11 = icmp ne i64 %indvar9, 64
119   br i1 %exitcond11, label %for.body54, label %for.end76
121 for.body54:                                       ; preds = %for.cond51
122   %tmp58 = load i8* %arrayidx57, align 1
123   %tobool59 = icmp eq i8 %tmp58, 0
124   br i1 %tobool59, label %lor.rhs60, label %lor.end67
126 lor.rhs60:                                        ; preds = %for.body54
127   %tmp64 = load i8* %arrayidx63, align 1
128   %tobool66 = icmp ne i8 %tmp64, 0
129   br label %lor.end67
131 lor.end67:                                        ; preds = %for.body54, %lor.rhs60
132   %tmp23 = phi i1 [ true, %for.body54 ], [ %tobool66, %lor.rhs60 ]
133   %conv69 = zext i1 %tmp23 to i8
134   store i8 %conv69, i8* %arrayidx72, align 1
135   br label %for.inc73
137 for.inc73:                                        ; preds = %lor.end67
138   %indvar.next10 = add i64 %indvar9, 1
139   br label %for.cond51
141 for.end76:                                        ; preds = %for.cond51
142   br label %for.cond77
144 for.cond77:                                       ; preds = %for.inc106, %for.end76
145   %indvar5 = phi i64 [ %indvar.next6, %for.inc106 ], [ 0, %for.end76 ]
146   %arrayidx96 = getelementptr [64 x i8]* %cc, i64 0, i64 %indvar5
147   %arrayidx89 = getelementptr [64 x i8]* %cb, i64 0, i64 %indvar5
148   %arrayidx84 = getelementptr [64 x i8]* %ca, i64 0, i64 %indvar5
149   %i.3 = trunc i64 %indvar5 to i32
150   %cmp79 = icmp slt i32 %i.3, 64
151   br i1 %cmp79, label %for.body81, label %for.end109
153 for.body81:                                       ; preds = %for.cond77
154   %tmp85 = load i8* %arrayidx84, align 1
155   %conv86 = sext i8 %tmp85 to i32
156   %tmp90 = load i8* %arrayidx89, align 1
157   %tobool92 = icmp eq i8 %tmp90, 0
158   br i1 %tobool92, label %lor.rhs93, label %lor.end100
160 lor.rhs93:                                        ; preds = %for.body81
161   %tmp97 = load i8* %arrayidx96, align 1
162   %tobool99 = icmp ne i8 %tmp97, 0
163   br label %lor.end100
165 lor.end100:                                       ; preds = %for.body81, %lor.rhs93
166   %tmp24 = phi i1 [ true, %for.body81 ], [ %tobool99, %lor.rhs93 ]
167   %lor.ext101 = zext i1 %tmp24 to i32
168   %cmp102 = icmp eq i32 %conv86, %lor.ext101
169   br i1 %cmp102, label %if.end105, label %if.then104
171 if.then104:                                       ; preds = %lor.end100
172   call void @abort() noreturn nounwind
173   unreachable
175 if.end105:                                        ; preds = %lor.end100
176   br label %for.inc106
178 for.inc106:                                       ; preds = %if.end105
179   %indvar.next6 = add i64 %indvar5, 1
180   br label %for.cond77
182 for.end109:                                       ; preds = %for.cond77
183   br label %for.cond110
185 for.cond110:                                      ; preds = %for.inc134, %for.end109
186   %indvar2 = phi i64 [ %indvar.next3, %for.inc134 ], [ 0, %for.end109 ]
187   %arrayidx124 = getelementptr [64 x i16]* %sc, i64 0, i64 %indvar2
188   %arrayidx133 = getelementptr [64 x i16]* %sa, i64 0, i64 %indvar2
189   %arrayidx117 = getelementptr [64 x i16]* %sb, i64 0, i64 %indvar2
190   %exitcond = icmp ne i64 %indvar2, 64
191   br i1 %exitcond, label %for.body114, label %for.end137
193 for.body114:                                      ; preds = %for.cond110
194   %tmp118 = load i16* %arrayidx117, align 2
195   %tobool120 = icmp eq i16 %tmp118, 0
196   br i1 %tobool120, label %lor.rhs121, label %lor.end128
198 lor.rhs121:                                       ; preds = %for.body114
199   %tmp125 = load i16* %arrayidx124, align 2
200   %tobool127 = icmp ne i16 %tmp125, 0
201   br label %lor.end128
203 lor.end128:                                       ; preds = %for.body114, %lor.rhs121
204   %tmp25 = phi i1 [ true, %for.body114 ], [ %tobool127, %lor.rhs121 ]
205   %conv130 = zext i1 %tmp25 to i16
206   store i16 %conv130, i16* %arrayidx133, align 2
207   br label %for.inc134
209 for.inc134:                                       ; preds = %lor.end128
210   %indvar.next3 = add i64 %indvar2, 1
211   br label %for.cond110
213 for.end137:                                       ; preds = %for.cond110
214   br label %for.cond138
216 for.cond138:                                      ; preds = %for.inc167, %for.end137
217   %indvar = phi i64 [ %indvar.next, %for.inc167 ], [ 0, %for.end137 ]
218   %arrayidx157 = getelementptr [64 x i16]* %sc, i64 0, i64 %indvar
219   %arrayidx150 = getelementptr [64 x i16]* %sb, i64 0, i64 %indvar
220   %arrayidx145 = getelementptr [64 x i16]* %sa, i64 0, i64 %indvar
221   %i.5 = trunc i64 %indvar to i32
222   %cmp140 = icmp slt i32 %i.5, 64
223   br i1 %cmp140, label %for.body142, label %for.end170
225 for.body142:                                      ; preds = %for.cond138
226   %tmp146 = load i16* %arrayidx145, align 2
227   %conv147 = sext i16 %tmp146 to i32
228   %tmp151 = load i16* %arrayidx150, align 2
229   %tobool153 = icmp eq i16 %tmp151, 0
230   br i1 %tobool153, label %lor.rhs154, label %lor.end161
232 lor.rhs154:                                       ; preds = %for.body142
233   %tmp158 = load i16* %arrayidx157, align 2
234   %tobool160 = icmp ne i16 %tmp158, 0
235   br label %lor.end161
237 lor.end161:                                       ; preds = %for.body142, %lor.rhs154
238   %tmp26 = phi i1 [ true, %for.body142 ], [ %tobool160, %lor.rhs154 ]
239   %lor.ext162 = zext i1 %tmp26 to i32
240   %cmp163 = icmp eq i32 %conv147, %lor.ext162
241   br i1 %cmp163, label %if.end166, label %if.then165
243 if.then165:                                       ; preds = %lor.end161
244   call void @abort() noreturn nounwind
245   unreachable
247 if.end166:                                        ; preds = %lor.end161
248   br label %for.inc167
250 for.inc167:                                       ; preds = %if.end166
251   %indvar.next = add i64 %indvar, 1
252   br label %for.cond138
254 for.end170:                                       ; preds = %for.cond138
255   ret i32 0
258 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
260 declare void @abort() noreturn
262 define i32 @main() nounwind uwtable {
263 entry:
264   call void @check_vect()
265   %call = call i32 @main1()
266   ret i32 %call
269 define internal void @check_vect() nounwind uwtable noinline {
270 entry:
271   %a = alloca i32, align 4
272   %b = alloca i32, align 4
273   %c = alloca i32, align 4
274   %d = alloca i32, align 4
275   %call = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* @sig_ill_handler) nounwind
276   %call1 = call i32 @__get_cpuid(i32 1, i32* %a, i32* %b, i32* %c, i32* %d)
277   %tobool = icmp eq i32 %call1, 0
278   br i1 %tobool, label %if.then, label %lor.lhs.false
280 lor.lhs.false:                                    ; preds = %entry
281   %tmp4 = load i32* %d, align 4
282   %and6 = and i32 %tmp4, 67108864
283   %cmp = icmp eq i32 %and6, 0
284   br i1 %cmp, label %if.then, label %if.end
286 if.then:                                          ; preds = %entry, %lor.lhs.false
287   call void @exit(i32 0) noreturn nounwind
288   unreachable
290 if.end:                                           ; preds = %lor.lhs.false
291   %call7 = call void (i32)* (i32, void (i32)*)* @signal(i32 4, void (i32)* null) nounwind
292   ret void
295 declare void (i32)* @signal(i32, void (i32)*) nounwind
297 define internal void @sig_ill_handler(i32 %sig) nounwind uwtable {
298 entry:
299   call void @exit(i32 0) noreturn nounwind
300   unreachable
302 return:                                           ; No predecessors!
303   ret void
306 define internal i32 @__get_cpuid(i32 %__level, i32* %__eax, i32* %__ebx, i32* %__ecx, i32* %__edx) nounwind uwtable inlinehint {
307 entry:
308   %and = and i32 %__level, -2147483648
309   %call = call i32 @__get_cpuid_max(i32 %and, i32* null)
310   %cmp = icmp ult i32 %call, %__level
311   br i1 %cmp, label %if.then, label %if.end
313 if.then:                                          ; preds = %entry
314   br label %return
316 if.end:                                           ; preds = %entry
317   %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__level) nounwind, !srcloc !0
318   %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
319   %asmresult8 = extractvalue { i32, i32, i32, i32 } %tmp, 1
320   %asmresult9 = extractvalue { i32, i32, i32, i32 } %tmp, 2
321   %asmresult10 = extractvalue { i32, i32, i32, i32 } %tmp, 3
322   store i32 %asmresult, i32* %__eax, align 4
323   store i32 %asmresult8, i32* %__ebx, align 4
324   store i32 %asmresult9, i32* %__ecx, align 4
325   store i32 %asmresult10, i32* %__edx, align 4
326   br label %return
328 return:                                           ; preds = %if.end, %if.then
329   %retval.0 = phi i32 [ 0, %if.then ], [ 1, %if.end ]
330   ret i32 %retval.0
333 declare void @exit(i32) noreturn
335 define internal i32 @__get_cpuid_max(i32 %__ext, i32* %__sig) nounwind uwtable inlinehint {
336 entry:
337   %tmp = call { i32, i32, i32, i32 } asm "cpuid\0A\09", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %__ext) nounwind, !srcloc !1
338   %asmresult = extractvalue { i32, i32, i32, i32 } %tmp, 0
339   %tobool = icmp eq i32* %__sig, null
340   br i1 %tobool, label %if.end, label %if.then
342 if.then:                                          ; preds = %entry
343   %asmresult1 = extractvalue { i32, i32, i32, i32 } %tmp, 1
344   store i32 %asmresult1, i32* %__sig, align 4
345   br label %if.end
347 if.end:                                           ; preds = %entry, %if.then
348   ret i32 %asmresult
351 !0 = metadata !{i32 -2147342035, i32 -2147342027} 
352 !1 = metadata !{i32 -2147342158, i32 -2147342150} 
353 ; CHECK: define