[PATCH] D23222: Chang sign of LastCallToStaticBouns

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 14:23:20 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL278290: Changed sign of LastCallToStaticBouns (authored by Prazek).

Changed prior to commit:
  https://reviews.llvm.org/D23222?vs=67602&id=67603#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23222

Files:
  llvm/trunk/include/llvm/Analysis/InlineCost.h
  llvm/trunk/lib/Analysis/InlineCost.cpp
  llvm/trunk/lib/Transforms/IPO/Inliner.cpp

Index: llvm/trunk/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp
+++ llvm/trunk/lib/Analysis/InlineCost.cpp
@@ -1257,7 +1257,7 @@
   bool OnlyOneCallAndLocalLinkage =
       F.hasLocalLinkage() && F.hasOneUse() && &F == CS.getCalledFunction();
   if (OnlyOneCallAndLocalLinkage)
-    Cost += InlineConstants::LastCallToStaticBonus;
+    Cost -= InlineConstants::LastCallToStaticBonus;
 
   // If this function uses the coldcc calling convention, prefer not to inline
   // it.
Index: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp
@@ -312,7 +312,7 @@
   // be removed entirely.  We did not account for this above unless there
   // is only one caller of Caller.
   if (callerWillBeRemoved && !Caller->use_empty())
-    TotalSecondaryCost += InlineConstants::LastCallToStaticBonus;
+    TotalSecondaryCost -= InlineConstants::LastCallToStaticBonus;
 
   if (inliningPreventsSomeOuterInline && TotalSecondaryCost < IC.getCost())
     return true;
Index: llvm/trunk/include/llvm/Analysis/InlineCost.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/InlineCost.h
+++ llvm/trunk/include/llvm/Analysis/InlineCost.h
@@ -42,7 +42,7 @@
 const int InstrCost = 5;
 const int IndirectCallThreshold = 100;
 const int CallPenalty = 25;
-const int LastCallToStaticBonus = -15000;
+const int LastCallToStaticBonus = 15000;
 const int ColdccPenalty = 2000;
 const int NoreturnPenalty = 10000;
 /// Do not inline functions which allocate this many bytes on the stack


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23222.67603.patch
Type: text/x-patch
Size: 1753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160810/fb4ab440/attachment.bin>


More information about the llvm-commits mailing list