Skip to content

Commit ca37678

Browse files
committed
[LoopVectorize] Move testing for SVML vectorization of exp2f_finite/exp2_finite from svml-calls.ll to svml-calls-finite.ll where the finite versions of log, pow, and exp already were.
1 parent f3d3cec commit ca37678

File tree

2 files changed

+58
-48
lines changed

2 files changed

+58
-48
lines changed

llvm/test/Transforms/LoopVectorize/X86/svml-calls-finite.ll

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,61 @@ for.end: ; preds = %for.body
185185
!51 = distinct !{!51, !52, !53}
186186
!52 = !{!"llvm.loop.vectorize.width", i32 4}
187187
!53 = !{!"llvm.loop.vectorize.enable", i1 true}
188+
189+
declare float @__exp2f_finite(float) #0
190+
191+
define void @exp2f_finite(float* nocapture %varray) {
192+
; CHECK-LABEL: @exp2f_finite(
193+
; CHECK: call <4 x float> @__svml_exp2f4(<4 x float> %{{.*}})
194+
; CHECK: ret void
195+
;
196+
entry:
197+
br label %for.body
198+
199+
for.body:
200+
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
201+
%tmp = trunc i64 %iv to i32
202+
%conv = sitofp i32 %tmp to float
203+
%call = tail call float @__exp2f_finite(float %conv)
204+
%arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
205+
store float %call, float* %arrayidx, align 4
206+
%iv.next = add nuw nsw i64 %iv, 1
207+
%exitcond = icmp eq i64 %iv.next, 1000
208+
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !61
209+
210+
for.end:
211+
ret void
212+
}
213+
214+
!61 = distinct !{!61, !62, !63}
215+
!62 = !{!"llvm.loop.vectorize.width", i32 4}
216+
!63 = !{!"llvm.loop.vectorize.enable", i1 true}
217+
218+
declare double @__exp2_finite(double) #0
219+
220+
define void @exp2_finite(double* nocapture %varray) {
221+
; CHECK-LABEL: @exp2_finite(
222+
; CHECK: call <4 x double> @__svml_exp24(<4 x double> {{.*}})
223+
; CHECK: ret void
224+
;
225+
entry:
226+
br label %for.body
227+
228+
for.body:
229+
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
230+
%tmp = trunc i64 %iv to i32
231+
%conv = sitofp i32 %tmp to double
232+
%call = tail call double @__exp2_finite(double %conv)
233+
%arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
234+
store double %call, double* %arrayidx, align 4
235+
%iv.next = add nuw nsw i64 %iv, 1
236+
%exitcond = icmp eq i64 %iv.next, 1000
237+
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !71
238+
239+
for.end:
240+
ret void
241+
}
242+
243+
!71 = distinct !{!71, !72, !73}
244+
!72 = !{!"llvm.loop.vectorize.width", i32 4}
245+
!73 = !{!"llvm.loop.vectorize.enable", i1 true}

llvm/test/Transforms/LoopVectorize/X86/svml-calls.ll

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ declare double @exp2(double) #0
3232
declare float @exp2f(float) #0
3333
declare double @llvm.exp2.f64(double) #0
3434
declare float @llvm.exp2.f32(float) #0
35-
declare double @__exp2_finite(double) #0
36-
declare float @__exp2f_finite(float) #0
3735

3836
define void @sin_f64(double* nocapture %varray) {
3937
; CHECK-LABEL: @sin_f64(
@@ -595,50 +593,4 @@ for.end:
595593
ret void
596594
}
597595

598-
define 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-
;
603-
entry:
604-
br label %for.body
605-
606-
for.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-
617-
for.end:
618-
ret void
619-
}
620-
621-
define 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-
;
626-
entry:
627-
br label %for.body
628-
629-
for.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-
640-
for.end:
641-
ret void
642-
}
643-
644596
attributes #0 = { nounwind readnone }

0 commit comments

Comments
 (0)