-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Lifetime dependence utilities #71055
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
For AddressUtils and LifetimeDepenendenceUtils.
41c0cf6
to
2ef870a
Compare
@swift-ci test |
@swift-ci test source compatibility |
@swift-ci 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!
/// | ||
/// TODO: Integrate this with SIL verification to ensure completeness. | ||
/// | ||
/// TODO: Convert AddressDefUseWalker to conform to AddressUtils after |
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.
How would that work? The problem is that AddressDefUseWalker is passing a Path down the walk functions.
// base is never a guaranteed phi. | ||
guard let introducer = introducers.pop() else { return nil } | ||
assert(introducers.isEmpty, | ||
"guaranteed phis not allowed when diagnosing lifetime dependence") |
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.
Multiple introducers don't necessarily stem from phis. Think of the Pair
example. Is this something to consider here?
/// %base = struct_extract %parent // lifetime dependence base value | ||
/// %dependent = mark_dependence [nonescaping] %value on %base | ||
/// | ||
/// This extends the ForwardingDefUseWalker, which finds 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.
ForwardingDefUseWalker
-> ForwardingUseDefWalker
/// end_borrow %5 | -+ | | ||
/// destroy_value %4 -+ | | ||
/// ... | | ||
/// destroy_value %parent // end dependence scope -+ |
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.
nice comment!
Add LifetimeDependence utilities