summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/TargetLibraryInfo.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-05-09 23:13:09 +0000
committerPhilip Reames <listmail@philipreames.com>2019-05-09 23:13:09 +0000
commit76ea748d2d24144c1a50c0ce5c5b41dbcab0ac15 (patch)
tree137b1084c0abc087c681d2f61b4859e1dc70d66f /llvm/lib/Analysis/TargetLibraryInfo.cpp
parent3478494c1fdcbbee3e22895dcd6e6919d6c05430 (diff)
downloadbcm5719-llvm-76ea748d2d24144c1a50c0ce5c5b41dbcab0ac15.tar.gz
bcm5719-llvm-76ea748d2d24144c1a50c0ce5c5b41dbcab0ac15.zip
Compile time tweak for libcall lookup
If we have a large module which is mostly intrinsics, we hammer the lib call lookup path from CodeGenPrepare. Adding a fastpath reduces compile by 15% for one such example. The problem is really more general than intrinsics - a module with lots of non-intrinsics non-libcall calls has the same problem - but we might as well avoid an easy case quickly. llvm-svn: 360391
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetLibraryInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp
index 10bb4ab17ca..97b5ef2f6bc 100644
--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -1434,6 +1434,11 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
bool TargetLibraryInfoImpl::getLibFunc(const Function &FDecl,
LibFunc &F) const {
+ // Intrinsics don't overlap w/libcalls; if our module has a large number of
+ // intrinsics, this ends up being an interesting compile time win since we
+ // avoid string normalization and comparison.
+ if (FDecl.isIntrinsic()) return false;
+
const DataLayout *DL =
FDecl.getParent() ? &FDecl.getParent()->getDataLayout() : nullptr;
return getLibFunc(FDecl.getName(), F) &&
OpenPOWER on IntegriCloud