Skip to content

[embedded] Consider move_value/copy_value as removable for keypath optimization #73184

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
Apr 23, 2024

Conversation

kubamracek
Copy link
Contributor

Embedded Swift allows keypaths as long as they don't require any runtime instances to exist. This PR improves on when those are allowed, namely in @dynamicMemberLookup use of setters, where we end up having move_value or copy_value instructions on the keypath values in SIL. Let's consider those (move_value and copy_value instructions) to be removable by the keypath simplification algorithm.

rdar://126655571

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek added the embedded Embedded Swift label Apr 22, 2024
Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm!

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@atrick
Copy link
Contributor

atrick commented Apr 24, 2024

Normally, we check !value.isLexical() before shortening a lifetime.
@eeckstein would we ever care about the lifetime of a keypath? It might not matter because a keypath can't keep anything else alive and doesn't have a user deinit.

@eeckstein
Copy link
Contributor

right, it should not matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded Embedded Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants