[llvm] [TLI] Add x86 libmvec mappings for GLIBC 2.35 vector functions (PR #206274)
Tõnu Samuel via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 27 11:38:04 PDT 2026
https://github.com/tonuonu updated https://github.com/llvm/llvm-project/pull/206274
>From f150c63f9554a18e7bac589404bc6ee12d324040 Mon Sep 17 00:00:00 2001
From: Tonu Samuel <tonu at spam.ee>
Date: Sat, 27 Jun 2026 21:19:47 +0300
Subject: [PATCH] [TLI] Add x86 libmvec mappings for GLIBC 2.35 vector
functions
glibc 2.35 added x86_64 libmvec vector implementations of erf, erfc, cbrt,
expm1, log1p, asinh, acosh and atanh, but LLVM's x86 libmvec table in
VecFuncs.def was never updated, so -fveclib=libmvec could not vectorize
loops over these functions on x86 (the AArch64 libmvec table already maps
them). Add the missing SSE/AVX2 mappings, matching the existing exp/log
entries, and extend the LoopVectorize test.
---
llvm/include/llvm/Analysis/VecFuncs.def | 50 ++
.../LoopVectorize/X86/libm-vector-calls.ll | 440 ++++++++++++++++++
2 files changed, 490 insertions(+)
diff --git a/llvm/include/llvm/Analysis/VecFuncs.def b/llvm/include/llvm/Analysis/VecFuncs.def
index e7b949bc073ae..14327197cf9d3 100644
--- a/llvm/include/llvm/Analysis/VecFuncs.def
+++ b/llvm/include/llvm/Analysis/VecFuncs.def
@@ -237,6 +237,56 @@ TLI_DEFINE_VECFUNC("llvm.log.f64", "_ZGVdN4v_log", FIXED(4), "_ZGV_LLVM_N4v")
TLI_DEFINE_VECFUNC("llvm.log.f32", "_ZGVbN4v_logf", FIXED(4), "_ZGV_LLVM_N4v")
TLI_DEFINE_VECFUNC("llvm.log.f32", "_ZGVdN8v_logf", FIXED(8), "_ZGV_LLVM_N8v")
+// Functions added to libmvec in GLIBC 2.35 (no corresponding LLVM intrinsic).
+
+TLI_DEFINE_VECFUNC("erf", "_ZGVbN2v_erf", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("erf", "_ZGVdN4v_erf", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("erff", "_ZGVbN4v_erff", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("erff", "_ZGVdN8v_erff", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("erfc", "_ZGVbN2v_erfc", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("erfc", "_ZGVdN4v_erfc", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("erfcf", "_ZGVbN4v_erfcf", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("erfcf", "_ZGVdN8v_erfcf", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("cbrt", "_ZGVbN2v_cbrt", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("cbrt", "_ZGVdN4v_cbrt", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("cbrtf", "_ZGVbN4v_cbrtf", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("cbrtf", "_ZGVdN8v_cbrtf", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("expm1", "_ZGVbN2v_expm1", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("expm1", "_ZGVdN4v_expm1", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("expm1f", "_ZGVbN4v_expm1f", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("expm1f", "_ZGVdN8v_expm1f", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("log1p", "_ZGVbN2v_log1p", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("log1p", "_ZGVdN4v_log1p", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("log1pf", "_ZGVbN4v_log1pf", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("log1pf", "_ZGVdN8v_log1pf", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("asinh", "_ZGVbN2v_asinh", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("asinh", "_ZGVdN4v_asinh", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("asinhf", "_ZGVbN4v_asinhf", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("asinhf", "_ZGVdN8v_asinhf", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("acosh", "_ZGVbN2v_acosh", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("acosh", "_ZGVdN4v_acosh", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("acoshf", "_ZGVbN4v_acoshf", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("acoshf", "_ZGVdN8v_acoshf", FIXED(8), "_ZGV_LLVM_N8v")
+
+TLI_DEFINE_VECFUNC("atanh", "_ZGVbN2v_atanh", FIXED(2), "_ZGV_LLVM_N2v")
+TLI_DEFINE_VECFUNC("atanh", "_ZGVdN4v_atanh", FIXED(4), "_ZGV_LLVM_N4v")
+
+TLI_DEFINE_VECFUNC("atanhf", "_ZGVbN4v_atanhf", FIXED(4), "_ZGV_LLVM_N4v")
+TLI_DEFINE_VECFUNC("atanhf", "_ZGVdN8v_atanhf", FIXED(8), "_ZGV_LLVM_N8v")
+
#elif defined(TLI_DEFINE_LIBMVEC_AARCH64_VECFUNCS)
TLI_DEFINE_VECFUNC("acos", "_ZGVnN2v_acos", FIXED(2), NOMASK, "_ZGV_LLVM_N2v", CallingConv::AArch64_VectorCall)
diff --git a/llvm/test/Transforms/LoopVectorize/X86/libm-vector-calls.ll b/llvm/test/Transforms/LoopVectorize/X86/libm-vector-calls.ll
index 071f262ec903b..25e99bce44944 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/libm-vector-calls.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/libm-vector-calls.ll
@@ -365,3 +365,443 @@ declare float @cosf(float) #0
declare float @expf(float) #0
declare float @powf(float, float) #0
declare float @logf(float) #0
+
+
+; GLIBC 2.35 libmvec functions (no corresponding LLVM intrinsic)
+declare float @erff(float) #0
+declare float @erfcf(float) #0
+declare float @cbrtf(float) #0
+declare float @expm1f(float) #0
+declare float @log1pf(float) #0
+declare float @asinhf(float) #0
+declare float @acoshf(float) #0
+declare float @atanhf(float) #0
+
+define void @erf_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @erf_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_erff
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @erff(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !134
+
+for.end:
+ ret void
+}
+
+!134 = distinct !{!134, !135, !136}
+!135 = !{!"llvm.loop.vectorize.width", i32 4}
+!136 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @erfc_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @erfc_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_erfcf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @erfcf(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !137
+
+for.end:
+ ret void
+}
+
+!137 = distinct !{!137, !138, !139}
+!138 = !{!"llvm.loop.vectorize.width", i32 4}
+!139 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @cbrt_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @cbrt_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_cbrtf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @cbrtf(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !140
+
+for.end:
+ ret void
+}
+
+!140 = distinct !{!140, !141, !142}
+!141 = !{!"llvm.loop.vectorize.width", i32 4}
+!142 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @expm1_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @expm1_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_expm1f
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @expm1f(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !143
+
+for.end:
+ ret void
+}
+
+!143 = distinct !{!143, !144, !145}
+!144 = !{!"llvm.loop.vectorize.width", i32 4}
+!145 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @log1p_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @log1p_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_log1pf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @log1pf(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !146
+
+for.end:
+ ret void
+}
+
+!146 = distinct !{!146, !147, !148}
+!147 = !{!"llvm.loop.vectorize.width", i32 4}
+!148 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @asinh_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @asinh_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_asinhf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @asinhf(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !149
+
+for.end:
+ ret void
+}
+
+!149 = distinct !{!149, !150, !151}
+!150 = !{!"llvm.loop.vectorize.width", i32 4}
+!151 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @acosh_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @acosh_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_acoshf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @acoshf(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !152
+
+for.end:
+ ret void
+}
+
+!152 = distinct !{!152, !153, !154}
+!153 = !{!"llvm.loop.vectorize.width", i32 4}
+!154 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @atanh_f32(ptr nocapture %varray) {
+; CHECK-LABEL: @atanh_f32
+; CHECK-LABEL: vector.body
+; CHECK: <4 x float> @_ZGVbN4v_atanhf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to float
+ %call = tail call fast float @atanhf(float %conv)
+ %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv
+ store float %call, ptr %arrayidx, align 4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !155
+
+for.end:
+ ret void
+}
+
+!155 = distinct !{!155, !156, !157}
+!156 = !{!"llvm.loop.vectorize.width", i32 4}
+!157 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+
+
+; GLIBC 2.35 libmvec functions, f64 (no corresponding LLVM intrinsic)
+declare double @erf(double) #0
+declare double @erfc(double) #0
+declare double @cbrt(double) #0
+declare double @expm1(double) #0
+declare double @log1p(double) #0
+declare double @asinh(double) #0
+declare double @acosh(double) #0
+declare double @atanh(double) #0
+
+define void @erf_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @erf_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_erf
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @erf(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !158
+
+for.end:
+ ret void
+}
+
+!158 = distinct !{!158, !159, !160}
+!159 = !{!"llvm.loop.vectorize.width", i32 2}
+!160 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @erfc_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @erfc_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_erfc
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @erfc(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !161
+
+for.end:
+ ret void
+}
+
+!161 = distinct !{!161, !162, !163}
+!162 = !{!"llvm.loop.vectorize.width", i32 2}
+!163 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @cbrt_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @cbrt_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_cbrt
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @cbrt(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !164
+
+for.end:
+ ret void
+}
+
+!164 = distinct !{!164, !165, !166}
+!165 = !{!"llvm.loop.vectorize.width", i32 2}
+!166 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @expm1_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @expm1_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_expm1
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @expm1(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !167
+
+for.end:
+ ret void
+}
+
+!167 = distinct !{!167, !168, !169}
+!168 = !{!"llvm.loop.vectorize.width", i32 2}
+!169 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @log1p_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @log1p_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_log1p
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @log1p(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !170
+
+for.end:
+ ret void
+}
+
+!170 = distinct !{!170, !171, !172}
+!171 = !{!"llvm.loop.vectorize.width", i32 2}
+!172 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @asinh_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @asinh_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_asinh
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @asinh(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !173
+
+for.end:
+ ret void
+}
+
+!173 = distinct !{!173, !174, !175}
+!174 = !{!"llvm.loop.vectorize.width", i32 2}
+!175 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @acosh_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @acosh_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_acosh
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @acosh(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !176
+
+for.end:
+ ret void
+}
+
+!176 = distinct !{!176, !177, !178}
+!177 = !{!"llvm.loop.vectorize.width", i32 2}
+!178 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+define void @atanh_f64(ptr nocapture %varray) {
+; CHECK-LABEL: @atanh_f64
+; CHECK-LABEL: vector.body
+; CHECK: <2 x double> @_ZGVbN2v_atanh
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %tmp = trunc i64 %indvars.iv to i32
+ %conv = sitofp i32 %tmp to double
+ %call = tail call fast double @atanh(double %conv)
+ %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv
+ store double %call, ptr %arrayidx, align 8
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1000
+ br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !179
+
+for.end:
+ ret void
+}
+
+!179 = distinct !{!179, !180, !181}
+!180 = !{!"llvm.loop.vectorize.width", i32 2}
+!181 = !{!"llvm.loop.vectorize.enable", i1 true}
+
More information about the llvm-commits
mailing list