Skip to content

Generalize AllocBoxToStack pass to handle apply variations. #18457

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
Aug 2, 2018
Merged

Generalize AllocBoxToStack pass to handle apply variations. #18457

merged 1 commit into from
Aug 2, 2018

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Aug 1, 2018

Remove all the bespoke utilities for handling apply sites.
Use the ApplySite abstraction instead. As a side effect,
we can now properly analyze begin_apply and try_apply.

@atrick
Copy link
Contributor Author

atrick commented Aug 1, 2018

@swift-ci test.

@atrick
Copy link
Contributor Author

atrick commented Aug 1, 2018

@swift-ci test source compatibility.

@atrick
Copy link
Contributor Author

atrick commented Aug 1, 2018

@eeckstein or @gottesmm would you care to review this?

@gottesmm
Copy link
Contributor

gottesmm commented Aug 1, 2018

I'll take a look real quick.

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

All of the "refactoring algebra" looks correct to me. LGTM!

@gottesmm
Copy link
Contributor

gottesmm commented Aug 1, 2018

@atrick I was just thinking. Do we have a test for apply of partial_apply? Would be good to add if it is missing. It may be useful to use a thin_to_thick_function as a test case as well. I am fine with fixing this in a later commit if you want.

@atrick
Copy link
Contributor Author

atrick commented Aug 1, 2018

@gottesmm thanks. There is an apply of partial_apply test. This PR decreases the need for pass-specific unit tests by removing a bunch of pass specific utilities. It's obviously intractable to test all possible SIL patterns that a pass can handle, but if there's any special-case logic in the pass, that needs an explicit test.

@gottesmm
Copy link
Contributor

gottesmm commented Aug 1, 2018

SGTM. Was just a random thought.

Remove all the bespoke utilities for handling apply sites.
Use the ApplySite abstraction instead. As a side effect,
we can now properly analyze begin_apply and try_apply.
@atrick
Copy link
Contributor Author

atrick commented Aug 2, 2018

@swift-ci smoke test and merge.

1 similar comment
@atrick
Copy link
Contributor Author

atrick commented Aug 2, 2018

@swift-ci smoke test and merge.

@swift-ci swift-ci merged commit 6ac8553 into swiftlang:master Aug 2, 2018
@atrick atrick deleted the fix-unexpected-box-use branch February 22, 2019 17:31
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.

3 participants