Skip to content

Large Types IRGen Pass: add support for transforming return of large types into indirect returns #10771

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
Jul 5, 2017

Conversation

shajrawi
Copy link

@shajrawi shajrawi commented Jul 5, 2017

radar rdar://problem/28680453

This PR improves the new IRGen pass by adding support for result types.

Result types that are Large loadable types are replaced by empty tuples.

At the call site, we add a new stack allocation and pass said allocated space as a new inout argument to the apply site. After the call is executed this new argument will contain a pointer to the previously returned result.

@shajrawi shajrawi force-pushed the indirect_return branch 2 times, most recently from 47ae208 to 17d9bf3 Compare July 5, 2017 23:09
@shajrawi
Copy link
Author

shajrawi commented Jul 5, 2017

@swift-ci Please smoke test

@shajrawi shajrawi merged commit 42e2eeb into swiftlang:master Jul 5, 2017
@shajrawi shajrawi deleted the indirect_return branch July 5, 2017 23:50
@rjmccall
Copy link
Contributor

rjmccall commented Jul 6, 2017

Why a new inout argument instead of just changing the result to be an out argument?

@shajrawi
Copy link
Author

shajrawi commented Jul 6, 2017

Hmm that should work - I will look into modifying the implementation to use @out

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