1 ; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce -instcombine -S | FileCheck %s
3 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-S128"
5 ;CHECK-LABEL: @sqrt_f32(
6 ;CHECK: llvm.sqrt.v4f32
8 define void @sqrt_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
10 %cmp6 = icmp sgt i32 %n, 0
11 br i1 %cmp6, label %for.body, label %for.end
13 for.body: ; preds = %entry, %for.body
14 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
15 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
16 %0 = load float, float* %arrayidx, align 4
17 %call = tail call float @llvm.sqrt.f32(float %0) nounwind readnone
18 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
19 store float %call, float* %arrayidx2, align 4
20 %indvars.iv.next = add i64 %indvars.iv, 1
21 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
22 %exitcond = icmp eq i32 %lftr.wideiv, %n
23 br i1 %exitcond, label %for.end, label %for.body
25 for.end: ; preds = %for.body, %entry
29 declare float @llvm.sqrt.f32(float) nounwind readnone
31 ;CHECK-LABEL: @sqrt_f64(
32 ;CHECK: llvm.sqrt.v4f64
34 define void @sqrt_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
36 %cmp6 = icmp sgt i32 %n, 0
37 br i1 %cmp6, label %for.body, label %for.end
39 for.body: ; preds = %entry, %for.body
40 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
41 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
42 %0 = load double, double* %arrayidx, align 8
43 %call = tail call double @llvm.sqrt.f64(double %0) nounwind readnone
44 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
45 store double %call, double* %arrayidx2, align 8
46 %indvars.iv.next = add i64 %indvars.iv, 1
47 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
48 %exitcond = icmp eq i32 %lftr.wideiv, %n
49 br i1 %exitcond, label %for.end, label %for.body
51 for.end: ; preds = %for.body, %entry
55 declare double @llvm.sqrt.f64(double) nounwind readnone
57 ;CHECK-LABEL: @sin_f32(
58 ;CHECK: llvm.sin.v4f32
60 define void @sin_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
62 %cmp6 = icmp sgt i32 %n, 0
63 br i1 %cmp6, label %for.body, label %for.end
65 for.body: ; preds = %entry, %for.body
66 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
67 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
68 %0 = load float, float* %arrayidx, align 4
69 %call = tail call float @llvm.sin.f32(float %0) nounwind readnone
70 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
71 store float %call, float* %arrayidx2, align 4
72 %indvars.iv.next = add i64 %indvars.iv, 1
73 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
74 %exitcond = icmp eq i32 %lftr.wideiv, %n
75 br i1 %exitcond, label %for.end, label %for.body
77 for.end: ; preds = %for.body, %entry
81 declare float @llvm.sin.f32(float) nounwind readnone
83 ;CHECK-LABEL: @sin_f64(
84 ;CHECK: llvm.sin.v4f64
86 define void @sin_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
88 %cmp6 = icmp sgt i32 %n, 0
89 br i1 %cmp6, label %for.body, label %for.end
91 for.body: ; preds = %entry, %for.body
92 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
93 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
94 %0 = load double, double* %arrayidx, align 8
95 %call = tail call double @llvm.sin.f64(double %0) nounwind readnone
96 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
97 store double %call, double* %arrayidx2, align 8
98 %indvars.iv.next = add i64 %indvars.iv, 1
99 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
100 %exitcond = icmp eq i32 %lftr.wideiv, %n
101 br i1 %exitcond, label %for.end, label %for.body
103 for.end: ; preds = %for.body, %entry
107 declare double @llvm.sin.f64(double) nounwind readnone
109 ;CHECK-LABEL: @cos_f32(
110 ;CHECK: llvm.cos.v4f32
112 define void @cos_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
114 %cmp6 = icmp sgt i32 %n, 0
115 br i1 %cmp6, label %for.body, label %for.end
117 for.body: ; preds = %entry, %for.body
118 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
119 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
120 %0 = load float, float* %arrayidx, align 4
121 %call = tail call float @llvm.cos.f32(float %0) nounwind readnone
122 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
123 store float %call, float* %arrayidx2, align 4
124 %indvars.iv.next = add i64 %indvars.iv, 1
125 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
126 %exitcond = icmp eq i32 %lftr.wideiv, %n
127 br i1 %exitcond, label %for.end, label %for.body
129 for.end: ; preds = %for.body, %entry
133 declare float @llvm.cos.f32(float) nounwind readnone
135 ;CHECK-LABEL: @cos_f64(
136 ;CHECK: llvm.cos.v4f64
138 define void @cos_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
140 %cmp6 = icmp sgt i32 %n, 0
141 br i1 %cmp6, label %for.body, label %for.end
143 for.body: ; preds = %entry, %for.body
144 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
145 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
146 %0 = load double, double* %arrayidx, align 8
147 %call = tail call double @llvm.cos.f64(double %0) nounwind readnone
148 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
149 store double %call, double* %arrayidx2, align 8
150 %indvars.iv.next = add i64 %indvars.iv, 1
151 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
152 %exitcond = icmp eq i32 %lftr.wideiv, %n
153 br i1 %exitcond, label %for.end, label %for.body
155 for.end: ; preds = %for.body, %entry
159 declare double @llvm.cos.f64(double) nounwind readnone
161 ;CHECK-LABEL: @exp_f32(
162 ;CHECK: llvm.exp.v4f32
164 define void @exp_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
166 %cmp6 = icmp sgt i32 %n, 0
167 br i1 %cmp6, label %for.body, label %for.end
169 for.body: ; preds = %entry, %for.body
170 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
171 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
172 %0 = load float, float* %arrayidx, align 4
173 %call = tail call float @llvm.exp.f32(float %0) nounwind readnone
174 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
175 store float %call, float* %arrayidx2, align 4
176 %indvars.iv.next = add i64 %indvars.iv, 1
177 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
178 %exitcond = icmp eq i32 %lftr.wideiv, %n
179 br i1 %exitcond, label %for.end, label %for.body
181 for.end: ; preds = %for.body, %entry
185 declare float @llvm.exp.f32(float) nounwind readnone
187 ;CHECK-LABEL: @exp_f64(
188 ;CHECK: llvm.exp.v4f64
190 define void @exp_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
192 %cmp6 = icmp sgt i32 %n, 0
193 br i1 %cmp6, label %for.body, label %for.end
195 for.body: ; preds = %entry, %for.body
196 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
197 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
198 %0 = load double, double* %arrayidx, align 8
199 %call = tail call double @llvm.exp.f64(double %0) nounwind readnone
200 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
201 store double %call, double* %arrayidx2, align 8
202 %indvars.iv.next = add i64 %indvars.iv, 1
203 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
204 %exitcond = icmp eq i32 %lftr.wideiv, %n
205 br i1 %exitcond, label %for.end, label %for.body
207 for.end: ; preds = %for.body, %entry
211 declare double @llvm.exp.f64(double) nounwind readnone
213 ;CHECK-LABEL: @exp2_f32(
214 ;CHECK: llvm.exp2.v4f32
216 define void @exp2_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
218 %cmp6 = icmp sgt i32 %n, 0
219 br i1 %cmp6, label %for.body, label %for.end
221 for.body: ; preds = %entry, %for.body
222 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
223 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
224 %0 = load float, float* %arrayidx, align 4
225 %call = tail call float @llvm.exp2.f32(float %0) nounwind readnone
226 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
227 store float %call, float* %arrayidx2, align 4
228 %indvars.iv.next = add i64 %indvars.iv, 1
229 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
230 %exitcond = icmp eq i32 %lftr.wideiv, %n
231 br i1 %exitcond, label %for.end, label %for.body
233 for.end: ; preds = %for.body, %entry
237 declare float @llvm.exp2.f32(float) nounwind readnone
239 ;CHECK-LABEL: @exp2_f64(
240 ;CHECK: llvm.exp2.v4f64
242 define void @exp2_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
244 %cmp6 = icmp sgt i32 %n, 0
245 br i1 %cmp6, label %for.body, label %for.end
247 for.body: ; preds = %entry, %for.body
248 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
249 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
250 %0 = load double, double* %arrayidx, align 8
251 %call = tail call double @llvm.exp2.f64(double %0) nounwind readnone
252 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
253 store double %call, double* %arrayidx2, align 8
254 %indvars.iv.next = add i64 %indvars.iv, 1
255 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
256 %exitcond = icmp eq i32 %lftr.wideiv, %n
257 br i1 %exitcond, label %for.end, label %for.body
259 for.end: ; preds = %for.body, %entry
263 declare double @llvm.exp2.f64(double) nounwind readnone
265 ;CHECK-LABEL: @log_f32(
266 ;CHECK: llvm.log.v4f32
268 define void @log_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
270 %cmp6 = icmp sgt i32 %n, 0
271 br i1 %cmp6, label %for.body, label %for.end
273 for.body: ; preds = %entry, %for.body
274 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
275 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
276 %0 = load float, float* %arrayidx, align 4
277 %call = tail call float @llvm.log.f32(float %0) nounwind readnone
278 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
279 store float %call, float* %arrayidx2, align 4
280 %indvars.iv.next = add i64 %indvars.iv, 1
281 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
282 %exitcond = icmp eq i32 %lftr.wideiv, %n
283 br i1 %exitcond, label %for.end, label %for.body
285 for.end: ; preds = %for.body, %entry
289 declare float @llvm.log.f32(float) nounwind readnone
291 ;CHECK-LABEL: @log_f64(
292 ;CHECK: llvm.log.v4f64
294 define void @log_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
296 %cmp6 = icmp sgt i32 %n, 0
297 br i1 %cmp6, label %for.body, label %for.end
299 for.body: ; preds = %entry, %for.body
300 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
301 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
302 %0 = load double, double* %arrayidx, align 8
303 %call = tail call double @llvm.log.f64(double %0) nounwind readnone
304 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
305 store double %call, double* %arrayidx2, align 8
306 %indvars.iv.next = add i64 %indvars.iv, 1
307 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
308 %exitcond = icmp eq i32 %lftr.wideiv, %n
309 br i1 %exitcond, label %for.end, label %for.body
311 for.end: ; preds = %for.body, %entry
315 declare double @llvm.log.f64(double) nounwind readnone
317 ;CHECK-LABEL: @log10_f32(
318 ;CHECK: llvm.log10.v4f32
320 define void @log10_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
322 %cmp6 = icmp sgt i32 %n, 0
323 br i1 %cmp6, label %for.body, label %for.end
325 for.body: ; preds = %entry, %for.body
326 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
327 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
328 %0 = load float, float* %arrayidx, align 4
329 %call = tail call float @llvm.log10.f32(float %0) nounwind readnone
330 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
331 store float %call, float* %arrayidx2, align 4
332 %indvars.iv.next = add i64 %indvars.iv, 1
333 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
334 %exitcond = icmp eq i32 %lftr.wideiv, %n
335 br i1 %exitcond, label %for.end, label %for.body
337 for.end: ; preds = %for.body, %entry
341 declare float @llvm.log10.f32(float) nounwind readnone
343 ;CHECK-LABEL: @log10_f64(
344 ;CHECK: llvm.log10.v4f64
346 define void @log10_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
348 %cmp6 = icmp sgt i32 %n, 0
349 br i1 %cmp6, label %for.body, label %for.end
351 for.body: ; preds = %entry, %for.body
352 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
353 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
354 %0 = load double, double* %arrayidx, align 8
355 %call = tail call double @llvm.log10.f64(double %0) nounwind readnone
356 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
357 store double %call, double* %arrayidx2, align 8
358 %indvars.iv.next = add i64 %indvars.iv, 1
359 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
360 %exitcond = icmp eq i32 %lftr.wideiv, %n
361 br i1 %exitcond, label %for.end, label %for.body
363 for.end: ; preds = %for.body, %entry
367 declare double @llvm.log10.f64(double) nounwind readnone
369 ;CHECK-LABEL: @log2_f32(
370 ;CHECK: llvm.log2.v4f32
372 define void @log2_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
374 %cmp6 = icmp sgt i32 %n, 0
375 br i1 %cmp6, label %for.body, label %for.end
377 for.body: ; preds = %entry, %for.body
378 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
379 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
380 %0 = load float, float* %arrayidx, align 4
381 %call = tail call float @llvm.log2.f32(float %0) nounwind readnone
382 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
383 store float %call, float* %arrayidx2, align 4
384 %indvars.iv.next = add i64 %indvars.iv, 1
385 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
386 %exitcond = icmp eq i32 %lftr.wideiv, %n
387 br i1 %exitcond, label %for.end, label %for.body
389 for.end: ; preds = %for.body, %entry
393 declare float @llvm.log2.f32(float) nounwind readnone
395 ;CHECK-LABEL: @log2_f64(
396 ;CHECK: llvm.log2.v4f64
398 define void @log2_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
400 %cmp6 = icmp sgt i32 %n, 0
401 br i1 %cmp6, label %for.body, label %for.end
403 for.body: ; preds = %entry, %for.body
404 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
405 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
406 %0 = load double, double* %arrayidx, align 8
407 %call = tail call double @llvm.log2.f64(double %0) nounwind readnone
408 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
409 store double %call, double* %arrayidx2, align 8
410 %indvars.iv.next = add i64 %indvars.iv, 1
411 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
412 %exitcond = icmp eq i32 %lftr.wideiv, %n
413 br i1 %exitcond, label %for.end, label %for.body
415 for.end: ; preds = %for.body, %entry
419 declare double @llvm.log2.f64(double) nounwind readnone
421 ;CHECK-LABEL: @fabs_f32(
422 ;CHECK: llvm.fabs.v4f32
424 define void @fabs_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
426 %cmp6 = icmp sgt i32 %n, 0
427 br i1 %cmp6, label %for.body, label %for.end
429 for.body: ; preds = %entry, %for.body
430 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
431 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
432 %0 = load float, float* %arrayidx, align 4
433 %call = tail call float @llvm.fabs.f32(float %0) nounwind readnone
434 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
435 store float %call, float* %arrayidx2, align 4
436 %indvars.iv.next = add i64 %indvars.iv, 1
437 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
438 %exitcond = icmp eq i32 %lftr.wideiv, %n
439 br i1 %exitcond, label %for.end, label %for.body
441 for.end: ; preds = %for.body, %entry
445 declare float @llvm.fabs.f32(float) nounwind readnone
447 define void @fabs_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
449 %cmp6 = icmp sgt i32 %n, 0
450 br i1 %cmp6, label %for.body, label %for.end
452 for.body: ; preds = %entry, %for.body
453 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
454 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
455 %0 = load double, double* %arrayidx, align 8
456 %call = tail call double @llvm.fabs(double %0) nounwind readnone
457 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
458 store double %call, double* %arrayidx2, align 8
459 %indvars.iv.next = add i64 %indvars.iv, 1
460 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
461 %exitcond = icmp eq i32 %lftr.wideiv, %n
462 br i1 %exitcond, label %for.end, label %for.body
464 for.end: ; preds = %for.body, %entry
468 declare double @llvm.fabs(double) nounwind readnone
470 ;CHECK-LABEL: @copysign_f32(
471 ;CHECK: llvm.copysign.v4f32
473 define void @copysign_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z) nounwind uwtable {
475 %cmp6 = icmp sgt i32 %n, 0
476 br i1 %cmp6, label %for.body, label %for.end
478 for.body: ; preds = %entry, %for.body
479 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
480 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
481 %0 = load float, float* %arrayidx, align 4
482 %arrayidx1 = getelementptr inbounds float, float* %z, i64 %indvars.iv
483 %1 = load float, float* %arrayidx1, align 4
484 %call = tail call float @llvm.copysign.f32(float %0, float %1) nounwind readnone
485 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
486 store float %call, float* %arrayidx2, align 4
487 %indvars.iv.next = add i64 %indvars.iv, 1
488 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
489 %exitcond = icmp eq i32 %lftr.wideiv, %n
490 br i1 %exitcond, label %for.end, label %for.body
492 for.end: ; preds = %for.body, %entry
496 declare float @llvm.copysign.f32(float, float) nounwind readnone
498 define void @copysign_f64(i32 %n, double* noalias %y, double* noalias %x, double* noalias %z) nounwind uwtable {
500 %cmp6 = icmp sgt i32 %n, 0
501 br i1 %cmp6, label %for.body, label %for.end
503 for.body: ; preds = %entry, %for.body
504 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
505 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
506 %0 = load double, double* %arrayidx, align 8
507 %arrayidx1 = getelementptr inbounds double, double* %z, i64 %indvars.iv
508 %1 = load double, double* %arrayidx, align 8
509 %call = tail call double @llvm.copysign(double %0, double %1) nounwind readnone
510 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
511 store double %call, double* %arrayidx2, align 8
512 %indvars.iv.next = add i64 %indvars.iv, 1
513 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
514 %exitcond = icmp eq i32 %lftr.wideiv, %n
515 br i1 %exitcond, label %for.end, label %for.body
517 for.end: ; preds = %for.body, %entry
521 declare double @llvm.copysign(double, double) nounwind readnone
523 ;CHECK-LABEL: @floor_f32(
524 ;CHECK: llvm.floor.v4f32
526 define void @floor_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
528 %cmp6 = icmp sgt i32 %n, 0
529 br i1 %cmp6, label %for.body, label %for.end
531 for.body: ; preds = %entry, %for.body
532 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
533 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
534 %0 = load float, float* %arrayidx, align 4
535 %call = tail call float @llvm.floor.f32(float %0) nounwind readnone
536 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
537 store float %call, float* %arrayidx2, align 4
538 %indvars.iv.next = add i64 %indvars.iv, 1
539 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
540 %exitcond = icmp eq i32 %lftr.wideiv, %n
541 br i1 %exitcond, label %for.end, label %for.body
543 for.end: ; preds = %for.body, %entry
547 declare float @llvm.floor.f32(float) nounwind readnone
549 ;CHECK-LABEL: @floor_f64(
550 ;CHECK: llvm.floor.v4f64
552 define void @floor_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
554 %cmp6 = icmp sgt i32 %n, 0
555 br i1 %cmp6, label %for.body, label %for.end
557 for.body: ; preds = %entry, %for.body
558 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
559 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
560 %0 = load double, double* %arrayidx, align 8
561 %call = tail call double @llvm.floor.f64(double %0) nounwind readnone
562 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
563 store double %call, double* %arrayidx2, align 8
564 %indvars.iv.next = add i64 %indvars.iv, 1
565 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
566 %exitcond = icmp eq i32 %lftr.wideiv, %n
567 br i1 %exitcond, label %for.end, label %for.body
569 for.end: ; preds = %for.body, %entry
573 declare double @llvm.floor.f64(double) nounwind readnone
575 ;CHECK-LABEL: @ceil_f32(
576 ;CHECK: llvm.ceil.v4f32
578 define void @ceil_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
580 %cmp6 = icmp sgt i32 %n, 0
581 br i1 %cmp6, label %for.body, label %for.end
583 for.body: ; preds = %entry, %for.body
584 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
585 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
586 %0 = load float, float* %arrayidx, align 4
587 %call = tail call float @llvm.ceil.f32(float %0) nounwind readnone
588 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
589 store float %call, float* %arrayidx2, align 4
590 %indvars.iv.next = add i64 %indvars.iv, 1
591 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
592 %exitcond = icmp eq i32 %lftr.wideiv, %n
593 br i1 %exitcond, label %for.end, label %for.body
595 for.end: ; preds = %for.body, %entry
599 declare float @llvm.ceil.f32(float) nounwind readnone
601 ;CHECK-LABEL: @ceil_f64(
602 ;CHECK: llvm.ceil.v4f64
604 define void @ceil_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
606 %cmp6 = icmp sgt i32 %n, 0
607 br i1 %cmp6, label %for.body, label %for.end
609 for.body: ; preds = %entry, %for.body
610 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
611 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
612 %0 = load double, double* %arrayidx, align 8
613 %call = tail call double @llvm.ceil.f64(double %0) nounwind readnone
614 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
615 store double %call, double* %arrayidx2, align 8
616 %indvars.iv.next = add i64 %indvars.iv, 1
617 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
618 %exitcond = icmp eq i32 %lftr.wideiv, %n
619 br i1 %exitcond, label %for.end, label %for.body
621 for.end: ; preds = %for.body, %entry
625 declare double @llvm.ceil.f64(double) nounwind readnone
627 ;CHECK-LABEL: @trunc_f32(
628 ;CHECK: llvm.trunc.v4f32
630 define void @trunc_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
632 %cmp6 = icmp sgt i32 %n, 0
633 br i1 %cmp6, label %for.body, label %for.end
635 for.body: ; preds = %entry, %for.body
636 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
637 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
638 %0 = load float, float* %arrayidx, align 4
639 %call = tail call float @llvm.trunc.f32(float %0) nounwind readnone
640 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
641 store float %call, float* %arrayidx2, align 4
642 %indvars.iv.next = add i64 %indvars.iv, 1
643 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
644 %exitcond = icmp eq i32 %lftr.wideiv, %n
645 br i1 %exitcond, label %for.end, label %for.body
647 for.end: ; preds = %for.body, %entry
651 declare float @llvm.trunc.f32(float) nounwind readnone
653 ;CHECK-LABEL: @trunc_f64(
654 ;CHECK: llvm.trunc.v4f64
656 define void @trunc_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
658 %cmp6 = icmp sgt i32 %n, 0
659 br i1 %cmp6, label %for.body, label %for.end
661 for.body: ; preds = %entry, %for.body
662 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
663 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
664 %0 = load double, double* %arrayidx, align 8
665 %call = tail call double @llvm.trunc.f64(double %0) nounwind readnone
666 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
667 store double %call, double* %arrayidx2, align 8
668 %indvars.iv.next = add i64 %indvars.iv, 1
669 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
670 %exitcond = icmp eq i32 %lftr.wideiv, %n
671 br i1 %exitcond, label %for.end, label %for.body
673 for.end: ; preds = %for.body, %entry
677 declare double @llvm.trunc.f64(double) nounwind readnone
679 ;CHECK-LABEL: @rint_f32(
680 ;CHECK: llvm.rint.v4f32
682 define void @rint_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
684 %cmp6 = icmp sgt i32 %n, 0
685 br i1 %cmp6, label %for.body, label %for.end
687 for.body: ; preds = %entry, %for.body
688 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
689 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
690 %0 = load float, float* %arrayidx, align 4
691 %call = tail call float @llvm.rint.f32(float %0) nounwind readnone
692 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
693 store float %call, float* %arrayidx2, align 4
694 %indvars.iv.next = add i64 %indvars.iv, 1
695 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
696 %exitcond = icmp eq i32 %lftr.wideiv, %n
697 br i1 %exitcond, label %for.end, label %for.body
699 for.end: ; preds = %for.body, %entry
703 declare float @llvm.rint.f32(float) nounwind readnone
705 ;CHECK-LABEL: @rint_f64(
706 ;CHECK: llvm.rint.v4f64
708 define void @rint_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
710 %cmp6 = icmp sgt i32 %n, 0
711 br i1 %cmp6, label %for.body, label %for.end
713 for.body: ; preds = %entry, %for.body
714 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
715 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
716 %0 = load double, double* %arrayidx, align 8
717 %call = tail call double @llvm.rint.f64(double %0) nounwind readnone
718 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
719 store double %call, double* %arrayidx2, align 8
720 %indvars.iv.next = add i64 %indvars.iv, 1
721 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
722 %exitcond = icmp eq i32 %lftr.wideiv, %n
723 br i1 %exitcond, label %for.end, label %for.body
725 for.end: ; preds = %for.body, %entry
729 declare double @llvm.rint.f64(double) nounwind readnone
731 ;CHECK-LABEL: @nearbyint_f32(
732 ;CHECK: llvm.nearbyint.v4f32
734 define void @nearbyint_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
736 %cmp6 = icmp sgt i32 %n, 0
737 br i1 %cmp6, label %for.body, label %for.end
739 for.body: ; preds = %entry, %for.body
740 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
741 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
742 %0 = load float, float* %arrayidx, align 4
743 %call = tail call float @llvm.nearbyint.f32(float %0) nounwind readnone
744 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
745 store float %call, float* %arrayidx2, align 4
746 %indvars.iv.next = add i64 %indvars.iv, 1
747 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
748 %exitcond = icmp eq i32 %lftr.wideiv, %n
749 br i1 %exitcond, label %for.end, label %for.body
751 for.end: ; preds = %for.body, %entry
755 declare float @llvm.nearbyint.f32(float) nounwind readnone
757 ;CHECK-LABEL: @nearbyint_f64(
758 ;CHECK: llvm.nearbyint.v4f64
760 define void @nearbyint_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
762 %cmp6 = icmp sgt i32 %n, 0
763 br i1 %cmp6, label %for.body, label %for.end
765 for.body: ; preds = %entry, %for.body
766 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
767 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
768 %0 = load double, double* %arrayidx, align 8
769 %call = tail call double @llvm.nearbyint.f64(double %0) nounwind readnone
770 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
771 store double %call, double* %arrayidx2, align 8
772 %indvars.iv.next = add i64 %indvars.iv, 1
773 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
774 %exitcond = icmp eq i32 %lftr.wideiv, %n
775 br i1 %exitcond, label %for.end, label %for.body
777 for.end: ; preds = %for.body, %entry
781 declare double @llvm.nearbyint.f64(double) nounwind readnone
783 ;CHECK-LABEL: @round_f32(
784 ;CHECK: llvm.round.v4f32
786 define void @round_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
788 %cmp6 = icmp sgt i32 %n, 0
789 br i1 %cmp6, label %for.body, label %for.end
791 for.body: ; preds = %entry, %for.body
792 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
793 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
794 %0 = load float, float* %arrayidx, align 4
795 %call = tail call float @llvm.round.f32(float %0) nounwind readnone
796 %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
797 store float %call, float* %arrayidx2, align 4
798 %indvars.iv.next = add i64 %indvars.iv, 1
799 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
800 %exitcond = icmp eq i32 %lftr.wideiv, %n
801 br i1 %exitcond, label %for.end, label %for.body
803 for.end: ; preds = %for.body, %entry
807 declare float @llvm.round.f32(float) nounwind readnone
809 ;CHECK-LABEL: @round_f64(
810 ;CHECK: llvm.round.v4f64
812 define void @round_f64(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
814 %cmp6 = icmp sgt i32 %n, 0
815 br i1 %cmp6, label %for.body, label %for.end
817 for.body: ; preds = %entry, %for.body
818 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
819 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
820 %0 = load double, double* %arrayidx, align 8
821 %call = tail call double @llvm.round.f64(double %0) nounwind readnone
822 %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv
823 store double %call, double* %arrayidx2, align 8
824 %indvars.iv.next = add i64 %indvars.iv, 1
825 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
826 %exitcond = icmp eq i32 %lftr.wideiv, %n
827 br i1 %exitcond, label %for.end, label %for.body
829 for.end: ; preds = %for.body, %entry
833 declare double @llvm.round.f64(double) nounwind readnone
835 ;CHECK-LABEL: @fma_f32(
836 ;CHECK: llvm.fma.v4f32
838 define void @fma_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z, float* noalias %w) nounwind uwtable {
840 %cmp12 = icmp sgt i32 %n, 0
841 br i1 %cmp12, label %for.body, label %for.end
843 for.body: ; preds = %entry, %for.body
844 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
845 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
846 %0 = load float, float* %arrayidx, align 4
847 %arrayidx2 = getelementptr inbounds float, float* %w, i64 %indvars.iv
848 %1 = load float, float* %arrayidx2, align 4
849 %arrayidx4 = getelementptr inbounds float, float* %z, i64 %indvars.iv
850 %2 = load float, float* %arrayidx4, align 4
851 %3 = tail call float @llvm.fma.f32(float %0, float %2, float %1)
852 %arrayidx6 = getelementptr inbounds float, float* %x, i64 %indvars.iv
853 store float %3, float* %arrayidx6, align 4
854 %indvars.iv.next = add i64 %indvars.iv, 1
855 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
856 %exitcond = icmp eq i32 %lftr.wideiv, %n
857 br i1 %exitcond, label %for.end, label %for.body
859 for.end: ; preds = %for.body, %entry
863 declare float @llvm.fma.f32(float, float, float) nounwind readnone
865 ;CHECK-LABEL: @fma_f64(
866 ;CHECK: llvm.fma.v4f64
868 define void @fma_f64(i32 %n, double* noalias %y, double* noalias %x, double* noalias %z, double* noalias %w) nounwind uwtable {
870 %cmp12 = icmp sgt i32 %n, 0
871 br i1 %cmp12, label %for.body, label %for.end
873 for.body: ; preds = %entry, %for.body
874 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
875 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
876 %0 = load double, double* %arrayidx, align 8
877 %arrayidx2 = getelementptr inbounds double, double* %w, i64 %indvars.iv
878 %1 = load double, double* %arrayidx2, align 8
879 %arrayidx4 = getelementptr inbounds double, double* %z, i64 %indvars.iv
880 %2 = load double, double* %arrayidx4, align 8
881 %3 = tail call double @llvm.fma.f64(double %0, double %2, double %1)
882 %arrayidx6 = getelementptr inbounds double, double* %x, i64 %indvars.iv
883 store double %3, double* %arrayidx6, align 8
884 %indvars.iv.next = add i64 %indvars.iv, 1
885 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
886 %exitcond = icmp eq i32 %lftr.wideiv, %n
887 br i1 %exitcond, label %for.end, label %for.body
889 for.end: ; preds = %for.body, %entry
893 declare double @llvm.fma.f64(double, double, double) nounwind readnone
895 ;CHECK-LABEL: @fmuladd_f32(
896 ;CHECK: llvm.fmuladd.v4f32
898 define void @fmuladd_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z, float* noalias %w) nounwind uwtable {
900 %cmp12 = icmp sgt i32 %n, 0
901 br i1 %cmp12, label %for.body, label %for.end
903 for.body: ; preds = %entry, %for.body
904 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
905 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
906 %0 = load float, float* %arrayidx, align 4
907 %arrayidx2 = getelementptr inbounds float, float* %w, i64 %indvars.iv
908 %1 = load float, float* %arrayidx2, align 4
909 %arrayidx4 = getelementptr inbounds float, float* %z, i64 %indvars.iv
910 %2 = load float, float* %arrayidx4, align 4
911 %3 = tail call float @llvm.fmuladd.f32(float %0, float %2, float %1)
912 %arrayidx6 = getelementptr inbounds float, float* %x, i64 %indvars.iv
913 store float %3, float* %arrayidx6, align 4
914 %indvars.iv.next = add i64 %indvars.iv, 1
915 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
916 %exitcond = icmp eq i32 %lftr.wideiv, %n
917 br i1 %exitcond, label %for.end, label %for.body
919 for.end: ; preds = %for.body, %entry
923 declare float @llvm.fmuladd.f32(float, float, float) nounwind readnone
925 ;CHECK-LABEL: @fmuladd_f64(
926 ;CHECK: llvm.fmuladd.v4f64
928 define void @fmuladd_f64(i32 %n, double* noalias %y, double* noalias %x, double* noalias %z, double* noalias %w) nounwind uwtable {
930 %cmp12 = icmp sgt i32 %n, 0
931 br i1 %cmp12, label %for.body, label %for.end
933 for.body: ; preds = %entry, %for.body
934 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
935 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
936 %0 = load double, double* %arrayidx, align 8
937 %arrayidx2 = getelementptr inbounds double, double* %w, i64 %indvars.iv
938 %1 = load double, double* %arrayidx2, align 8
939 %arrayidx4 = getelementptr inbounds double, double* %z, i64 %indvars.iv
940 %2 = load double, double* %arrayidx4, align 8
941 %3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %1)
942 %arrayidx6 = getelementptr inbounds double, double* %x, i64 %indvars.iv
943 store double %3, double* %arrayidx6, align 8
944 %indvars.iv.next = add i64 %indvars.iv, 1
945 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
946 %exitcond = icmp eq i32 %lftr.wideiv, %n
947 br i1 %exitcond, label %for.end, label %for.body
949 for.end: ; preds = %for.body, %entry
953 declare double @llvm.fmuladd.f64(double, double, double) nounwind readnone
955 ;CHECK-LABEL: @pow_f32(
956 ;CHECK: llvm.pow.v4f32
958 define void @pow_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z) nounwind uwtable {
960 %cmp9 = icmp sgt i32 %n, 0
961 br i1 %cmp9, label %for.body, label %for.end
963 for.body: ; preds = %entry, %for.body
964 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
965 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
966 %0 = load float, float* %arrayidx, align 4
967 %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv
968 %1 = load float, float* %arrayidx2, align 4
969 %call = tail call float @llvm.pow.f32(float %0, float %1) nounwind readnone
970 %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv
971 store float %call, float* %arrayidx4, align 4
972 %indvars.iv.next = add i64 %indvars.iv, 1
973 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
974 %exitcond = icmp eq i32 %lftr.wideiv, %n
975 br i1 %exitcond, label %for.end, label %for.body
977 for.end: ; preds = %for.body, %entry
981 declare float @llvm.pow.f32(float, float) nounwind readnone
983 ;CHECK-LABEL: @pow_f64(
984 ;CHECK: llvm.pow.v4f64
986 define void @pow_f64(i32 %n, double* noalias %y, double* noalias %x, double* noalias %z) nounwind uwtable {
988 %cmp9 = icmp sgt i32 %n, 0
989 br i1 %cmp9, label %for.body, label %for.end
991 for.body: ; preds = %entry, %for.body
992 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
993 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
994 %0 = load double, double* %arrayidx, align 8
995 %arrayidx2 = getelementptr inbounds double, double* %z, i64 %indvars.iv
996 %1 = load double, double* %arrayidx2, align 8
997 %call = tail call double @llvm.pow.f64(double %0, double %1) nounwind readnone
998 %arrayidx4 = getelementptr inbounds double, double* %x, i64 %indvars.iv
999 store double %call, double* %arrayidx4, align 8
1000 %indvars.iv.next = add i64 %indvars.iv, 1
1001 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1002 %exitcond = icmp eq i32 %lftr.wideiv, %n
1003 br i1 %exitcond, label %for.end, label %for.body
1005 for.end: ; preds = %for.body, %entry
1010 ; CHECK: call <4 x float> @llvm.fabs.v4f32
1012 define void @fabs_libm(float* nocapture %x) nounwind {
1016 for.body: ; preds = %entry, %for.body
1017 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
1018 %arrayidx = getelementptr inbounds float, float* %x, i64 %indvars.iv
1019 %0 = load float, float* %arrayidx, align 4
1020 %call = tail call float @fabsf(float %0) nounwind readnone
1021 store float %call, float* %arrayidx, align 4
1022 %indvars.iv.next = add i64 %indvars.iv, 1
1023 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1024 %exitcond = icmp eq i32 %lftr.wideiv, 1024
1025 br i1 %exitcond, label %for.end, label %for.body
1027 for.end: ; preds = %for.body
1031 declare float @fabsf(float) nounwind readnone
1033 declare double @llvm.pow.f64(double, double) nounwind readnone
1037 ; Make sure we don't replace calls to functions with standard library function
1038 ; signatures but defined with internal linkage.
1040 define internal float @roundf(float %x) nounwind readnone {
1041 ret float 0.00000000
1043 ; CHECK-LABEL: internal_round
1044 ; CHECK-NOT: load <4 x float>
1046 define void @internal_round(float* nocapture %x) nounwind {
1050 for.body: ; preds = %entry, %for.body
1051 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
1052 %arrayidx = getelementptr inbounds float, float* %x, i64 %indvars.iv
1053 %0 = load float, float* %arrayidx, align 4
1054 %call = tail call float @roundf(float %0) nounwind readnone
1055 store float %call, float* %arrayidx, align 4
1056 %indvars.iv.next = add i64 %indvars.iv, 1
1057 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1058 %exitcond = icmp eq i32 %lftr.wideiv, 1024
1059 br i1 %exitcond, label %for.end, label %for.body
1061 for.end: ; preds = %for.body
1065 ; Make sure we don't replace calls to functions with standard library names but
1066 ; different signatures.
1068 declare void @round(double %f)
1070 ; CHECK-LABEL: wrong_signature
1071 ; CHECK-NOT: load <4 x double>
1073 define void @wrong_signature(double* nocapture %x) nounwind {
1077 for.body: ; preds = %entry, %for.body
1078 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
1079 %arrayidx = getelementptr inbounds double, double* %x, i64 %indvars.iv
1080 %0 = load double, double* %arrayidx, align 4
1081 store double %0, double* %arrayidx, align 4
1082 tail call void @round(double %0) nounwind readnone
1083 %indvars.iv.next = add i64 %indvars.iv, 1
1084 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1085 %exitcond = icmp eq i32 %lftr.wideiv, 1024
1086 br i1 %exitcond, label %for.end, label %for.body
1088 for.end: ; preds = %for.body
1092 declare double @llvm.powi.f64(double %Val, i32 %power) nounwind readnone
1094 ;CHECK-LABEL: @powi_f64(
1095 ;CHECK: llvm.powi.v4f64
1097 define void @powi_f64(i32 %n, double* noalias %y, double* noalias %x, i32 %P) nounwind uwtable {
1099 %cmp9 = icmp sgt i32 %n, 0
1100 br i1 %cmp9, label %for.body, label %for.end
1102 for.body: ; preds = %entry, %for.body
1103 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1104 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
1105 %0 = load double, double* %arrayidx, align 8
1106 %call = tail call double @llvm.powi.f64(double %0, i32 %P) nounwind readnone
1107 %arrayidx4 = getelementptr inbounds double, double* %x, i64 %indvars.iv
1108 store double %call, double* %arrayidx4, align 8
1109 %indvars.iv.next = add i64 %indvars.iv, 1
1110 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1111 %exitcond = icmp eq i32 %lftr.wideiv, %n
1112 br i1 %exitcond, label %for.end, label %for.body
1114 for.end: ; preds = %for.body, %entry
1118 ;CHECK-LABEL: @powi_f64_neg(
1119 ;CHECK-NOT: llvm.powi.v4f64
1121 define void @powi_f64_neg(i32 %n, double* noalias %y, double* noalias %x) nounwind uwtable {
1123 %cmp9 = icmp sgt i32 %n, 0
1124 br i1 %cmp9, label %for.body, label %for.end
1126 for.body: ; preds = %entry, %for.body
1127 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1128 %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv
1129 %0 = load double, double* %arrayidx, align 8
1130 %1 = trunc i64 %indvars.iv to i32
1131 %call = tail call double @llvm.powi.f64(double %0, i32 %1) nounwind readnone
1132 %arrayidx4 = getelementptr inbounds double, double* %x, i64 %indvars.iv
1133 store double %call, double* %arrayidx4, align 8
1134 %indvars.iv.next = add i64 %indvars.iv, 1
1135 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1136 %exitcond = icmp eq i32 %lftr.wideiv, %n
1137 br i1 %exitcond, label %for.end, label %for.body
1139 for.end: ; preds = %for.body, %entry
1143 declare i64 @llvm.cttz.i64 (i64, i1) nounwind readnone
1145 ;CHECK-LABEL: @cttz_f64(
1146 ;CHECK: llvm.cttz.v4i64
1148 define void @cttz_f64(i32 %n, i64* noalias %y, i64* noalias %x) nounwind uwtable {
1150 %cmp9 = icmp sgt i32 %n, 0
1151 br i1 %cmp9, label %for.body, label %for.end
1153 for.body: ; preds = %entry, %for.body
1154 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1155 %arrayidx = getelementptr inbounds i64, i64* %y, i64 %indvars.iv
1156 %0 = load i64, i64* %arrayidx, align 8
1157 %call = tail call i64 @llvm.cttz.i64(i64 %0, i1 true) nounwind readnone
1158 %arrayidx4 = getelementptr inbounds i64, i64* %x, i64 %indvars.iv
1159 store i64 %call, i64* %arrayidx4, align 8
1160 %indvars.iv.next = add i64 %indvars.iv, 1
1161 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1162 %exitcond = icmp eq i32 %lftr.wideiv, %n
1163 br i1 %exitcond, label %for.end, label %for.body
1165 for.end: ; preds = %for.body, %entry
1169 declare i64 @llvm.ctlz.i64 (i64, i1) nounwind readnone
1171 ;CHECK-LABEL: @ctlz_f64(
1172 ;CHECK: llvm.ctlz.v4i64
1174 define void @ctlz_f64(i32 %n, i64* noalias %y, i64* noalias %x) nounwind uwtable {
1176 %cmp9 = icmp sgt i32 %n, 0
1177 br i1 %cmp9, label %for.body, label %for.end
1179 for.body: ; preds = %entry, %for.body
1180 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1181 %arrayidx = getelementptr inbounds i64, i64* %y, i64 %indvars.iv
1182 %0 = load i64, i64* %arrayidx, align 8
1183 %call = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true) nounwind readnone
1184 %arrayidx4 = getelementptr inbounds i64, i64* %x, i64 %indvars.iv
1185 store i64 %call, i64* %arrayidx4, align 8
1186 %indvars.iv.next = add i64 %indvars.iv, 1
1187 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1188 %exitcond = icmp eq i32 %lftr.wideiv, %n
1189 br i1 %exitcond, label %for.end, label %for.body
1191 for.end: ; preds = %for.body, %entry
1195 declare i32 @llvm.fshl.i32 (i32, i32, i32)
1197 define void @fshl_i32(i32 %n, i32* noalias %x, i32* noalias %y, i32 %shAmt) {
1198 ; CHECK-LABEL: @fshl_i32(
1199 ; CHECK: call <4 x i32> @llvm.fshl.v4i32(<4 x i32> [[WIDE_LOADX:%.*]], <4 x i32> [[WIDE_LOADY:%.*]], <4 x i32> [[SPLAT:%.*]])
1202 %cmp = icmp sgt i32 %n, 0
1203 br i1 %cmp, label %loop, label %end
1206 %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ]
1207 %xi = getelementptr inbounds i32, i32* %x, i32 %iv
1208 %yi = getelementptr inbounds i32, i32* %y, i32 %iv
1209 %xld = load i32, i32* %xi, align 4
1210 %yld = load i32, i32* %yi, align 4
1211 %call = tail call i32 @llvm.fshl.i32(i32 %xld, i32 %yld, i32 %shAmt)
1212 store i32 %call, i32* %xi, align 4
1213 %iv.next = add i32 %iv, 1
1214 %exitcond = icmp eq i32 %iv.next, %n
1215 br i1 %exitcond, label %end, label %loop
1221 declare i32 @llvm.fshr.i32 (i32, i32, i32)
1223 define void @fshr_i32(i32 %n, i32* noalias %x, i32* noalias %y, i32 %shAmt) {
1224 ; CHECK-LABEL: @fshr_i32(
1225 ; CHECK: call <4 x i32> @llvm.fshr.v4i32(<4 x i32> [[WIDE_LOADX:%.*]], <4 x i32> [[WIDE_LOADY:%.*]], <4 x i32> [[SPLAT:%.*]])
1228 %cmp = icmp sgt i32 %n, 0
1229 br i1 %cmp, label %loop, label %end
1232 %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ]
1233 %xi = getelementptr inbounds i32, i32* %x, i32 %iv
1234 %yi = getelementptr inbounds i32, i32* %y, i32 %iv
1235 %xld = load i32, i32* %xi, align 4
1236 %yld = load i32, i32* %yi, align 4
1237 %call = tail call i32 @llvm.fshr.i32(i32 %xld, i32 %yld, i32 %shAmt)
1238 store i32 %call, i32* %xi, align 4
1239 %iv.next = add i32 %iv, 1
1240 %exitcond = icmp eq i32 %iv.next, %n
1241 br i1 %exitcond, label %end, label %loop
1247 declare float @llvm.minnum.f32(float, float) nounwind readnone
1249 ;CHECK-LABEL: @minnum_f32(
1250 ;CHECK: llvm.minnum.v4f32
1252 define void @minnum_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z) nounwind uwtable {
1254 %cmp9 = icmp sgt i32 %n, 0
1255 br i1 %cmp9, label %for.body, label %for.end
1257 for.body: ; preds = %entry, %for.body
1258 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1259 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
1260 %0 = load float, float* %arrayidx, align 4
1261 %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv
1262 %1 = load float, float* %arrayidx2, align 4
1263 %call = tail call float @llvm.minnum.f32(float %0, float %1) nounwind readnone
1264 %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv
1265 store float %call, float* %arrayidx4, align 4
1266 %indvars.iv.next = add i64 %indvars.iv, 1
1267 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1268 %exitcond = icmp eq i32 %lftr.wideiv, %n
1269 br i1 %exitcond, label %for.end, label %for.body
1271 for.end: ; preds = %for.body, %entry
1275 declare float @llvm.maxnum.f32(float, float) nounwind readnone
1277 ;CHECK-LABEL: @maxnum_f32(
1278 ;CHECK: llvm.maxnum.v4f32
1280 define void @maxnum_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z) nounwind uwtable {
1282 %cmp9 = icmp sgt i32 %n, 0
1283 br i1 %cmp9, label %for.body, label %for.end
1285 for.body: ; preds = %entry, %for.body
1286 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1287 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
1288 %0 = load float, float* %arrayidx, align 4
1289 %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv
1290 %1 = load float, float* %arrayidx2, align 4
1291 %call = tail call float @llvm.maxnum.f32(float %0, float %1) nounwind readnone
1292 %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv
1293 store float %call, float* %arrayidx4, align 4
1294 %indvars.iv.next = add i64 %indvars.iv, 1
1295 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1296 %exitcond = icmp eq i32 %lftr.wideiv, %n
1297 br i1 %exitcond, label %for.end, label %for.body
1299 for.end: ; preds = %for.body, %entry
1303 declare float @llvm.minimum.f32(float, float) nounwind readnone
1305 ;CHECK-LABEL: @minimum_f32(
1306 ;CHECK: llvm.minimum.v4f32
1308 define void @minimum_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z) nounwind uwtable {
1310 %cmp9 = icmp sgt i32 %n, 0
1311 br i1 %cmp9, label %for.body, label %for.end
1313 for.body: ; preds = %entry, %for.body
1314 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1315 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
1316 %0 = load float, float* %arrayidx, align 4
1317 %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv
1318 %1 = load float, float* %arrayidx2, align 4
1319 %call = tail call float @llvm.minimum.f32(float %0, float %1) nounwind readnone
1320 %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv
1321 store float %call, float* %arrayidx4, align 4
1322 %indvars.iv.next = add i64 %indvars.iv, 1
1323 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1324 %exitcond = icmp eq i32 %lftr.wideiv, %n
1325 br i1 %exitcond, label %for.end, label %for.body
1327 for.end: ; preds = %for.body, %entry
1331 declare float @llvm.maximum.f32(float, float) nounwind readnone
1333 ;CHECK-LABEL: @maximum_f32(
1334 ;CHECK: llvm.maximum.v4f32
1336 define void @maximum_f32(i32 %n, float* noalias %y, float* noalias %x, float* noalias %z) nounwind uwtable {
1338 %cmp9 = icmp sgt i32 %n, 0
1339 br i1 %cmp9, label %for.body, label %for.end
1341 for.body: ; preds = %entry, %for.body
1342 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
1343 %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
1344 %0 = load float, float* %arrayidx, align 4
1345 %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv
1346 %1 = load float, float* %arrayidx2, align 4
1347 %call = tail call float @llvm.maximum.f32(float %0, float %1) nounwind readnone
1348 %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv
1349 store float %call, float* %arrayidx4, align 4
1350 %indvars.iv.next = add i64 %indvars.iv, 1
1351 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
1352 %exitcond = icmp eq i32 %lftr.wideiv, %n
1353 br i1 %exitcond, label %for.end, label %for.body
1355 for.end: ; preds = %for.body, %entry