Skip to content

5.9: [SILOptimizer] Don't optimize move-only lifetimes. #66727

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

nate-chandler
Copy link
Contributor

Description: Disable lifetime optimization of instances of move-only types.

The order of deinitialization of such instances are fixed by language rules and can't be altered by optimizations.

Such optimizations could never eliminate any copies of these values regardless.
Risk: Low. The fix is very simple, just bailing at the top level of two utilities.
Scope: Narrow. This only affects move-only types.
Original PR: #66716
Reviewed By: Andrew Trick ( @atrick )
Testing: Added test showing that the utilities don't hoist the destroys of instances of move only structs or enums.
Resolves: rdar://110913116

According to language rules, such lifetimes are fixed and the relative
order of their deinits is guaranteed.

rdar://110913116
@nate-chandler nate-chandler requested a review from a team as a code owner June 17, 2023 02:48
@nate-chandler nate-chandler requested review from atrick and tbkka June 17, 2023 02:48
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler merged commit 8e8a865 into swiftlang:release/5.9 Jun 19, 2023
@nate-chandler nate-chandler deleted the cherrypick/release/5.9/rdar110913116 branch June 19, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants