[llvm] r360391 - Compile time tweak for libcall lookup

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 16:13:09 PDT 2019


Author: reames
Date: Thu May  9 16:13:09 2019
New Revision: 360391

URL: http://llvm.org/viewvc/llvm-project?rev=360391&view=rev
Log:
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.


Modified:
    llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp

Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=360391&r1=360390&r2=360391&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Thu May  9 16:13:09 2019
@@ -1434,6 +1434,11 @@ bool TargetLibraryInfoImpl::isValidProto
 
 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) &&




More information about the llvm-commits mailing list