forked from OSchip/llvm-project
parent
74889b29a8
commit
58f157a677
|
@ -343,12 +343,9 @@ int InlineCostAnalyzer::getSpecializationBonus(Function *Callee,
|
||||||
if (CalleeFI->Metrics.NumBlocks == 0)
|
if (CalleeFI->Metrics.NumBlocks == 0)
|
||||||
CalleeFI->analyzeFunction(Callee);
|
CalleeFI->analyzeFunction(Callee);
|
||||||
|
|
||||||
|
for (unsigned i = 0, s = SpecializedArgNos.size(); i < s; ++i )
|
||||||
for (unsigned i = 0, s = SpecializedArgNos.size();
|
|
||||||
i < s; ++i )
|
|
||||||
{
|
|
||||||
Bonus += CalleeFI->ArgumentWeights[SpecializedArgNos[i]].ConstantBonus;
|
Bonus += CalleeFI->ArgumentWeights[SpecializedArgNos[i]].ConstantBonus;
|
||||||
}
|
|
||||||
// Calls usually take a long time, so they make the specialization gain
|
// Calls usually take a long time, so they make the specialization gain
|
||||||
// smaller.
|
// smaller.
|
||||||
Bonus -= CalleeFI->Metrics.NumCalls * InlineConstants::CallPenalty;
|
Bonus -= CalleeFI->Metrics.NumCalls * InlineConstants::CallPenalty;
|
||||||
|
@ -514,9 +511,7 @@ InlineCost InlineCostAnalyzer::getSpecializationCost(Function *Callee,
|
||||||
// away with the given arguments replaced by constants.
|
// away with the given arguments replaced by constants.
|
||||||
for (SmallVectorImpl<unsigned>::iterator an = SpecializedArgNos.begin(),
|
for (SmallVectorImpl<unsigned>::iterator an = SpecializedArgNos.begin(),
|
||||||
ae = SpecializedArgNos.end(); an != ae; ++an)
|
ae = SpecializedArgNos.end(); an != ae; ++an)
|
||||||
{
|
|
||||||
Cost -= CalleeFI->ArgumentWeights[*an].ConstantWeight;
|
Cost -= CalleeFI->ArgumentWeights[*an].ConstantWeight;
|
||||||
}
|
|
||||||
|
|
||||||
return llvm::InlineCost::get(Cost);
|
return llvm::InlineCost::get(Cost);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue