Skip to content

Commit 1bcdfca

Browse files
committed
Optimizer: when checking for lexical lifetimes look through all ownership-transitioning instructions
except `copy_value`
1 parent 1e446b4 commit 1bcdfca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ extension Value {
7272
switch v {
7373
case let fw as ForwardingInstruction:
7474
worklist.pushIfNotVisited(contentsOf: fw.definedOperands.values)
75+
case let ot as OwnershipTransitionInstruction where !(ot is CopyingInstruction):
76+
worklist.pushIfNotVisited(ot.operand.value)
7577
case let bf as BorrowedFromInst:
7678
worklist.pushIfNotVisited(bf.borrowedValue)
77-
case let bb as BeginBorrowInst:
78-
worklist.pushIfNotVisited(bb.borrowedValue)
7979
case let arg as Argument:
8080
if let phi = Phi(arg) {
8181
worklist.pushIfNotVisited(contentsOf: phi.incomingValues)

0 commit comments

Comments
 (0)