aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-08-24 16:51:46 +0000
committerDan Gohman <dan433584@gmail.com>2015-08-24 16:51:46 +0000
commit01612f627d86321f352c6b4fbd05394be36778a2 (patch)
tree0f0b8351a9c67aef0d13d431571bfcfd070af3d3 /llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
parente419a7c307b91b359dfd6b9dd78666d02bf478a7 (diff)
downloadllvm-01612f627d86321f352c6b4fbd05394be36778a2.zip
llvm-01612f627d86321f352c6b4fbd05394be36778a2.tar.gz
llvm-01612f627d86321f352c6b4fbd05394be36778a2.tar.bz2
[WebAssembly] Tell TargetTransformInfo about popcnt and sqrt.
llvm-svn: 245853
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
index fa88ed5..559932f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
@@ -21,8 +21,13 @@ using namespace llvm;
#define DEBUG_TYPE "wasmtti"
TargetTransformInfo::PopcntSupportKind
-WebAssemblyTTIImpl::getPopcntSupport(unsigned TyWidth) {
+WebAssemblyTTIImpl::getPopcntSupport(unsigned TyWidth) const {
assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");
- // TODO: Make Math.popcount32 happen in WebAssembly.
- return TTI::PSK_Software;
+ return TargetTransformInfo::PSK_FastHardware;
+}
+
+bool
+WebAssemblyTTIImpl::haveFastSqrt(Type *Ty) const {
+ assert(Ty->isFPOrFPVectorTy() && "Ty must be floating point");
+ return true;
}