Skip to content

Commit 6caa504

Browse files
committed
[WalkUtils] Walk through move_value instructions.
Addresses the following regressions StackPromo 10100 14400 +42.6% **0.70x** seen when enabling lexical lifetimes in the standard library.
1 parent 4422cdc commit 6caa504

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/WalkUtils.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ extension ValueDefUseWalker {
341341
return unmatchedPath(value: operand, path: path)
342342
}
343343
case is InitExistentialRefInst, is OpenExistentialRefInst,
344-
is BeginBorrowInst, is CopyValueInst,
344+
is BeginBorrowInst, is CopyValueInst, is MoveValueInst,
345345
is UpcastInst, is UncheckedRefCastInst, is EndCOWMutationInst,
346346
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkMustCheckInst:
347347
return walkDownUses(ofValue: (instruction as! SingleValueInstruction), path: path)
@@ -618,7 +618,7 @@ extension ValueUseDefWalker {
618618
return rootDef(value: mvr, path: path)
619619
}
620620
case is InitExistentialRefInst, is OpenExistentialRefInst,
621-
is BeginBorrowInst, is CopyValueInst,
621+
is BeginBorrowInst, is CopyValueInst, is MoveValueInst,
622622
is UpcastInst, is UncheckedRefCastInst, is EndCOWMutationInst,
623623
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkMustCheckInst:
624624
return walkUp(value: (def as! Instruction).operands[0].value, path: path)

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ final public class ProjectBoxInst : SingleValueInstruction, UnaryInstruction {
609609

610610
final public class CopyValueInst : SingleValueInstruction, UnaryInstruction {}
611611

612+
final public class MoveValueInst : SingleValueInstruction, UnaryInstruction {}
613+
612614
final public class StrongCopyUnownedValueInst : SingleValueInstruction, UnaryInstruction {}
613615

614616
final public class StrongCopyUnmanagedValueInst : SingleValueInstruction, UnaryInstruction {}

SwiftCompilerSources/Sources/SIL/Registration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public func registerSILClasses() {
123123
register(BeginBorrowInst.self)
124124
register(ProjectBoxInst.self)
125125
register(CopyValueInst.self)
126+
register(MoveValueInst.self)
126127
register(EndCOWMutationInst.self)
127128
register(ClassifyBridgeObjectInst.self)
128129
register(PartialApplyInst.self)

0 commit comments

Comments
 (0)