Skip to content

Commit 76ea748

Browse files
committed
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
1 parent 3478494 commit 76ea748

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Analysis/TargetLibraryInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,11 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
14341434

14351435
bool TargetLibraryInfoImpl::getLibFunc(const Function &FDecl,
14361436
LibFunc &F) const {
1437+
// Intrinsics don't overlap w/libcalls; if our module has a large number of
1438+
// intrinsics, this ends up being an interesting compile time win since we
1439+
// avoid string normalization and comparison.
1440+
if (FDecl.isIntrinsic()) return false;
1441+
14371442
const DataLayout *DL =
14381443
FDecl.getParent() ? &FDecl.getParent()->getDataLayout() : nullptr;
14391444
return getLibFunc(FDecl.getName(), F) &&

0 commit comments

Comments
 (0)