[SILGen] Support thunking/reabstraction of @called(once) values - #91390
Open
xedin wants to merge 4 commits into
Open
[SILGen] Support thunking/reabstraction of @called(once) values#91390xedin wants to merge 4 commits into
@called(once) values#91390xedin wants to merge 4 commits into
Conversation
… `@called(once)` The thunk itself cannot be `@called(once)` just like a closure cannot be since the constraint is about the value and is expressed on `partial_apply` instruction that forms the value of the thunk.
These values have consuming semantics and this change makes the behavior consistent for thunks that convert between two `@called(once)` functions as well.
This change added a missing check to `LogicalPathComponent::project` that doesn't handle consuming access correctly and instead assumes that it's always Write or ReadWrite and attempt produce a writeback `set` on a consumed value. Also make sure that `ValueComponent::project` treats `@called(once)` values as "assignable and consumable".
Contributor
Author
|
@swift-ci please test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change fixes thunking of conversions to
@called(once)values and reabstractionbetween
@called(once)values. It makes sure that the parameter that takes@called(once)is always
Direct_Owned, the thunk itself never inherits@called(once)bit (the constraint isexpressed on the partial_apply that forms the value) and fixes a problem with l-value projection
when the access is consuming.