Skip to content

[CapturePromotion] dealloc_box doesn't mutate. #77401

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 2 commits into from
Nov 6, 2024

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Nov 5, 2024

The instruction only deallocates the box, it doesn't destroy its contents. It's even less mutating than a destroy_value, which is already regarded as non-mutating.

rdar://139235335

The instruction only deallocates the box, it doesn't destroy its
contents.  It's even less mutating than a `destroy_value`, which is
already regarded as non-mutating.
Keep to a single spelling for an "always OK" instruction.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -1071,15 +1071,10 @@ class NonEscapingUserVisitor
ALWAYS_NON_ESCAPING_INST(StrongRelease)
ALWAYS_NON_ESCAPING_INST(DestroyValue)
ALWAYS_NON_ESCAPING_INST(EndBorrow)
ALWAYS_NON_ESCAPING_INST(DeallocBox)
ALWAYS_NON_ESCAPING_INST(EndAccess)
Copy link
Contributor

@meg-gupta meg-gupta Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR - I noticed copy_value / begin_borrow is not handled here. Maybe it is okay since findEscapeOrMutationUses is looking for it.

@nate-chandler nate-chandler merged commit 12a137a into swiftlang:main Nov 6, 2024
7 of 8 checks passed
@nate-chandler nate-chandler deleted the rdar139235335 branch November 6, 2024 02:31
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