Skip to content

IRGen: Restore handling of "simple" partial_apply instructions. #31719

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 12, 2020

Conversation

jckarter
Copy link
Contributor

Methods and closures use the same convention for the self/context argument, so when a
partial_apply applies a single argument to a method implementation, the closure can be formed
by simply tupling the implementation and self argument together. This doesn't yet cover a lot
of situations the compiler generates, but it prepares IRGen for an IRGen SIL pass that can
take the heavy lifting of partial_apply lowering off of IRGen by reducing more complex closures
into these "simple" cases, eventually reducing the number of partial_apply forwarding thunks and
extra closure allocations generated.

Methods and closures use the same convention for the self/context argument, so when a
partial_apply applies a single argument to a method implementation, the closure can be formed
by simply tupling the implementation and self argument together. This doesn't yet cover a lot
of situations the compiler generates, but it prepares IRGen for an IRGen SIL pass that can
take the heavy lifting of partial_apply lowering off of IRGen by reducing more complex closures
into these "simple" cases, eventually reducing the number of partial_apply forwarding thunks and
extra closure allocations generated.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit 2492e45 into swiftlang:master May 12, 2020
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