Skip to content

[5.9] AllocBoxToStack: Remove bodies of closure functions left unused after specialization. #67035

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

jckarter
Copy link
Contributor

@jckarter jckarter commented Jun 29, 2023

Issue: rdar://110675352
• Explanation: Removes a source of potential compiler crashes when noncopyable types are captured in nonescaping closures.
• Scope of Issue: Crash-on-valid.
• Origination: Noncopyable types feature work.
• Risk: Low. The patch deletes SIL that is unreachable from the rest of the program so should have no runtime effect.
• Reviewed By: @gottesmm
• Automated Testing: Swift CI
• Dependencies: None
• Builder Impact: Not applicable
• Directions for QE: None

… specialization.

We can't remove the functions at this point in case they might have other function
passes enqueued to run on them, but we can at least remove the function contents
that are now unnecessary. We need to do this in cases when move-only types are
involved, since the semantics of the move checker rely on unescaped captures being
promoted before the pass runs, and we leave behind invalid SIL in the unpromoted code.
rdar://110675352
@jckarter jckarter requested a review from a team as a code owner June 29, 2023 22:44
@jckarter
Copy link
Contributor Author

@swift-ci Please test

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