Skip to content

[cast-opt] Improve handling of arguments when optimizing Swift -> Obj… #25693

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

Conversation

gottesmm
Copy link
Contributor

…C bridging casts.

Specifically:

  1. I removed an extra defensive copy that we put in place some time ago that
    isn't really warranted. We know that we have an @owned value, so can safely just
    pass the value as a @guaranteed parameter. This also eliminates an ownership
    error that would occur due to my not having updated this code for ownership in
    tree.

  2. I also ensured that if we are performing a loadable address bridging cast ->
    value bridging cast that we store the loadable value back into memory after we
    perform the cast. Otherwise, it appears to leak to the ownership verifier.

I also centralized the non-ownership tests for this into one place
(const_fold_objc_bridge.sil => constant_propagation_objc.sil).

…C bridging casts.

Specifically:

1. I removed an extra defensive copy that we put in place some time ago that
isn't really warranted. We know that we have an @owned value, so can safely just
pass the value as a @guaranteed parameter. This also eliminates an ownership
error that would occur due to my not having updated this code for ownership in
tree.

2. I also ensured that if we are performing a loadable address bridging cast ->
value bridging cast that we store the loadable value back into memory after we
perform the cast. Otherwise, it appears to leak to the ownership verifier.

I also centralized the non-ownership tests for this into one place
(const_fold_objc_bridge.sil => constant_propagation_objc.sil).
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 934f34d into swiftlang:master Jun 23, 2019
@gottesmm gottesmm deleted the pr-2677daef7169119f14e1aaf6f7117ef39430deb8 branch June 23, 2019 23:47
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