Skip to content

SIL: Optimizer fixes for noncopyable optional chains. #72281

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
Mar 13, 2024

Conversation

jckarter
Copy link
Contributor

Don't attempt a SILCombine transform on select_enum that inserts a copy when an enum is noncopyable. Adjust the cleanup handling for a consuming optional chain to ensure a destroy_value still gets emitted on the none path; this shouldn't actually matter since none is a trivial case, but the memory verifier isn't that fancy during OSSA, and we can optimize it later. Fixes rdar://124426918.

Don't attempt a SILCombine transform on `select_enum` that inserts a copy when an
enum is noncopyable. Adjust the cleanup handling for a consuming optional chain to
ensure a `destroy_value` still gets emitted on the `none` path; this shouldn't
actually matter since `none` is a trivial case, but the memory verifier isn't
that fancy during OSSA, and we can optimize it later. Fixes rdar://124426918.
@jckarter
Copy link
Contributor Author

@swift-ci Please smoke test

@jckarter jckarter merged commit b065540 into swiftlang:main Mar 13, 2024
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.

1 participant