6.0: [MoveOnlyAddressChecker] Don't complete reborrows or their adjacent phis. #73359
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Fix a compiler crash caused by completing certain lifetimes during move checking.
Move-only checking relies on the completeness of lifetimes of interest. Way back in #68381 , a change was made to run lifetime completion in functions continaing move-only values; only values obviously derived from the value being checked had their lifetimes completed. Much more recently, in 874971c, an analogous change was made to complete lifetimes in functions containing move-only addresses; in the recent patch, though, rather than trying to find all the values that could be derived from the address being checked, all lifetimes in the function were completed. This doesn't quite work, though, because lifetime completion doesn't know how to deal with reborrows--it's intended to be run in a SIL prior to reborrows existing.
Here, the lifetimes that are completed in functions with move-only addresses are trimmed back to exclude values whose lifetimes depend on reborrows.
Scope: Affects noncopyable code.
Issue: rdar://127312637
Original PR: #73358
Risk: Low. Decreases the cases in which a SIL transformation is run.
Testing: Added regression test.
Reviewer: Andrew Trick ( @atrick )