summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/TargetLibraryInfo.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-06-07 18:21:24 +0000
committerSanjay Patel <spatel@rotateright.com>2018-06-07 18:21:24 +0000
commit4b1205b40f0c35b25c90cf42e073a793e43bb0f1 (patch)
tree141a87721d1087a857edc66abcc7780ab946b5cf /llvm/lib/Analysis/TargetLibraryInfo.cpp
parentc3bc63e54b6da558c4132050a29967748233d578 (diff)
downloadbcm5719-llvm-4b1205b40f0c35b25c90cf42e073a793e43bb0f1.tar.gz
bcm5719-llvm-4b1205b40f0c35b25c90cf42e073a793e43bb0f1.zip
[TargetLibraryInfo] add mappings from LLVM sin/cos intrinsics to SVML calls
These weren't included in D19544 - probably just an oversight. D40044 made it more likely that we'll have LLVM math intrinsics rather than libcalls, so this bug was more easily exposed. As the tests/code show, we already have the complete mappings for pow/exp/log. I don't have any experience with SVML, so I don't know if anything else is missing. It's also not clear to me that we should be doing this transform in IR rather than DAG/isel, but that's a separate issue. Differential Revision: https://reviews.llvm.org/D47610 llvm-svn: 334211
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetLibraryInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp
index b223662bed1..7fff22e8af7 100644
--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -1461,6 +1461,14 @@ void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(
{"sinf", "__svml_sinf8", 8},
{"sinf", "__svml_sinf16", 16},
+ {"llvm.sin.f64", "__svml_sin2", 2},
+ {"llvm.sin.f64", "__svml_sin4", 4},
+ {"llvm.sin.f64", "__svml_sin8", 8},
+
+ {"llvm.sin.f32", "__svml_sinf4", 4},
+ {"llvm.sin.f32", "__svml_sinf8", 8},
+ {"llvm.sin.f32", "__svml_sinf16", 16},
+
{"cos", "__svml_cos2", 2},
{"cos", "__svml_cos4", 4},
{"cos", "__svml_cos8", 8},
@@ -1469,6 +1477,14 @@ void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(
{"cosf", "__svml_cosf8", 8},
{"cosf", "__svml_cosf16", 16},
+ {"llvm.cos.f64", "__svml_cos2", 2},
+ {"llvm.cos.f64", "__svml_cos4", 4},
+ {"llvm.cos.f64", "__svml_cos8", 8},
+
+ {"llvm.cos.f32", "__svml_cosf4", 4},
+ {"llvm.cos.f32", "__svml_cosf8", 8},
+ {"llvm.cos.f32", "__svml_cosf16", 16},
+
{"pow", "__svml_pow2", 2},
{"pow", "__svml_pow4", 4},
{"pow", "__svml_pow8", 8},
OpenPOWER on IntegriCloud