Skip to content

AliasAnalysis: consider memory effects of a consume/destroy of a class on it's let-fields #78754

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 2 commits into from
Jan 21, 2025

Conversation

eeckstein
Copy link
Contributor

Although a let-field can never be mutated, a release or consume of the class must be considered as writing to such a field.

This change removes the special handling of let-fields in two places, where they don't belong.
Class fields were handled by ImmutableScope anyway. I added handling of global let-variable in ImmutableScope, too.

Fixes a miscompile.
rdar://142996449

…s on it's let-fields

Although a let-field can never be mutated, a release or consume of the class must be considered as writing to such a field.

This change removes the special handling of let-fields in two places, where they don't belong.
Class fields are handled by ImmutableScope anyway.
Handling of global let-variable is temporarily removed by this commit.

Fixes a miscompile.
rdar://142996449
Global let-variables are immutable, except in functions which initialize them.
This brings back handling of global let-variables in alias analysis, which was removed in the previous commit.
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci apple silicon benchmark

@eeckstein eeckstein requested review from atrick and meg-gupta January 20, 2025 08:19
@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test macos

Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

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

LGTM

@eeckstein eeckstein merged commit 2e92644 into swiftlang:main Jan 21, 2025
5 of 6 checks passed
@eeckstein eeckstein deleted the fix-alias-analysis branch January 21, 2025 20:11
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