Skip to content

[6.2] Optimize keypaths in language 6 mode #81158

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 29, 2025

Conversation

eeckstein
Copy link
Contributor

  • Explanation: Swift 6 mode enables -enable-upcoming-feature InferSendableFromCaptures which causes & Sendable to be inferred. Therefore keypath instructions are created as existentials and the optimizer needs to look through the open_existential_ref instructions to recognize a keypath. Without this fix, literal keypaths are not constant folded in language 6 mode which can have a dramatic performance impact.
  • Risk: low: it's a simple change which is well understood.
  • Testing: Tested by lit tests
  • Issue: rdar://150173106
  • Reviewer: @aschwaighofer
  • Main branch PR: Optimize keypaths in language 6 mode #81139

In language 6 mode keypath instructions are created as existentials and the optimizer needs to look through the `open_existential_ref` instructions to recognize a keypath.

rdar://150173106
@eeckstein eeckstein requested a review from a team as a code owner April 29, 2025 09:43
@eeckstein eeckstein requested a review from aschwaighofer April 29, 2025 09:43
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit cdde103 into swiftlang:release/6.2 Apr 29, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants