Skip to content

Commit d3cb90f

Browse files
committed
Remove adjacent phi handling from InteriorUseWalker.
At least the Swift utilities should rely on borrowed-from.
1 parent e6b64d2 commit d3cb90f

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -552,25 +552,6 @@ struct InteriorUseWalker {
552552
}
553553

554554
mutating func visitUses() -> WalkResult {
555-
// If the outer value is an owned phi or reborrow, consider inner
556-
// adjacent phis part of its lifetime.
557-
if let phi = Phi(definingValue), phi.endsLifetime {
558-
let result = phi.innerAdjacentPhis.walk { innerPhi in
559-
if innerPhi.isReborrow {
560-
// Inner adjacent reborrows are considered inner borrow scopes.
561-
if handleInner(borrowed: innerPhi.value) == .abortWalk {
562-
return .abortWalk
563-
}
564-
return visitInnerScopeUses(of: innerPhi.value)
565-
} else {
566-
// Inner adjacent guaranteed phis are uses of the outer borrow.
567-
return visitAllUses(of: innerPhi.value)
568-
}
569-
}
570-
if result == .abortWalk {
571-
return .abortWalk
572-
}
573-
}
574555
return visitAllUses(of: definingValue)
575556
}
576557
}

0 commit comments

Comments
 (0)