Skip to content

[DestroyAddrHoisting] Don't fold into read access. #82557

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
merged 1 commit into from
Jun 27, 2025

Conversation

nate-chandler
Copy link
Contributor

Narrowly fix a long-standing bug where destroy_addrs would be hoisted into read access scopes, leaving the scope as a read despite the fact that it modifies memory. This is a problem for utilities which expect access scopes to provide correct summaries. Do this by refusing to fold into access scopes which are marked [read].

In a follow-up, we can reenable this folding, promoting each access scope to a modify. Doing so requires checking that there are no access scopes which overlap with any of the access scopes which would be promoted to modify.

rdar://154407327

Narrowly fix a long-standing bug where destroy_addrs would be hoisted
into read access scopes, leaving the scope as a read despite the fact
that it modifies memory.  This is a problem for utilities which expect
access scopes to provide correct summaries.  Do this by refusing to fold
into access scopes which are marked `[read]`.

In a follow-up, we can reenable this folding, promoting each access
scope to a modify.  Doing so requires checking that there are no access
scopes which overlap with any of the access scopes which would be
promoted to modify.

rdar://154407327
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

LGTM

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows platform

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows platform

@nate-chandler nate-chandler marked this pull request as ready for review June 27, 2025 22:36
@nate-chandler nate-chandler merged commit 991eb45 into swiftlang:main Jun 27, 2025
6 checks passed
@nate-chandler nate-chandler deleted the rdar154407327 branch June 27, 2025 22:36
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.

3 participants