Skip to content

RedundantLoadElimination: correctly handle end_borrow instructions #77618

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
Nov 15, 2024

Conversation

eeckstein
Copy link
Contributor

Scope-ending instructions, like end_borrow are only irrelevant for RLE if the preceding load is not changed. If it is changed from load [copy] -> load [take] the memory effects of those scope-ending instructions prevent that the load [take] will illegally mutate memory which is protected from mutation by the scope.

Fixes a memory verifier crash
rdar://139824805

Scope-ending instructions, like `end_borrow` are only irrelevant for RLE if the preceding load is not changed.
If it is changed from `load [copy]` -> `load [take]` the memory effects of those scope-ending instructions prevent that the `load [take]` will illegally mutate memory which is protected from mutation by the scope.

Fixes a memory verifier crash
rdar://139824805
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

@eeckstein eeckstein merged commit 8d07096 into swiftlang:main Nov 15, 2024
6 checks passed
@eeckstein eeckstein deleted the fix-rle branch November 15, 2024 06:51
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