Skip to content

Fix utilities that may see phis of mark_dependence [nonescaping] #72359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

meg-gupta
Copy link
Contributor

@meg-gupta meg-gupta commented Mar 15, 2024

mark_dependence [nonescaping]'s base is a BorrowingOperand. It is not a BorrowedValue. This is similar to partial_apply [on_stack]. Unlike those, phis of mark_dependence [nonescaping] values are valid. This PR updates visitRecursivelyLifetimeEndingUses to reflect this. Also updates users of visitScopeEndingUses to handle a phi end use.

TODO: Handle verification of mark_dependence [nonescaping] with phi uses separately in the ownership verifier

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

@meg-gupta meg-gupta requested a review from kavon as a code owner March 20, 2024 19:53
@meg-gupta meg-gupta force-pushed the skiphismdi branch 2 times, most recently from fabad8a to f9d310b Compare March 20, 2024 20:24
@meg-gupta meg-gupta requested a review from atrick March 20, 2024 20:25
@meg-gupta meg-gupta changed the title While verifiying mark_dependence [nonescaping], skip visiting phis Fix utilities that may see phis of mark_dependence [nonescaping] Mar 20, 2024
@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. As discussed, the API should probably indicate allowPhis. And we eventually need to allow, but callback on copies, stores, etc. Basically, we can't limit the way that dependent values are used. We just need to report non-forwarded uses.

@meg-gupta meg-gupta enabled auto-merge March 20, 2024 23:28
@atrick
Copy link
Contributor

atrick commented Mar 21, 2024

@swift-ci smoke test linux

@meg-gupta meg-gupta merged commit 50b358c into swiftlang:main Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants