mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-21 12:38:45 +00:00
Skip calculation of ArgumentWeights if it will never be used.
Save a few bytes by allocating the correct size vector. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94589 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b554499871
commit
e3039b6712
@ -223,8 +223,14 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
|
|||||||
if (Metrics.NumRets==1)
|
if (Metrics.NumRets==1)
|
||||||
--Metrics.NumInsts;
|
--Metrics.NumInsts;
|
||||||
|
|
||||||
|
// Don't bother calculating argument weights if we are never going to inline
|
||||||
|
// the function anyway.
|
||||||
|
if (Metrics.NeverInline)
|
||||||
|
return;
|
||||||
|
|
||||||
// Check out all of the arguments to the function, figuring out how much
|
// Check out all of the arguments to the function, figuring out how much
|
||||||
// code can be eliminated if one of the arguments is a constant.
|
// code can be eliminated if one of the arguments is a constant.
|
||||||
|
ArgumentWeights.reserve(F->arg_size());
|
||||||
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
|
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
|
||||||
ArgumentWeights.push_back(ArgInfo(CountCodeReductionForConstant(I),
|
ArgumentWeights.push_back(ArgInfo(CountCodeReductionForConstant(I),
|
||||||
CountCodeReductionForAlloca(I)));
|
CountCodeReductionForAlloca(I)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user