Commit Graph

12 Commits

Author SHA1 Message Date
Nate Chandler
81fa65772f [OwnershipLiveness] End at extend_lifetime.
When visiting consumes, also visit `extend_lifetime` instructions.
These instructions are not lifetime ending, but together with the
consumes, they enclose the users of a value.

Add a flag to LinearLiveness to control whether these instructions are
added so that the verifier can use verify that all such instructions
appear outside the linear lifetime boundary (not including them).
2024-06-05 16:28:28 -07:00
Nate Chandler
52a1f4dbe7 [LifetimeCompletion] Handle endAsyncLetLifetime.
Handle it like an `end_borrow`.
2024-03-27 07:01:18 -07:00
Nate Chandler
06af948e7e [LifetimeCompletion] Handle owned project_box.
Akin to 57eb1db38c but for owned values.
2024-03-26 11:10:00 -07:00
Nate Chandler
57eb1db38c [LifetimeCompletion] Handle project_box.
Port a0c85be52c to C++ InteriorLiveness to
treat `project_box` like an interior pointer use and fix lifetime
completion of a borrow that encloses one.
2024-03-25 08:57:16 -07:00
Andrew Trick
d7b9149ee5 Fix visitNonEscapingLifetimeEnds to handle mark_dependence uses
Now it visits unknown uses separately rather than asserting.
2024-03-22 14:29:57 -07:00
Andrew Trick
b3a7ec1126 Add OSSA OwnershipUseVisitor support for mark_dependence
[nonescaping]
2024-02-12 09:57:14 -08:00
Meghana Gupta
7cb3733e29 Rename OwnershipForwardingMixin -> ForwardingInstruction 2023-06-14 10:40:32 -07:00
Meghana Gupta
1dc713e2f7 Add new flags "reborrow" and "escaping" to SILArgument.
"reborrow" flag on the SILArgument avoids transitive walk over the phi operandsi
to determine if it is a reborrow in multiple utilities.
SIL transforms must keep the flag up-to-date by calling SILArgument::setReborrow.
SILVerifier checks to ensure the flag is not invalidated.

Currently "escaping" is not used anywhere.
2023-05-11 12:31:37 -07:00
Meghana Gupta
fa4f3a5642 Update assertion for partial_apply [on_stack] lifetime ends in lifetime completion
Since partial_apply [on_stack] is considered as a BorrowingOperand now,
and BorrowingOperand::visitScopeEndingUses can be called on the its forwarded values
lifetime ends, update the assertion to reflect this.
2023-04-14 16:00:24 -07:00
Meghana Gupta
6cefbb303a Handle partial_apply [on_stack] lifetime ends in the visitor 2023-04-11 13:56:42 -07:00
Meghana Gupta
85a580a96e Fix ossa borrow completion
end_borrow was not considered as a lifetime ending use,
leading to insertion of redundant end_borrows at boundaries.
2023-04-06 11:15:37 -07:00
Andrew Trick
13e1aa4467 Add OwnershipLiveness utilities
Encapsulate all the complexity of reborrows and guaranteed phi in 3
ownership liveness interfaces:

LinerLiveness, InteriorLiveness, and ExtendedLiveness.
2023-02-10 09:39:18 -08:00