[llvm-commits] [llvm] r76730 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Eli Friedman eli.friedman at gmail.com
Wed Jul 22 01:13:00 PDT 2009


Author: efriedma
Date: Wed Jul 22 03:12:59 2009
New Revision: 76730

URL: http://llvm.org/viewvc/llvm-project?rev=76730&view=rev
Log:
Don't give a massive inlining cost bonus to available_externally 
functions with a single use; eliminating the single use may eliminate 
the function from the current module, but usually doesn't eliminate 
it from the final program.


Modified:
    llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=76730&r1=76729&r2=76730&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Wed Jul 22 03:12:59 2009
@@ -201,8 +201,7 @@
   // If there is only one call of the function, and it has internal linkage,
   // make it almost guaranteed to be inlined.
   //
-  if ((Callee->hasLocalLinkage() || Callee->hasAvailableExternallyLinkage()) && 
-      Callee->hasOneUse())
+  if (Callee->hasLocalLinkage() && Callee->hasOneUse())
     InlineCost -= 15000;
   
   // If this function uses the coldcc calling convention, prefer not to inline





More information about the llvm-commits mailing list