Skip to content

Commit b854ab1

Browse files
committed
OwnershipUseVisitor.visitInnerBorrowUses: support dependent values
Add liveness support for dependent values: borrowed-from & mark_dependence so they aren't reported as unknown uses.
1 parent 9070974 commit b854ab1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ extension OwnershipUseVisitor {
365365
if let beginBorrow = BeginBorrowValue(resultOf: borrowInst) {
366366
return visitInnerScopeUses(of: beginBorrow.value)
367367
}
368+
if let dependent = borrowInst.dependentValue {
369+
if dependent.ownership == .guaranteed {
370+
return visitAllUses(of: dependent)
371+
}
372+
return pointerEscapingUse(of: operand)
373+
}
368374
// Otherwise, directly visit the scope ending uses as leaf uses.
369375
//
370376
// TODO: remove this stack by changing visitScopeEndingOperands to take a non-escaping closure.

0 commit comments

Comments
 (0)