Skip to content

Commit 42bf92a

Browse files
committed
Make bind_memory free to inline.
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.
1 parent 5eafc20 commit 42bf92a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
688688
case SILInstructionKind::BaseAddrForOffsetInst:
689689
case SILInstructionKind::EndLifetimeInst:
690690
case SILInstructionKind::UncheckedOwnershipConversionInst:
691+
case SILInstructionKind::BindMemoryInst:
691692
return InlineCost::Free;
692693

693694
// Typed GEPs are free.
@@ -792,7 +793,6 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
792793
case SILInstructionKind::AllocRefDynamicInst:
793794
case SILInstructionKind::AllocStackInst:
794795
case SILInstructionKind::AllocValueBufferInst:
795-
case SILInstructionKind::BindMemoryInst:
796796
case SILInstructionKind::BeginApplyInst:
797797
case SILInstructionKind::ValueMetatypeInst:
798798
case SILInstructionKind::WitnessMethodInst:

0 commit comments

Comments
 (0)