-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Optimizer: add the ObjCBridgingOptimization to optimize ObjectiveC bridging operations. #58888
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
@swift-ci test |
@swift-ci benchmark |
/// none_bb: | ||
/// %5 = enum #none | ||
/// br continue_bb(%5) | ||
/// continue_bb(%bridgedOptionalSwiftVaule): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(very minor) Typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray!
let originalObjCValue = bridgeToSwiftCall.arguments[0] | ||
let optionalObjCType = originalObjCValue.type | ||
|
||
// The briding functions from ObjC -> Swift take an optional argument and return a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(very minor) Another typo, should be "bridging". (Sorry, just reading through this out of interest.)
06ade1f
to
71fdf81
Compare
@swift-ci test |
71fdf81
to
5bda97d
Compare
@swift-ci test |
In case of type-dependent operands, not all operands are part of the arguments
…idging operations. Removes redundant ObjectiveC <-> Swift bridging calls. Basically, if a value is bridged from ObjectiveC to Swift an then back to ObjectiveC again, then just re-use the original ObjectiveC value. Also in this commit: add an additional DCE pass before ownership elimination. It can cleanup dead code which is left behind by the ObjCBridgingOptimization. rdar://89987440
It's replaced by the new ObjCBridgingOptimization optimization pass
5bda97d
to
9f70c29
Compare
@swift-ci test |
Removes redundant ObjectiveC <-> Swift bridging calls.
Basically, if a value is bridged from ObjectiveC to Swift an then back to ObjectiveC again, then just re-use the original ObjectiveC value.
Also, add an additional DCE pass before ownership elimination. It can cleanup dead code which is left behind by the ObjCBridgingOptimization.
This PR also removes an old obsolete bridging optimization from SILCombine.
rdar://89987440