[llvm] r298496 - r286814 resulted that CallPenalty can be subtracted twice:
Evgeny Astigeevich via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 05:01:58 PDT 2017
Author: eastig
Date: Wed Mar 22 07:01:57 2017
New Revision: 298496
URL: http://llvm.org/viewvc/llvm-project?rev=298496&view=rev
Log:
r286814 resulted that CallPenalty can be subtracted twice:
- 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
Modified:
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=298496&r1=298495&r2=298496&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Wed Mar 22 07:01:57 2017
@@ -289,7 +289,7 @@ shouldBeDeferred(Function *Caller, CallS
// 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.
More information about the llvm-commits
mailing list