Skip to content

Commit b69b349

Browse files
committed
SILInliner: Unconditional branches are essentially free.
1 parent 628b537 commit b69b349

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,10 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
789789
case SILInstructionKind::GetAsyncContinuationInst:
790790
return InlineCost::Free;
791791

792+
// Unconditional branch is free.
793+
case SILInstructionKind::BranchInst:
794+
return InlineCost::Free;
795+
792796
case SILInstructionKind::AbortApplyInst:
793797
case SILInstructionKind::ApplyInst:
794798
case SILInstructionKind::TryApplyInst:
@@ -804,7 +808,6 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
804808
case SILInstructionKind::WitnessMethodInst:
805809
case SILInstructionKind::AssignInst:
806810
case SILInstructionKind::AssignByWrapperInst:
807-
case SILInstructionKind::BranchInst:
808811
case SILInstructionKind::CheckedCastBranchInst:
809812
case SILInstructionKind::CheckedCastValueBranchInst:
810813
case SILInstructionKind::CheckedCastAddrBranchInst:

0 commit comments

Comments
 (0)