mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[MemAccessUtils] Look thru nested for guar roots.
Previously, findGuaranteedReferenceRoots always stopped searching when finding a begin_borrow, because it's not an ownership-forwarding instruction. Here, it is conditionally allowed to keep search through the borrowee of that begin_borrow if it itself is guaranteed.
This commit is contained in:
@@ -292,7 +292,9 @@ void DCE::markLive() {
|
||||
// Visit the end_borrows of all the borrow scopes that this
|
||||
// begin_borrow could be borrowing.
|
||||
SmallVector<SILValue, 4> roots;
|
||||
findGuaranteedReferenceRoots(borrowInst->getOperand(), roots);
|
||||
findGuaranteedReferenceRoots(borrowInst->getOperand(),
|
||||
/*lookThroughNestedBorrows=*/false,
|
||||
roots);
|
||||
for (auto root : roots) {
|
||||
visitTransitiveEndBorrows(root,
|
||||
[&](EndBorrowInst *endBorrow) {
|
||||
|
||||
Reference in New Issue
Block a user