Skip to content

Commit c6eb9e8

Browse files
committed
[OSSA] Fix AccessPathDefUserTraversal::visitUser; ignore end_borrow.
Ignore end_borrow as a user of the access path. I don't think there's any value in viewing it as a use of the access path because we really care about address reads and writes in this context, not object lifetime extension. Treating it as an access path use clutters the analysis, and I'm afraid it will inhibit optimization.
1 parent abcc2dd commit c6eb9e8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,9 @@ bool AccessPathDefUseTraversal::visitUser(DFSEntry dfs) {
14401440
return true;
14411441
}
14421442
}
1443+
if (isa<EndBorrowInst>(use->getUser())) {
1444+
return true;
1445+
}
14431446
// We weren't able to "see through" any more address conversions; so
14441447
// record this as a use.
14451448

0 commit comments

Comments
 (0)