forked from OSchip/llvm-project
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
This commit is contained in:
parent
3478494c1f
commit
76ea748d2d
|
@ -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) &&
|
||||
|
|
Loading…
Reference in New Issue