Merge pull request #17026 from aschwaighofer/wip_begin_apply_inlining

SILInliner: Initial support for begin_apply
This commit is contained in:
Arnold Schwaighofer
2018-06-07 07:24:23 -07:00
committed by GitHub
3 changed files with 557 additions and 16 deletions

View File

@@ -656,12 +656,7 @@ static bool isCallerAndCalleeLayoutConstraintsCompatible(FullApplySite AI) {
// Returns the callee of an apply_inst if it is basically inlinable.
SILFunction *swift::getEligibleFunction(FullApplySite AI,
InlineSelection WhatToInline) {
// For now, we cannot inline begin_apply at all.
if (isa<BeginApplyInst>(AI))
return nullptr;
SILFunction *Callee = AI.getReferencedFunction();
SILFunction *EligibleCallee = nullptr;
if (!Callee) {
return nullptr;
@@ -776,8 +771,7 @@ SILFunction *swift::getEligibleFunction(FullApplySite AI,
return nullptr;
}
EligibleCallee = Callee;
return EligibleCallee;
return Callee;
}
/// Returns true if the instruction \I has any interesting side effects which