Skip to content

[region-isolation] Refactor out the Region analysis from TransferNonSendable. #70748

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 Jan 6, 2024

NFCI. This is just a pure refactor of the analysis part of TransferNonSendable into a separate SIL level analysis so it can be reused by other passes.

The reason that I am committing this earlier is that I am working concurrently on other patches that change TransferNonSendable itself and I want to avoid issues when rebasing those patches. Getting this patch into tree earlier avoids that.

This is in preparation for adding a new flow sensitive initialization pass that combines region based analysis with the current flow sensitive isolation's diagnostic emitter. The idea is that we want to preserve the diagnostics from that pass rather than try to make our own as an initial step.

@gottesmm
Copy link
Contributor Author

gottesmm commented Jan 6, 2024

@swift-ci smoke test

@gottesmm gottesmm requested a review from slavapestov January 6, 2024 00:46
@gottesmm
Copy link
Contributor Author

gottesmm commented Jan 6, 2024

@swift-ci smoke test

@gottesmm gottesmm force-pushed the pr-3175a8b536ca96190c616af15a2c7865a6f1fbe3 branch from 1788fdb to 466a10a Compare January 10, 2024 21:40
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

…endable.

NFCI. This is just a pure refactor of the analysis part of TransferNonSendable
into a separate SIL level analysis so it can be reused by other passes.

The reason that I am committing this earlier is that I am working concurrently
on other patches that change TransferNonSendable itself and I want to avoid
issues when rebasing those patches. Getting this patch into tree earlier avoids
that.

This is in preparation for adding a new flow sensitive initialization pass that
combines region based analysis with the current flow sensitive isolation's
diagnostic emitter. The idea is that we want to preserve the diagnostics from
that pass rather than try to make our own as an initial step.
…hat we do not support.

Before this commit, this was done at the beginning of TransferNonSendable. I
thought that those checks would be sufficient to ensure that
RegionAnalysisFunctionInfo was not created for functions that we do not
support. Turns out when we perform certain forms of verification, we force all
function analyses to be created for all functions meaning that we would create a
RegionAnalysisFunctionInfo for such an unsupported function causing us to hit
asserts.

In this commit, I move the check to whether or not we support a function into
RegionAnalysisFunctionInfo itself and use that to determine if we should run
TransferNonSendable. This additionally allows me to change
RegionAnalysisFunctionInfo so that one can construct one for an unsupported
function... as long as one doesn't actually touch any of its methods. If one
does, I put in an assert so we will know that operator error has occured.
@gottesmm gottesmm force-pushed the pr-3175a8b536ca96190c616af15a2c7865a6f1fbe3 branch from 466a10a to 053e30d Compare January 10, 2024 21:41
@gottesmm
Copy link
Contributor Author

Just rebased

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 7e8d8e5 into swiftlang:main Jan 11, 2024
@gottesmm gottesmm deleted the pr-3175a8b536ca96190c616af15a2c7865a6f1fbe3 branch January 11, 2024 00:37
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.

1 participant