[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
Date: Wed Mar 22 07:01:57 2017
New Revision: 298496
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
--- 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