-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[SemanticARCOpts] Don't shorten owned lexical values lifetimes through deinit barriers. #65164
Conversation
Prevent joining lifetimes of copies with destroyed owned lexical values if there may be deinit barriers between the final consume of the copy and the destroy of the lexical value. rdar://108014714
@swift-ci please test |
@swift-ci please benchmark |
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.
LGTM!
Looks like other edge cases in tryJoiningCopyValueLiveRangeWithOperand
may also require a similar fix.
@meg-gupta Thank you! Here's an attempt to list all the places where There was quite a bit to look at, so I may have missed something. Are there other cases than these or is there trouble in any of these cases?
|
|
@nate-chandler Thank you! I went through everything as well, and looks like we don't shorten lifetimes anywhere else. |
Although, I wonder if we should also check for interior pointers here and other places we check for pointer escapes (sigh!) - https://github.com/apple/swift/blob/42d2441183e674d7bf4058bb101773d502603f2e/lib/SILOptimizer/SemanticARC/CopyValueOpts.cpp#L499. I didn't write any test, but we handle interior pointers conservatively in CanonicalizeOSSALifetimes for similar reasons.. |
Interesting--that sounds like it could be a good follow-on to #64836 where the |
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.
LGTM
Prevent joining lifetimes of copies with destroyed owned lexical values if there may be deinit barriers between the final consume of the copy and the destroy of the lexical value.
rdar://108014714