8000 SILGen: avoid double copies with 'copy' expr by kavon · Pull Request #81861 · swiftlang/swift · GitHub
[go: up one dir, main page]

Skip to content

SILGen: avoid double copies with 'copy' expr #81861

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
May 30, 2025

Conversation

kavon
Copy link
Member
@kavon kavon commented May 30, 2025

SILGen sometimes emits code like:

%y = copy_value %x
%z = explicit_copy_value %y
// %y is otherwise unused

simply because of a missed specification that the sub-expression of a copy expr does not need to be returned owned / at +1; it can be a borrow / +0, since we're going to explicit-copy the value anyway.

Discovered originally in #81858

@kavon kavon requested a review from jckarter as a code owner May 30, 2025 02:49
@kavon
Copy link
Member Author
kavon commented May 30, 2025

@swift-ci test

@kavon kavon enabled auto-merge May 30, 2025 02:51
@kavon kavon merged commit ec554da into swiftlang:main May 30, 2025
4 of 5 checks passed
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
0