Skip to content

[AddressLowering] Don't end_borrow trivial args. #62198

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 3 commits into from
Nov 30, 2022

Conversation

nate-chandler
Copy link
Contributor

When loading an argument, first check whether its type is trivial. If so, produce a load [trivial]. Only then produce load [take]s or load_borrows. Fixes an issue where values passed @in_guaranteed were load [trivial]'d and then end_borrow'd.

Also added the inlining logging used in the performance inliner to the mandatory inliner. It was used to track down this issue.

The same functionality that already exists in the performance inliner.
When loading an argument, first check whether its type is trivial.  If
so, produce a `load [trivial]`.  Only then produce `load [take]`s or
`load_borrow`s.  Fixes an issue where values passed @in_guaranteed were
`load [trivial]`'d and then `end_borrow`'d.
@nate-chandler nate-chandler force-pushed the opaque-values/3/20221118 branch from c847805 to dbda1bf Compare November 19, 2022 00:29
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test macOS platform

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test macOS platform

@nate-chandler nate-chandler marked this pull request as ready for review November 29, 2022 15:26
@nate-chandler
Copy link
Contributor Author

@swift-ci please test and merge

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

Thanks. Incidentally, the emitLoadBorrow/emitEndBorrow helpers are supposed to do this for you.

@swift-ci swift-ci merged commit ec2d7fc into swiftlang:main Nov 30, 2022
@nate-chandler nate-chandler deleted the opaque-values/3/20221118 branch July 5, 2023 23:33
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