Skip to content

Commit 9971724

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 8064e45 commit 9971724

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)
@@ -608,7 +608,7 @@ extension ValueUseDefWalker {
608608
return rootDef(value: mvr, path: path)
609609
}
610610
case is InitExistentialRefInst, is OpenExistentialRefInst,
611-
is BeginBorrowInst, is CopyValueInst,
611+
is BeginBorrowInst, is CopyValueInst, is MoveValueInst,
612612
is UpcastInst, is UncheckedRefCastInst, is EndCOWMutationInst,
613613
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkMustCheckInst:
614614
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
@@ -618,6 +618,8 @@ final public class ProjectBoxInst : SingleValueInstruction, UnaryInstruction {
618618

619619
final public class CopyValueInst : SingleValueInstruction, UnaryInstruction {}
620620

621+
final public class MoveValueInst : SingleValueInstruction, UnaryInstruction {}
622+
621623
final public class EndCOWMutationInst : SingleValueInstruction, UnaryInstruction {}
622624

623625
final public

SwiftCompilerSources/Sources/SIL/Registration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public func registerSILClasses() {
119119
register(BeginBorrowInst.self)
120120
register(ProjectBoxInst.self)
121121
register(CopyValueInst.self)
122+
register(MoveValueInst.self)
122123
register(EndCOWMutationInst.self)
123124
register(ClassifyBridgeObjectInst.self)
124125
register(PartialApplyInst.self)

0 commit comments

Comments
 (0)