From: Philip Reames Date: Thu, 9 May 2019 23:13:09 +0000 (+0000) Subject: Compile time tweak for libcall lookup X-Git-Tag: android-x86-9.0-r1~3619 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f34129d190e554cfe78c3e0db58f170e090925e9;p=android-x86%2Fexternal-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360391 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/TargetLibraryInfo.cpp b/lib/Analysis/TargetLibraryInfo.cpp index 10bb4ab17ca..97b5ef2f6bc 100644 --- a/lib/Analysis/TargetLibraryInfo.cpp +++ b/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) &&