]> granicus.if.org Git - llvm/commitdiff
r286814 resulted that CallPenalty can be subtracted twice:
authorEvgeny Astigeevich <evgeny.astigeevich@arm.com>
Wed, 22 Mar 2017 12:01:57 +0000 (12:01 +0000)
committerEvgeny Astigeevich <evgeny.astigeevich@arm.com>
Wed, 22 Mar 2017 12:01:57 +0000 (12:01 +0000)
- First time, during calculation of the cost in InlineCost.cpp
- Second time, during calculation of the cost in Inliner.cpp

This patches fixes this.

Differential Revision: https://reviews.llvm.org/D31137

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298496 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/Inliner.cpp

index 31589ac99eea13c67cfc83b9126ce7867a8a2db7..6c83c99ae3be5ebb83a0c3fa10a7eaee5fbade61 100644 (file)
@@ -289,7 +289,7 @@ shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC,
   // treating them as truly abstract units etc.
   TotalSecondaryCost = 0;
   // The candidate cost to be imposed upon the current function.
-  int CandidateCost = IC.getCost() - (InlineConstants::CallPenalty + 1);
+  int CandidateCost = IC.getCost() - 1;
   // This bool tracks what happens if we do NOT inline C into B.
   bool callerWillBeRemoved = Caller->hasLocalLinkage();
   // This bool tracks what happens if we DO inline C into B.