forked from OSchip/llvm-project
Changed sign of LastCallToStaticBouns
Summary: I think it is much better this way. When I firstly saw line: Cost += InlineConstants::LastCallToStaticBonus; I though that this is a bug, because everywhere where the cost is being reduced it is usuing -=. Reviewers: eraman, tejohnson, mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23222 llvm-svn: 278290
This commit is contained in:
parent
c8b3717344
commit
d89875ca39
|
@ -42,7 +42,7 @@ const int OptAggressiveThreshold = 275;
|
||||||
const int InstrCost = 5;
|
const int InstrCost = 5;
|
||||||
const int IndirectCallThreshold = 100;
|
const int IndirectCallThreshold = 100;
|
||||||
const int CallPenalty = 25;
|
const int CallPenalty = 25;
|
||||||
const int LastCallToStaticBonus = -15000;
|
const int LastCallToStaticBonus = 15000;
|
||||||
const int ColdccPenalty = 2000;
|
const int ColdccPenalty = 2000;
|
||||||
const int NoreturnPenalty = 10000;
|
const int NoreturnPenalty = 10000;
|
||||||
/// Do not inline functions which allocate this many bytes on the stack
|
/// Do not inline functions which allocate this many bytes on the stack
|
||||||
|
|
|
@ -1257,7 +1257,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) {
|
||||||
bool OnlyOneCallAndLocalLinkage =
|
bool OnlyOneCallAndLocalLinkage =
|
||||||
F.hasLocalLinkage() && F.hasOneUse() && &F == CS.getCalledFunction();
|
F.hasLocalLinkage() && F.hasOneUse() && &F == CS.getCalledFunction();
|
||||||
if (OnlyOneCallAndLocalLinkage)
|
if (OnlyOneCallAndLocalLinkage)
|
||||||
Cost += InlineConstants::LastCallToStaticBonus;
|
Cost -= InlineConstants::LastCallToStaticBonus;
|
||||||
|
|
||||||
// If this function uses the coldcc calling convention, prefer not to inline
|
// If this function uses the coldcc calling convention, prefer not to inline
|
||||||
// it.
|
// it.
|
||||||
|
|
|
@ -312,7 +312,7 @@ shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC,
|
||||||
// be removed entirely. We did not account for this above unless there
|
// be removed entirely. We did not account for this above unless there
|
||||||
// is only one caller of Caller.
|
// is only one caller of Caller.
|
||||||
if (callerWillBeRemoved && !Caller->use_empty())
|
if (callerWillBeRemoved && !Caller->use_empty())
|
||||||
TotalSecondaryCost += InlineConstants::LastCallToStaticBonus;
|
TotalSecondaryCost -= InlineConstants::LastCallToStaticBonus;
|
||||||
|
|
||||||
if (inliningPreventsSomeOuterInline && TotalSecondaryCost < IC.getCost())
|
if (inliningPreventsSomeOuterInline && TotalSecondaryCost < IC.getCost())
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue