Skip to content

Commit

Permalink
Make bind_memory free to inline.
Browse files Browse the repository at this point in the history
bind_memory has no actual code size cost, and this is the only way to
allow rebinding memory within critical standard library
code like SmallString without regressing performance.
  • Loading branch information
atrick committed Sep 25, 2020
1 parent 5eafc20 commit 42bf92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Utils/SILInliner.cpp
Expand Up @@ -688,6 +688,7 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
case SILInstructionKind::BaseAddrForOffsetInst:
case SILInstructionKind::EndLifetimeInst:
case SILInstructionKind::UncheckedOwnershipConversionInst:
case SILInstructionKind::BindMemoryInst:
return InlineCost::Free;

// Typed GEPs are free.
Expand Down Expand Up @@ -792,7 +793,6 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
case SILInstructionKind::AllocRefDynamicInst:
case SILInstructionKind::AllocStackInst:
case SILInstructionKind::AllocValueBufferInst:
case SILInstructionKind::BindMemoryInst:
case SILInstructionKind::BeginApplyInst:
case SILInstructionKind::ValueMetatypeInst:
case SILInstructionKind::WitnessMethodInst:
Expand Down

0 comments on commit 42bf92a

Please sign in to comment.