Skip to content

[region-isolation] Enable by default when strict concurrency is enabled #72851

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 Apr 4, 2024

[region-isolation] Enable region isolation by default with strict-concurrency.

I added a disable flag -disable-region-based-isolation-with-strict-concurrency
so that we do not need to update the current tests. It is only available when
asserts are enabled to ensure users cannot use it.

rdar://125918028


I also added a small fix that makes sure that we only traffic in ActorIsolation instead of sometimes using ActorIsolation and sometimes just using a nominal type. This eliminates a potential assertion that we could hit due to inconsistencies.

gottesmm added 3 commits April 4, 2024 10:58
This occurs when working with ActorIsolation in SIL.

This lets us avoid needing to depend on the AST for getting ActorIsolation for
self parameters. Now, we can just create the actor isolation we need based off
of the decl that we have.

The code is based off of forActorInstanceSelf(ValueDecl *decl) along the path
where it just creates isolation based off of the decl's nominal type decl (which
is equivalent to what we are trying to do here).
…olation instead of that or nominal type decls.

This should be NFC since the only case where I used this was with self... and I
found another way of doing that using the API I added in the previous commit.
…currency.

I added a disable flag -disable-region-based-isolation-with-strict-concurrency
so that we do not need to update the current tests. It is only available when
asserts are enabled to ensure users cannot use it.

rdar://125918028
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 4, 2024

@swift-ci smoke test

@gottesmm gottesmm enabled auto-merge April 4, 2024 20:08
@gottesmm gottesmm merged commit a1d04e6 into swiftlang:main Apr 5, 2024
@gottesmm gottesmm deleted the enable-region-isolation-by-default branch April 5, 2024 00:45
@@ -1,5 +1,5 @@
// RUN: %target-swift-frontend -disable-availability-checking -strict-concurrency=complete %s -emit-sil -o /dev/null -verify -verify-additional-prefix complete-
// RUN: %target-swift-frontend -disable-availability-checking -strict-concurrency=complete %s -emit-sil -o /dev/null -verify -enable-upcoming-feature RegionBasedIsolation
// RUN: %target-swift-frontend -disable-availability-checking -strict-concurrency=complete %s -emit-sil -o /dev/null -verify -verify-additional-prefix complete- -disable-region-based-isolation-with-strict-concurrency
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need a REQUIRES: asserts to keep working?

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