Skip to content

[region-isolation] Take into account that Swift's RPO order doesn't include blocks that are dead. #72077

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

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Mar 5, 2024

When we run RegionAnalysis, since it uses RPO order, we do not visit dead blocks. This can create a problem when we emit diagnostics since we may merge in a value into the region that was never actually defined. In this patch, if we actually visit the block while performing dataflow, I mark a bit in its state saying that it was live. Then when we emit diagnostics, I do not visit blocks that were not marked live.

rdar://124042351

…nclude blocks that are dead.

When we run RegionAnalysis, since it uses RPO order, we do not visit dead
blocks. This can create a problem when we emit diagnostics since we may merge in
a value into the region that was never actually defined. In this patch, if we
actually visit the block while performing dataflow, I mark a bit in its state
saying that it was live. Then when we emit diagnostics, I do not visit blocks
that were not marked live.

rdar://124042351
@gottesmm gottesmm requested a review from ktoso as a code owner March 5, 2024 01:10
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2024

@swift-ci smoke test

@gottesmm gottesmm enabled auto-merge March 5, 2024 01:10
@gottesmm gottesmm merged commit 88d4680 into swiftlang:main Mar 5, 2024
@gottesmm gottesmm deleted the pr-f31f4f60ce211c66eccdb61775f9fcffc635a04a branch March 5, 2024 06:02
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