mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ShrinkBorrowScope] Adopt BackwardReachability.
Replaced ShrinkBorrowScope's own data flow with the general BackwardReachability. Took this opportunity to refactor and document the utility. Taken together these changes make ShrinkBorrowScope serve as a template for a future LexicalDestroyHoisting which will operate on owned lexical values (rather than guaranteed as here) and hoist destroy_values (rather than end_borrows as here) but should otherwise be quite similar.
This commit is contained in:
@@ -451,7 +451,7 @@ void CopyPropagation::run() {
|
||||
// at least once and then until each stops making changes.
|
||||
while (true) {
|
||||
SmallVector<CopyValueInst *, 4> modifiedCopyValueInsts;
|
||||
auto shrunk = shrinkBorrowScope(bbi, deleter, modifiedCopyValueInsts);
|
||||
auto shrunk = shrinkBorrowScope(*bbi, deleter, modifiedCopyValueInsts);
|
||||
for (auto *cvi : modifiedCopyValueInsts)
|
||||
defWorklist.updateForCopy(cvi);
|
||||
changed |= shrunk;
|
||||
|
||||
Reference in New Issue
Block a user