forked from OSchip/llvm-project
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-svn: 298496
This commit is contained in:
parent
b19a507a88
commit
7823c66e05
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue