1; RUN: opt -vector-library=SVML -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -mattr=avx -S < %s | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-unknown-linux-gnu"
5
6declare double @sin(double) #0
7declare float @sinf(float) #0
8declare double @llvm.sin.f64(double) #0
9declare float @llvm.sin.f32(float) #0
10
11declare double @cos(double) #0
12declare float @cosf(float) #0
13declare double @llvm.cos.f64(double) #0
14declare float @llvm.cos.f32(float) #0
15
16declare double @pow(double, double) #0
17declare float @powf(float, float) #0
18declare double @llvm.pow.f64(double, double) #0
19declare float @llvm.pow.f32(float, float) #0
20
21declare double @exp(double) #0
22declare float @expf(float) #0
23declare double @llvm.exp.f64(double) #0
24declare float @llvm.exp.f32(float) #0
25
26declare double @log(double) #0
27declare float @logf(float) #0
28declare double @llvm.log.f64(double) #0
29declare float @llvm.log.f32(float) #0
30
31declare double @exp2(double) #0
32declare float @exp2f(float) #0
33declare double @llvm.exp2.f64(double) #0
34declare float @llvm.exp2.f32(float) #0
35declare double @__exp2_finite(double) #0
36declare float @__exp2f_finite(float) #0
37
38define void @sin_f64(double* nocapture %varray) {
39; CHECK-LABEL: @sin_f64(
40; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_sin4(<4 x double> [[TMP4:%.*]])
41; CHECK:    ret void
42;
43entry:
44  br label %for.body
45
46for.body:
47  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
48  %tmp = trunc i64 %iv to i32
49  %conv = sitofp i32 %tmp to double
50  %call = tail call double @sin(double %conv)
51  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
52  store double %call, double* %arrayidx, align 4
53  %iv.next = add nuw nsw i64 %iv, 1
54  %exitcond = icmp eq i64 %iv.next, 1000
55  br i1 %exitcond, label %for.end, label %for.body
56
57for.end:
58  ret void
59}
60
61define void @sin_f32(float* nocapture %varray) {
62; CHECK-LABEL: @sin_f32(
63; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_sinf4(<4 x float> [[TMP4:%.*]])
64; CHECK:    ret void
65;
66entry:
67  br label %for.body
68
69for.body:
70  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
71  %tmp = trunc i64 %iv to i32
72  %conv = sitofp i32 %tmp to float
73  %call = tail call float @sinf(float %conv)
74  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
75  store float %call, float* %arrayidx, align 4
76  %iv.next = add nuw nsw i64 %iv, 1
77  %exitcond = icmp eq i64 %iv.next, 1000
78  br i1 %exitcond, label %for.end, label %for.body
79
80for.end:
81  ret void
82}
83
84define void @sin_f64_intrinsic(double* nocapture %varray) {
85; CHECK-LABEL: @sin_f64_intrinsic(
86; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_sin4(<4 x double> [[TMP4:%.*]])
87; CHECK:    ret void
88;
89entry:
90  br label %for.body
91
92for.body:
93  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
94  %tmp = trunc i64 %iv to i32
95  %conv = sitofp i32 %tmp to double
96  %call = tail call double @llvm.sin.f64(double %conv)
97  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
98  store double %call, double* %arrayidx, align 4
99  %iv.next = add nuw nsw i64 %iv, 1
100  %exitcond = icmp eq i64 %iv.next, 1000
101  br i1 %exitcond, label %for.end, label %for.body
102
103for.end:
104  ret void
105}
106
107define void @sin_f32_intrinsic(float* nocapture %varray) {
108; CHECK-LABEL: @sin_f32_intrinsic(
109; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_sinf4(<4 x float> [[TMP4:%.*]])
110; CHECK:    ret void
111;
112entry:
113  br label %for.body
114
115for.body:
116  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
117  %tmp = trunc i64 %iv to i32
118  %conv = sitofp i32 %tmp to float
119  %call = tail call float @llvm.sin.f32(float %conv)
120  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
121  store float %call, float* %arrayidx, align 4
122  %iv.next = add nuw nsw i64 %iv, 1
123  %exitcond = icmp eq i64 %iv.next, 1000
124  br i1 %exitcond, label %for.end, label %for.body
125
126for.end:
127  ret void
128}
129
130define void @cos_f64(double* nocapture %varray) {
131; CHECK-LABEL: @cos_f64(
132; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_cos4(<4 x double> [[TMP4:%.*]])
133; CHECK:    ret void
134;
135entry:
136  br label %for.body
137
138for.body:
139  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
140  %tmp = trunc i64 %iv to i32
141  %conv = sitofp i32 %tmp to double
142  %call = tail call double @cos(double %conv)
143  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
144  store double %call, double* %arrayidx, align 4
145  %iv.next = add nuw nsw i64 %iv, 1
146  %exitcond = icmp eq i64 %iv.next, 1000
147  br i1 %exitcond, label %for.end, label %for.body
148
149for.end:
150  ret void
151}
152
153define void @cos_f32(float* nocapture %varray) {
154; CHECK-LABEL: @cos_f32(
155; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_cosf4(<4 x float> [[TMP4:%.*]])
156; CHECK:    ret void
157;
158entry:
159  br label %for.body
160
161for.body:
162  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
163  %tmp = trunc i64 %iv to i32
164  %conv = sitofp i32 %tmp to float
165  %call = tail call float @cosf(float %conv)
166  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
167  store float %call, float* %arrayidx, align 4
168  %iv.next = add nuw nsw i64 %iv, 1
169  %exitcond = icmp eq i64 %iv.next, 1000
170  br i1 %exitcond, label %for.end, label %for.body
171
172for.end:
173  ret void
174}
175
176define void @cos_f64_intrinsic(double* nocapture %varray) {
177; CHECK-LABEL: @cos_f64_intrinsic(
178; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_cos4(<4 x double> [[TMP4:%.*]])
179; CHECK:    ret void
180;
181entry:
182  br label %for.body
183
184for.body:
185  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
186  %tmp = trunc i64 %iv to i32
187  %conv = sitofp i32 %tmp to double
188  %call = tail call double @llvm.cos.f64(double %conv)
189  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
190  store double %call, double* %arrayidx, align 4
191  %iv.next = add nuw nsw i64 %iv, 1
192  %exitcond = icmp eq i64 %iv.next, 1000
193  br i1 %exitcond, label %for.end, label %for.body
194
195for.end:
196  ret void
197}
198
199define void @cos_f32_intrinsic(float* nocapture %varray) {
200; CHECK-LABEL: @cos_f32_intrinsic(
201; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_cosf4(<4 x float> [[TMP4:%.*]])
202; CHECK:    ret void
203;
204entry:
205  br label %for.body
206
207for.body:
208  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
209  %tmp = trunc i64 %iv to i32
210  %conv = sitofp i32 %tmp to float
211  %call = tail call float @llvm.cos.f32(float %conv)
212  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
213  store float %call, float* %arrayidx, align 4
214  %iv.next = add nuw nsw i64 %iv, 1
215  %exitcond = icmp eq i64 %iv.next, 1000
216  br i1 %exitcond, label %for.end, label %for.body
217
218for.end:
219  ret void
220}
221
222define void @pow_f64(double* nocapture %varray, double* nocapture readonly %exp) {
223; CHECK-LABEL: @pow_f64(
224; CHECK:    [[TMP8:%.*]] = call <4 x double> @__svml_pow4(<4 x double> [[TMP4:%.*]], <4 x double> [[WIDE_LOAD:%.*]])
225; CHECK:    ret void
226;
227entry:
228  br label %for.body
229
230for.body:
231  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
232  %tmp = trunc i64 %iv to i32
233  %conv = sitofp i32 %tmp to double
234  %arrayidx = getelementptr inbounds double, double* %exp, i64 %iv
235  %tmp1 = load double, double* %arrayidx, align 4
236  %tmp2 = tail call double @pow(double %conv, double %tmp1)
237  %arrayidx2 = getelementptr inbounds double, double* %varray, i64 %iv
238  store double %tmp2, double* %arrayidx2, align 4
239  %iv.next = add nuw nsw i64 %iv, 1
240  %exitcond = icmp eq i64 %iv.next, 1000
241  br i1 %exitcond, label %for.end, label %for.body
242
243for.end:
244  ret void
245}
246
247define void @pow_f64_intrinsic(double* nocapture %varray, double* nocapture readonly %exp) {
248; CHECK-LABEL: @pow_f64_intrinsic(
249; CHECK:    [[TMP8:%.*]] = call <4 x double> @__svml_pow4(<4 x double> [[TMP4:%.*]], <4 x double> [[WIDE_LOAD:%.*]])
250; CHECK:    ret void
251;
252entry:
253  br label %for.body
254
255for.body:
256  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
257  %tmp = trunc i64 %iv to i32
258  %conv = sitofp i32 %tmp to double
259  %arrayidx = getelementptr inbounds double, double* %exp, i64 %iv
260  %tmp1 = load double, double* %arrayidx, align 4
261  %tmp2 = tail call double @llvm.pow.f64(double %conv, double %tmp1)
262  %arrayidx2 = getelementptr inbounds double, double* %varray, i64 %iv
263  store double %tmp2, double* %arrayidx2, align 4
264  %iv.next = add nuw nsw i64 %iv, 1
265  %exitcond = icmp eq i64 %iv.next, 1000
266  br i1 %exitcond, label %for.end, label %for.body
267
268for.end:
269  ret void
270}
271
272define void @pow_f32(float* nocapture %varray, float* nocapture readonly %exp) {
273; CHECK-LABEL: @pow_f32(
274; CHECK:    [[TMP8:%.*]] = call <4 x float> @__svml_powf4(<4 x float> [[TMP4:%.*]], <4 x float> [[WIDE_LOAD:%.*]])
275; CHECK:    ret void
276;
277entry:
278  br label %for.body
279
280for.body:
281  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
282  %tmp = trunc i64 %iv to i32
283  %conv = sitofp i32 %tmp to float
284  %arrayidx = getelementptr inbounds float, float* %exp, i64 %iv
285  %tmp1 = load float, float* %arrayidx, align 4
286  %tmp2 = tail call float @powf(float %conv, float %tmp1)
287  %arrayidx2 = getelementptr inbounds float, float* %varray, i64 %iv
288  store float %tmp2, float* %arrayidx2, align 4
289  %iv.next = add nuw nsw i64 %iv, 1
290  %exitcond = icmp eq i64 %iv.next, 1000
291  br i1 %exitcond, label %for.end, label %for.body
292
293for.end:
294  ret void
295}
296
297define void @pow_f32_intrinsic(float* nocapture %varray, float* nocapture readonly %exp) {
298; CHECK-LABEL: @pow_f32_intrinsic(
299; CHECK:    [[TMP8:%.*]] = call <4 x float> @__svml_powf4(<4 x float> [[TMP4:%.*]], <4 x float> [[WIDE_LOAD:%.*]])
300; CHECK:    ret void
301;
302entry:
303  br label %for.body
304
305for.body:
306  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
307  %tmp = trunc i64 %iv to i32
308  %conv = sitofp i32 %tmp to float
309  %arrayidx = getelementptr inbounds float, float* %exp, i64 %iv
310  %tmp1 = load float, float* %arrayidx, align 4
311  %tmp2 = tail call float @llvm.pow.f32(float %conv, float %tmp1)
312  %arrayidx2 = getelementptr inbounds float, float* %varray, i64 %iv
313  store float %tmp2, float* %arrayidx2, align 4
314  %iv.next = add nuw nsw i64 %iv, 1
315  %exitcond = icmp eq i64 %iv.next, 1000
316  br i1 %exitcond, label %for.end, label %for.body
317
318for.end:
319  ret void
320}
321
322define void @exp_f64(double* nocapture %varray) {
323; CHECK-LABEL: @exp_f64(
324; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_exp4(<4 x double> [[TMP4:%.*]])
325; CHECK:    ret void
326;
327entry:
328  br label %for.body
329
330for.body:
331  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
332  %tmp = trunc i64 %iv to i32
333  %conv = sitofp i32 %tmp to double
334  %call = tail call double @exp(double %conv)
335  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
336  store double %call, double* %arrayidx, align 4
337  %iv.next = add nuw nsw i64 %iv, 1
338  %exitcond = icmp eq i64 %iv.next, 1000
339  br i1 %exitcond, label %for.end, label %for.body
340
341for.end:
342  ret void
343}
344
345define void @exp_f32(float* nocapture %varray) {
346; CHECK-LABEL: @exp_f32(
347; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_expf4(<4 x float> [[TMP4:%.*]])
348; CHECK:    ret void
349;
350entry:
351  br label %for.body
352
353for.body:
354  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
355  %tmp = trunc i64 %iv to i32
356  %conv = sitofp i32 %tmp to float
357  %call = tail call float @expf(float %conv)
358  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
359  store float %call, float* %arrayidx, align 4
360  %iv.next = add nuw nsw i64 %iv, 1
361  %exitcond = icmp eq i64 %iv.next, 1000
362  br i1 %exitcond, label %for.end, label %for.body
363
364for.end:
365  ret void
366}
367
368define void @exp_f64_intrinsic(double* nocapture %varray) {
369; CHECK-LABEL: @exp_f64_intrinsic(
370; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_exp4(<4 x double> [[TMP4:%.*]])
371; CHECK:    ret void
372;
373entry:
374  br label %for.body
375
376for.body:
377  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
378  %tmp = trunc i64 %iv to i32
379  %conv = sitofp i32 %tmp to double
380  %call = tail call double @llvm.exp.f64(double %conv)
381  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
382  store double %call, double* %arrayidx, align 4
383  %iv.next = add nuw nsw i64 %iv, 1
384  %exitcond = icmp eq i64 %iv.next, 1000
385  br i1 %exitcond, label %for.end, label %for.body
386
387for.end:
388  ret void
389}
390
391define void @exp_f32_intrinsic(float* nocapture %varray) {
392; CHECK-LABEL: @exp_f32_intrinsic(
393; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_expf4(<4 x float> [[TMP4:%.*]])
394; CHECK:    ret void
395;
396entry:
397  br label %for.body
398
399for.body:
400  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
401  %tmp = trunc i64 %iv to i32
402  %conv = sitofp i32 %tmp to float
403  %call = tail call float @llvm.exp.f32(float %conv)
404  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
405  store float %call, float* %arrayidx, align 4
406  %iv.next = add nuw nsw i64 %iv, 1
407  %exitcond = icmp eq i64 %iv.next, 1000
408  br i1 %exitcond, label %for.end, label %for.body
409
410for.end:
411  ret void
412}
413
414define void @log_f64(double* nocapture %varray) {
415; CHECK-LABEL: @log_f64(
416; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_log4(<4 x double> [[TMP4:%.*]])
417; CHECK:    ret void
418;
419entry:
420  br label %for.body
421
422for.body:
423  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
424  %tmp = trunc i64 %iv to i32
425  %conv = sitofp i32 %tmp to double
426  %call = tail call double @log(double %conv)
427  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
428  store double %call, double* %arrayidx, align 4
429  %iv.next = add nuw nsw i64 %iv, 1
430  %exitcond = icmp eq i64 %iv.next, 1000
431  br i1 %exitcond, label %for.end, label %for.body
432
433for.end:
434  ret void
435}
436
437define void @log_f32(float* nocapture %varray) {
438; CHECK-LABEL: @log_f32(
439; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_logf4(<4 x float> [[TMP4:%.*]])
440; CHECK:    ret void
441;
442entry:
443  br label %for.body
444
445for.body:
446  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
447  %tmp = trunc i64 %iv to i32
448  %conv = sitofp i32 %tmp to float
449  %call = tail call float @logf(float %conv)
450  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
451  store float %call, float* %arrayidx, align 4
452  %iv.next = add nuw nsw i64 %iv, 1
453  %exitcond = icmp eq i64 %iv.next, 1000
454  br i1 %exitcond, label %for.end, label %for.body
455
456for.end:
457  ret void
458}
459
460define void @log_f64_intrinsic(double* nocapture %varray) {
461; CHECK-LABEL: @log_f64_intrinsic(
462; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_log4(<4 x double> [[TMP4:%.*]])
463; CHECK:    ret void
464;
465entry:
466  br label %for.body
467
468for.body:
469  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
470  %tmp = trunc i64 %iv to i32
471  %conv = sitofp i32 %tmp to double
472  %call = tail call double @llvm.log.f64(double %conv)
473  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
474  store double %call, double* %arrayidx, align 4
475  %iv.next = add nuw nsw i64 %iv, 1
476  %exitcond = icmp eq i64 %iv.next, 1000
477  br i1 %exitcond, label %for.end, label %for.body
478
479for.end:
480  ret void
481}
482
483define void @log_f32_intrinsic(float* nocapture %varray) {
484; CHECK-LABEL: @log_f32_intrinsic(
485; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_logf4(<4 x float> [[TMP4:%.*]])
486; CHECK:    ret void
487;
488entry:
489  br label %for.body
490
491for.body:
492  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
493  %tmp = trunc i64 %iv to i32
494  %conv = sitofp i32 %tmp to float
495  %call = tail call float @llvm.log.f32(float %conv)
496  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
497  store float %call, float* %arrayidx, align 4
498  %iv.next = add nuw nsw i64 %iv, 1
499  %exitcond = icmp eq i64 %iv.next, 1000
500  br i1 %exitcond, label %for.end, label %for.body
501
502for.end:
503  ret void
504}
505
506define void @exp2_f64(double* nocapture %varray) {
507; CHECK-LABEL: @exp2_f64(
508; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_exp24(<4 x double> [[TMP4:%.*]])
509; CHECK:    ret void
510;
511entry:
512  br label %for.body
513
514for.body:
515  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
516  %tmp = trunc i64 %iv to i32
517  %conv = sitofp i32 %tmp to double
518  %call = tail call double @exp2(double %conv)
519  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
520  store double %call, double* %arrayidx, align 4
521  %iv.next = add nuw nsw i64 %iv, 1
522  %exitcond = icmp eq i64 %iv.next, 1000
523  br i1 %exitcond, label %for.end, label %for.body
524
525for.end:
526  ret void
527}
528
529define void @exp2_f32(float* nocapture %varray) {
530; CHECK-LABEL: @exp2_f32(
531; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_exp2f4(<4 x float> [[TMP4:%.*]])
532; CHECK:    ret void
533;
534entry:
535  br label %for.body
536
537for.body:
538  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
539  %tmp = trunc i64 %iv to i32
540  %conv = sitofp i32 %tmp to float
541  %call = tail call float @exp2f(float %conv)
542  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
543  store float %call, float* %arrayidx, align 4
544  %iv.next = add nuw nsw i64 %iv, 1
545  %exitcond = icmp eq i64 %iv.next, 1000
546  br i1 %exitcond, label %for.end, label %for.body
547
548for.end:
549  ret void
550}
551
552define void @exp2_f64_intrinsic(double* nocapture %varray) {
553; CHECK-LABEL: @exp2_f64_intrinsic(
554; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_exp24(<4 x double> [[TMP4:%.*]])
555; CHECK:    ret void
556;
557entry:
558  br label %for.body
559
560for.body:
561  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
562  %tmp = trunc i64 %iv to i32
563  %conv = sitofp i32 %tmp to double
564  %call = tail call double @llvm.exp2.f64(double %conv)
565  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
566  store double %call, double* %arrayidx, align 4
567  %iv.next = add nuw nsw i64 %iv, 1
568  %exitcond = icmp eq i64 %iv.next, 1000
569  br i1 %exitcond, label %for.end, label %for.body
570
571for.end:
572  ret void
573}
574
575define void @exp2_f32_intrinsic(float* nocapture %varray) {
576; CHECK-LABEL: @exp2_f32_intrinsic(
577; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_exp2f4(<4 x float> [[TMP4:%.*]])
578; CHECK:    ret void
579;
580entry:
581  br label %for.body
582
583for.body:
584  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
585  %tmp = trunc i64 %iv to i32
586  %conv = sitofp i32 %tmp to float
587  %call = tail call float @llvm.exp2.f32(float %conv)
588  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
589  store float %call, float* %arrayidx, align 4
590  %iv.next = add nuw nsw i64 %iv, 1
591  %exitcond = icmp eq i64 %iv.next, 1000
592  br i1 %exitcond, label %for.end, label %for.body
593
594for.end:
595  ret void
596}
597
598define void @exp2f_finite(float* nocapture %varray) {
599; CHECK-LABEL: @exp2f_finite(
600; CHECK:    [[TMP5:%.*]] = call <4 x float> @__svml_exp2f4(<4 x float> [[TMP4:%.*]])
601; CHECK:    ret void
602;
603entry:
604  br label %for.body
605
606for.body:
607  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
608  %tmp = trunc i64 %iv to i32
609  %conv = sitofp i32 %tmp to float
610  %call = tail call float @__exp2f_finite(float %conv)
611  %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
612  store float %call, float* %arrayidx, align 4
613  %iv.next = add nuw nsw i64 %iv, 1
614  %exitcond = icmp eq i64 %iv.next, 1000
615  br i1 %exitcond, label %for.end, label %for.body
616
617for.end:
618  ret void
619}
620
621define void @exp2_finite(double* nocapture %varray) {
622; CHECK-LABEL: @exp2_finite(
623; CHECK:    [[TMP5:%.*]] = call <4 x double> @__svml_exp24(<4 x double> [[TMP4:%.*]])
624; CHECK:    ret void
625;
626entry:
627  br label %for.body
628
629for.body:
630  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
631  %tmp = trunc i64 %iv to i32
632  %conv = sitofp i32 %tmp to double
633  %call = tail call double @__exp2_finite(double %conv)
634  %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
635  store double %call, double* %arrayidx, align 4
636  %iv.next = add nuw nsw i64 %iv, 1
637  %exitcond = icmp eq i64 %iv.next, 1000
638  br i1 %exitcond, label %for.end, label %for.body
639
640for.end:
641  ret void
642}
643
644attributes #0 = { nounwind readnone }
645