Skip to content

[region-isolation] Fix two issues around setters. #70197

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

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Dec 4, 2023

The first commit ensures that we properly handle treating things assigned into fields of a final actor as being in the actor's region.

rdar://119113563

The second commit ensures the same thing for non-final setters. In truth it is actually fixing a larger issue around functions with an isolated self and no results. Before this commit, we relied on such a function having a result to ensure that the regions of the operands had an actor derived element (the result of the operation) within it. Of course if there isn't a result... that can't happen. So I introduced a "fake" value represented via the specific apply instruction that is injected into the region to ensure that we get the semantics we are searching for.

rdar://119113959

…y mark their operands as being actor derived.

I did this by abstracting the representative value of an equivalence class into
two cases: the normal case of actually having a value and a second case which is
used only to inject into a region an actor derived value.

rdar://119113563
@gottesmm gottesmm requested review from ktoso and kavon as code owners December 4, 2023 06:42
@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 4, 2023

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented Dec 4, 2023

@swift-ci build toolchain

@gottesmm gottesmm requested a review from slavapestov December 4, 2023 14:01
getActorIntroducingRepresentative(SILInstruction *introducingInst) const {
auto *self = const_cast<PartitionOpTranslator *>(this);
auto iter = self->equivalenceClassValuesToState.try_emplace(
introducingInst,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a subsequent commit, I am going to add an assert here that introducingInst doesn't have any results.

@gottesmm gottesmm merged commit b3a721d into swiftlang:main Dec 4, 2023
@gottesmm gottesmm deleted the pr-49072b3bdce528709c7f109f970c66e2a1e364d6 branch December 4, 2023 17:28
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