Expose UnrollThreshold and Inline_Benefit_reduction in the command line for automatic code size tuning

This commit is contained in:
Raj Barik
2017-10-27 10:30:23 -07:00
parent d53f25c56d
commit c0b7cf0ff5
5 changed files with 36 additions and 2 deletions

View File

@@ -256,7 +256,9 @@ bool SILPerformanceInliner::isProfitableToInline(
return false;
}
BaseBenefit = BaseBenefit / 2;
// Use command line option to control inlining in Osize mode.
const uint64_t CallerBaseBenefitReductionFactor = AI.getFunction()->getModule().getOptions().CallerBaseBenefitReductionFactor;
BaseBenefit = BaseBenefit / CallerBaseBenefitReductionFactor;
}
// It is always OK to inline a simple call.