• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -vector-library=Accelerate -loop-vectorize -S | FileCheck %s
2
3target 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"
4target triple = "x86_64-unknown-linux-gnu"
5
6;CHECK-LABEL: @sqrt_f32(
7;CHECK: vsqrtf{{.*}}<4 x float>
8;CHECK: ret void
9declare float @sqrtf(float) nounwind readnone
10define void @sqrt_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
11entry:
12  %cmp6 = icmp sgt i32 %n, 0
13  br i1 %cmp6, label %for.body, label %for.end
14
15for.body:                                         ; preds = %entry, %for.body
16  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
17  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
18  %0 = load float, float* %arrayidx, align 4
19  %call = tail call float @sqrtf(float %0) nounwind readnone
20  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
21  store float %call, float* %arrayidx2, align 4
22  %indvars.iv.next = add i64 %indvars.iv, 1
23  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
24  %exitcond = icmp eq i32 %lftr.wideiv, %n
25  br i1 %exitcond, label %for.end, label %for.body
26
27for.end:                                          ; preds = %for.body, %entry
28  ret void
29}
30
31;CHECK-LABEL: @exp_f32(
32;CHECK: vexpf{{.*}}<4 x float>
33;CHECK: ret void
34declare float @expf(float) nounwind readnone
35define void @exp_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
36entry:
37  %cmp6 = icmp sgt i32 %n, 0
38  br i1 %cmp6, label %for.body, label %for.end
39
40for.body:                                         ; preds = %entry, %for.body
41  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
42  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
43  %0 = load float, float* %arrayidx, align 4
44  %call = tail call float @expf(float %0) nounwind readnone
45  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
46  store float %call, float* %arrayidx2, align 4
47  %indvars.iv.next = add i64 %indvars.iv, 1
48  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
49  %exitcond = icmp eq i32 %lftr.wideiv, %n
50  br i1 %exitcond, label %for.end, label %for.body
51
52for.end:                                          ; preds = %for.body, %entry
53  ret void
54}
55
56;CHECK-LABEL: @log_f32(
57;CHECK: vlogf{{.*}}<4 x float>
58;CHECK: ret void
59declare float @logf(float) nounwind readnone
60define void @log_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
61entry:
62  %cmp6 = icmp sgt i32 %n, 0
63  br i1 %cmp6, label %for.body, label %for.end
64
65for.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 @logf(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
76
77for.end:                                          ; preds = %for.body, %entry
78  ret void
79}
80
81; For abs instruction we'll generate vector intrinsic, as it's cheaper than a lib call.
82;CHECK-LABEL: @fabs_f32(
83;CHECK: fabs{{.*}}<4 x float>
84;CHECK: ret void
85declare float @fabsf(float) nounwind readnone
86define void @fabs_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
87entry:
88  %cmp6 = icmp sgt i32 %n, 0
89  br i1 %cmp6, label %for.body, label %for.end
90
91for.body:                                         ; preds = %entry, %for.body
92  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
93  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
94  %0 = load float, float* %arrayidx, align 4
95  %call = tail call float @fabsf(float %0) nounwind readnone
96  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
97  store float %call, float* %arrayidx2, align 4
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
102
103for.end:                                          ; preds = %for.body, %entry
104  ret void
105}
106
107; Test that we can vectorize an intrinsic into a vector call.
108;CHECK-LABEL: @exp_f32_intrin(
109;CHECK: vexpf{{.*}}<4 x float>
110;CHECK: ret void
111declare float @llvm.exp.f32(float) nounwind readnone
112define void @exp_f32_intrin(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
113entry:
114  %cmp6 = icmp sgt i32 %n, 0
115  br i1 %cmp6, label %for.body, label %for.end
116
117for.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.exp.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
128
129for.end:                                          ; preds = %for.body, %entry
130  ret void
131}
132
133; Test that we don't vectorize arbitrary functions.
134;CHECK-LABEL: @foo_f32(
135;CHECK-NOT: foo{{.*}}<4 x float>
136;CHECK: ret void
137declare float @foo(float) nounwind readnone
138define void @foo_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
139entry:
140  %cmp6 = icmp sgt i32 %n, 0
141  br i1 %cmp6, label %for.body, label %for.end
142
143for.body:                                         ; preds = %entry, %for.body
144  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
145  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
146  %0 = load float, float* %arrayidx, align 4
147  %call = tail call float @foo(float %0) nounwind readnone
148  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
149  store float %call, float* %arrayidx2, align 4
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
154
155for.end:                                          ; preds = %for.body, %entry
156  ret void
157}
158
159; Test that we don't vectorize calls with nobuiltin attribute.
160;CHECK-LABEL: @sqrt_f32_nobuiltin(
161;CHECK-NOT: vsqrtf{{.*}}<4 x float>
162;CHECK: ret void
163define void @sqrt_f32_nobuiltin(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
164entry:
165  %cmp6 = icmp sgt i32 %n, 0
166  br i1 %cmp6, label %for.body, label %for.end
167
168for.body:                                         ; preds = %entry, %for.body
169  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
170  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
171  %0 = load float, float* %arrayidx, align 4
172  %call = tail call float @sqrtf(float %0) nounwind readnone nobuiltin
173  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
174  store float %call, float* %arrayidx2, align 4
175  %indvars.iv.next = add i64 %indvars.iv, 1
176  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
177  %exitcond = icmp eq i32 %lftr.wideiv, %n
178  br i1 %exitcond, label %for.end, label %for.body
179
180for.end:                                          ; preds = %for.body, %entry
181  ret void
182}
183
184;CHECK-LABEL: @ceil_f32(
185;CHECK: vceilf{{.*}}<4 x float>
186;CHECK: ret void
187declare float @ceilf(float) nounwind readnone
188define void @ceil_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
189entry:
190  %cmp6 = icmp sgt i32 %n, 0
191  br i1 %cmp6, label %for.body, label %for.end
192
193for.body:                                         ; preds = %entry, %for.body
194  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
195  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
196  %0 = load float, float* %arrayidx, align 4
197  %call = tail call float @ceilf(float %0) nounwind readnone
198  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
199  store float %call, float* %arrayidx2, align 4
200  %indvars.iv.next = add i64 %indvars.iv, 1
201  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
202  %exitcond = icmp eq i32 %lftr.wideiv, %n
203  br i1 %exitcond, label %for.end, label %for.body
204
205for.end:                                          ; preds = %for.body, %entry
206  ret void
207}
208
209;CHECK-LABEL: @floor_f32(
210;CHECK: vfloorf{{.*}}<4 x float>
211;CHECK: ret void
212declare float @floorf(float) nounwind readnone
213define void @floor_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
214entry:
215  %cmp6 = icmp sgt i32 %n, 0
216  br i1 %cmp6, label %for.body, label %for.end
217
218for.body:                                         ; preds = %entry, %for.body
219  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
220  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
221  %0 = load float, float* %arrayidx, align 4
222  %call = tail call float @floorf(float %0) nounwind readnone
223  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
224  store float %call, float* %arrayidx2, align 4
225  %indvars.iv.next = add i64 %indvars.iv, 1
226  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
227  %exitcond = icmp eq i32 %lftr.wideiv, %n
228  br i1 %exitcond, label %for.end, label %for.body
229
230for.end:                                          ; preds = %for.body, %entry
231  ret void
232}
233
234;CHECK-LABEL: @expm1_f32(
235;CHECK: vexpm1f{{.*}}<4 x float>
236;CHECK: ret void
237declare float @expm1f(float) nounwind readnone
238define void @expm1_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
239entry:
240  %cmp6 = icmp sgt i32 %n, 0
241  br i1 %cmp6, label %for.body, label %for.end
242
243for.body:                                         ; preds = %entry, %for.body
244  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
245  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
246  %0 = load float, float* %arrayidx, align 4
247  %call = tail call float @expm1f(float %0) nounwind readnone
248  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
249  store float %call, float* %arrayidx2, align 4
250  %indvars.iv.next = add i64 %indvars.iv, 1
251  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
252  %exitcond = icmp eq i32 %lftr.wideiv, %n
253  br i1 %exitcond, label %for.end, label %for.body
254
255for.end:                                          ; preds = %for.body, %entry
256  ret void
257}
258
259;CHECK-LABEL: @log1p_f32(
260;CHECK: vlog1pf{{.*}}<4 x float>
261;CHECK: ret void
262declare float @log1pf(float) nounwind readnone
263define void @log1p_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
264entry:
265  %cmp6 = icmp sgt i32 %n, 0
266  br i1 %cmp6, label %for.body, label %for.end
267
268for.body:                                         ; preds = %entry, %for.body
269  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
270  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
271  %0 = load float, float* %arrayidx, align 4
272  %call = tail call float @log1pf(float %0) nounwind readnone
273  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
274  store float %call, float* %arrayidx2, align 4
275  %indvars.iv.next = add i64 %indvars.iv, 1
276  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
277  %exitcond = icmp eq i32 %lftr.wideiv, %n
278  br i1 %exitcond, label %for.end, label %for.body
279
280for.end:                                          ; preds = %for.body, %entry
281  ret void
282}
283
284;CHECK-LABEL: @log10_f32(
285;CHECK: vlog10f{{.*}}<4 x float>
286;CHECK: ret void
287declare float @log10f(float) nounwind readnone
288define void @log10_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
289entry:
290  %cmp6 = icmp sgt i32 %n, 0
291  br i1 %cmp6, label %for.body, label %for.end
292
293for.body:                                         ; preds = %entry, %for.body
294  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
295  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
296  %0 = load float, float* %arrayidx, align 4
297  %call = tail call float @log10f(float %0) nounwind readnone
298  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
299  store float %call, float* %arrayidx2, align 4
300  %indvars.iv.next = add i64 %indvars.iv, 1
301  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
302  %exitcond = icmp eq i32 %lftr.wideiv, %n
303  br i1 %exitcond, label %for.end, label %for.body
304
305for.end:                                          ; preds = %for.body, %entry
306  ret void
307}
308
309;CHECK-LABEL: @logb_f32(
310;CHECK: vlogbf{{.*}}<4 x float>
311;CHECK: ret void
312declare float @logbf(float) nounwind readnone
313define void @logb_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
314entry:
315  %cmp6 = icmp sgt i32 %n, 0
316  br i1 %cmp6, label %for.body, label %for.end
317
318for.body:                                         ; preds = %entry, %for.body
319  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
320  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
321  %0 = load float, float* %arrayidx, align 4
322  %call = tail call float @logbf(float %0) nounwind readnone
323  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
324  store float %call, float* %arrayidx2, align 4
325  %indvars.iv.next = add i64 %indvars.iv, 1
326  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
327  %exitcond = icmp eq i32 %lftr.wideiv, %n
328  br i1 %exitcond, label %for.end, label %for.body
329
330for.end:                                          ; preds = %for.body, %entry
331  ret void
332}
333
334;CHECK-LABEL: @sin_f32(
335;CHECK: vsinf{{.*}}<4 x float>
336;CHECK: ret void
337declare float @sinf(float) nounwind readnone
338define void @sin_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
339entry:
340  %cmp6 = icmp sgt i32 %n, 0
341  br i1 %cmp6, label %for.body, label %for.end
342
343for.body:                                         ; preds = %entry, %for.body
344  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
345  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
346  %0 = load float, float* %arrayidx, align 4
347  %call = tail call float @sinf(float %0) nounwind readnone
348  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
349  store float %call, float* %arrayidx2, align 4
350  %indvars.iv.next = add i64 %indvars.iv, 1
351  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
352  %exitcond = icmp eq i32 %lftr.wideiv, %n
353  br i1 %exitcond, label %for.end, label %for.body
354
355for.end:                                          ; preds = %for.body, %entry
356  ret void
357}
358
359;CHECK-LABEL: @cos_f32(
360;CHECK: vcosf{{.*}}<4 x float>
361;CHECK: ret void
362declare float @cosf(float) nounwind readnone
363define void @cos_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
364entry:
365  %cmp6 = icmp sgt i32 %n, 0
366  br i1 %cmp6, label %for.body, label %for.end
367
368for.body:                                         ; preds = %entry, %for.body
369  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
370  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
371  %0 = load float, float* %arrayidx, align 4
372  %call = tail call float @cosf(float %0) nounwind readnone
373  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
374  store float %call, float* %arrayidx2, align 4
375  %indvars.iv.next = add i64 %indvars.iv, 1
376  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
377  %exitcond = icmp eq i32 %lftr.wideiv, %n
378  br i1 %exitcond, label %for.end, label %for.body
379
380for.end:                                          ; preds = %for.body, %entry
381  ret void
382}
383
384;CHECK-LABEL: @tan_f32(
385;CHECK: vtanf{{.*}}<4 x float>
386;CHECK: ret void
387declare float @tanf(float) nounwind readnone
388define void @tan_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
389entry:
390  %cmp6 = icmp sgt i32 %n, 0
391  br i1 %cmp6, label %for.body, label %for.end
392
393for.body:                                         ; preds = %entry, %for.body
394  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
395  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
396  %0 = load float, float* %arrayidx, align 4
397  %call = tail call float @tanf(float %0) nounwind readnone
398  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
399  store float %call, float* %arrayidx2, align 4
400  %indvars.iv.next = add i64 %indvars.iv, 1
401  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
402  %exitcond = icmp eq i32 %lftr.wideiv, %n
403  br i1 %exitcond, label %for.end, label %for.body
404
405for.end:                                          ; preds = %for.body, %entry
406  ret void
407}
408
409;CHECK-LABEL: @asin_f32(
410;CHECK: vasinf{{.*}}<4 x float>
411;CHECK: ret void
412declare float @asinf(float) nounwind readnone
413define void @asin_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
414entry:
415  %cmp6 = icmp sgt i32 %n, 0
416  br i1 %cmp6, label %for.body, label %for.end
417
418for.body:                                         ; preds = %entry, %for.body
419  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
420  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
421  %0 = load float, float* %arrayidx, align 4
422  %call = tail call float @asinf(float %0) nounwind readnone
423  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
424  store float %call, float* %arrayidx2, align 4
425  %indvars.iv.next = add i64 %indvars.iv, 1
426  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
427  %exitcond = icmp eq i32 %lftr.wideiv, %n
428  br i1 %exitcond, label %for.end, label %for.body
429
430for.end:                                          ; preds = %for.body, %entry
431  ret void
432}
433
434;CHECK-LABEL: @acos_f32(
435;CHECK: vacosf{{.*}}<4 x float>
436;CHECK: ret void
437declare float @acosf(float) nounwind readnone
438define void @acos_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
439entry:
440  %cmp6 = icmp sgt i32 %n, 0
441  br i1 %cmp6, label %for.body, label %for.end
442
443for.body:                                         ; preds = %entry, %for.body
444  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
445  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
446  %0 = load float, float* %arrayidx, align 4
447  %call = tail call float @acosf(float %0) nounwind readnone
448  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
449  store float %call, float* %arrayidx2, align 4
450  %indvars.iv.next = add i64 %indvars.iv, 1
451  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
452  %exitcond = icmp eq i32 %lftr.wideiv, %n
453  br i1 %exitcond, label %for.end, label %for.body
454
455for.end:                                          ; preds = %for.body, %entry
456  ret void
457}
458
459;CHECK-LABEL: @atan_f32(
460;CHECK: vatanf{{.*}}<4 x float>
461;CHECK: ret void
462declare float @atanf(float) nounwind readnone
463define void @atan_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
464entry:
465  %cmp6 = icmp sgt i32 %n, 0
466  br i1 %cmp6, label %for.body, label %for.end
467
468for.body:                                         ; preds = %entry, %for.body
469  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
470  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
471  %0 = load float, float* %arrayidx, align 4
472  %call = tail call float @atanf(float %0) nounwind readnone
473  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
474  store float %call, float* %arrayidx2, align 4
475  %indvars.iv.next = add i64 %indvars.iv, 1
476  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
477  %exitcond = icmp eq i32 %lftr.wideiv, %n
478  br i1 %exitcond, label %for.end, label %for.body
479
480for.end:                                          ; preds = %for.body, %entry
481  ret void
482}
483
484;CHECK-LABEL: @sinh_f32(
485;CHECK: vsinhf{{.*}}<4 x float>
486;CHECK: ret void
487declare float @sinhf(float) nounwind readnone
488define void @sinh_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
489entry:
490  %cmp6 = icmp sgt i32 %n, 0
491  br i1 %cmp6, label %for.body, label %for.end
492
493for.body:                                         ; preds = %entry, %for.body
494  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
495  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
496  %0 = load float, float* %arrayidx, align 4
497  %call = tail call float @sinhf(float %0) nounwind readnone
498  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
499  store float %call, float* %arrayidx2, align 4
500  %indvars.iv.next = add i64 %indvars.iv, 1
501  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
502  %exitcond = icmp eq i32 %lftr.wideiv, %n
503  br i1 %exitcond, label %for.end, label %for.body
504
505for.end:                                          ; preds = %for.body, %entry
506  ret void
507}
508
509;CHECK-LABEL: @cosh_f32(
510;CHECK: vcoshf{{.*}}<4 x float>
511;CHECK: ret void
512declare float @coshf(float) nounwind readnone
513define void @cosh_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
514entry:
515  %cmp6 = icmp sgt i32 %n, 0
516  br i1 %cmp6, label %for.body, label %for.end
517
518for.body:                                         ; preds = %entry, %for.body
519  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
520  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
521  %0 = load float, float* %arrayidx, align 4
522  %call = tail call float @coshf(float %0) nounwind readnone
523  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
524  store float %call, float* %arrayidx2, align 4
525  %indvars.iv.next = add i64 %indvars.iv, 1
526  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
527  %exitcond = icmp eq i32 %lftr.wideiv, %n
528  br i1 %exitcond, label %for.end, label %for.body
529
530for.end:                                          ; preds = %for.body, %entry
531  ret void
532}
533
534;CHECK-LABEL: @tanh_f32(
535;CHECK: vtanhf{{.*}}<4 x float>
536;CHECK: ret void
537declare float @tanhf(float) nounwind readnone
538define void @tanh_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
539entry:
540  %cmp6 = icmp sgt i32 %n, 0
541  br i1 %cmp6, label %for.body, label %for.end
542
543for.body:                                         ; preds = %entry, %for.body
544  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
545  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
546  %0 = load float, float* %arrayidx, align 4
547  %call = tail call float @tanhf(float %0) nounwind readnone
548  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
549  store float %call, float* %arrayidx2, align 4
550  %indvars.iv.next = add i64 %indvars.iv, 1
551  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
552  %exitcond = icmp eq i32 %lftr.wideiv, %n
553  br i1 %exitcond, label %for.end, label %for.body
554
555for.end:                                          ; preds = %for.body, %entry
556  ret void
557}
558
559;CHECK-LABEL: @asinh_f32(
560;CHECK: vasinhf{{.*}}<4 x float>
561;CHECK: ret void
562declare float @asinhf(float) nounwind readnone
563define void @asinh_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
564entry:
565  %cmp6 = icmp sgt i32 %n, 0
566  br i1 %cmp6, label %for.body, label %for.end
567
568for.body:                                         ; preds = %entry, %for.body
569  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
570  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
571  %0 = load float, float* %arrayidx, align 4
572  %call = tail call float @asinhf(float %0) nounwind readnone
573  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
574  store float %call, float* %arrayidx2, align 4
575  %indvars.iv.next = add i64 %indvars.iv, 1
576  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
577  %exitcond = icmp eq i32 %lftr.wideiv, %n
578  br i1 %exitcond, label %for.end, label %for.body
579
580for.end:                                          ; preds = %for.body, %entry
581  ret void
582}
583
584;CHECK-LABEL: @acosh_f32(
585;CHECK: vacoshf{{.*}}<4 x float>
586;CHECK: ret void
587declare float @acoshf(float) nounwind readnone
588define void @acosh_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
589entry:
590  %cmp6 = icmp sgt i32 %n, 0
591  br i1 %cmp6, label %for.body, label %for.end
592
593for.body:                                         ; preds = %entry, %for.body
594  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
595  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
596  %0 = load float, float* %arrayidx, align 4
597  %call = tail call float @acoshf(float %0) nounwind readnone
598  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
599  store float %call, float* %arrayidx2, align 4
600  %indvars.iv.next = add i64 %indvars.iv, 1
601  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
602  %exitcond = icmp eq i32 %lftr.wideiv, %n
603  br i1 %exitcond, label %for.end, label %for.body
604
605for.end:                                          ; preds = %for.body, %entry
606  ret void
607}
608
609;CHECK-LABEL: @atanh_f32(
610;CHECK: vatanhf{{.*}}<4 x float>
611;CHECK: ret void
612declare float @atanhf(float) nounwind readnone
613define void @atanh_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable {
614entry:
615  %cmp6 = icmp sgt i32 %n, 0
616  br i1 %cmp6, label %for.body, label %for.end
617
618for.body:                                         ; preds = %entry, %for.body
619  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
620  %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv
621  %0 = load float, float* %arrayidx, align 4
622  %call = tail call float @atanhf(float %0) nounwind readnone
623  %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv
624  store float %call, float* %arrayidx2, align 4
625  %indvars.iv.next = add i64 %indvars.iv, 1
626  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
627  %exitcond = icmp eq i32 %lftr.wideiv, %n
628  br i1 %exitcond, label %for.end, label %for.body
629
630for.end:                                          ; preds = %for.body, %entry
631  ret void
632}
633