Skip to content

[6.0] LifetimeDependence: handle dependent values in throwing calls. #72839

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 4 commits into from
Apr 10, 2024

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Apr 4, 2024

This is rebased onto #72768

--- CCC ---

Explanation: Fix LifetimeDependenceDiagnostics to handle dependent values in throwing calls

Scope: Allows NonescapableTypes to be used with throwing calls and struct deinits.

Radar/SR Issues:
rdar://125564278 (~Escapable: crash in LifetimeDependenceInsertion)
rdar://125590074 ([NonescapableTypes] Nonescapable types cannot have deinits)

Original PR: #72777

Risk: This allows compiler passes to understand that the drop_deinit SIL instruction forwards its operand. This could increase the power of some optimizations in the presence of noncopyable types; however, I audited the code and did not see any places where that would be risky.

Testing: Unit tests added

Reviewer: @meg-gupta

@atrick atrick added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Apr 4, 2024
@atrick atrick requested a review from meg-gupta April 4, 2024 16:56
@atrick atrick requested a review from a team as a code owner April 4, 2024 16:56
@atrick
Copy link
Contributor Author

atrick commented Apr 4, 2024

@swift-ci test

atrick added 4 commits April 9, 2024 16:07
Fixes rdar://125564278 (~Escapable: crash in LifetimeDependenceInsertion)

(cherry picked from commit fbae21f)
drop_deinit forwards ownership while effectively stripping the deinitializer. It is similar to a type cast.

Fixes rdar://125590074 ([NonescapableTypes] Nonescapable types
cannot have deinits)

(cherry picked from commit 581010d)
@atrick atrick force-pushed the 60-fix-lifedep-throw branch from b5459b1 to 2e3e85d Compare April 9, 2024 23:08
@atrick
Copy link
Contributor Author

atrick commented Apr 9, 2024

@swift-ci test

@atrick atrick merged commit 00dac23 into swiftlang:release/6.0 Apr 10, 2024
5 checks passed
@atrick atrick deleted the 60-fix-lifedep-throw branch April 10, 2024 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants