Skip to content

[NoncopyablePartialConsumption] Promote to feature. #73121

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 8 commits into from
Apr 22, 2024

Conversation

nate-chandler
Copy link
Contributor

Fully enable partial consumption of noncopyable values, fixing a couple of bugs exposed by doing so along the way.

rdar://126715654

@nate-chandler nate-chandler requested review from jckarter and removed request for xedin, slavapestov and hborla April 18, 2024 22:24
Remove all checks for the feature flag.  It's on all the time.
A destroy_value of an on-stack partial apply isn't actually a consuming
use, so don't treat it as one.
Previously, the enum representation was fixed to represent the different
cases payloads separately with the unchecked_take_enum_data_addr
instruction consuming all fields but that whose address is obtained.
In a few places, handling for enum deinits was left undone with an
assertion that the enum not have one.

Here, the deinit bit of the enum is shifted to the end.  And the
assertions are replaced with handling.  Finally, the logic for inserting
destroys after switch_enum_addr instructions is fixed.
It's not allowed to replace ued(enum(x)) with x if the enum in question
has a deinit.
It relies on complete lifetimes for its analysis.  So if there are any
instructions to check, complete all lifetimes in the function first.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

@nate-chandler nate-chandler merged commit 1faeb50 into swiftlang:main Apr 22, 2024
@nate-chandler nate-chandler deleted the rdar126715654 branch April 22, 2024 14:01
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