Commit Graph

10 Commits

Author SHA1 Message Date
Andrew Trick
3e7d9dba71 AddressUseVisitor: follow mark_dependence [nonescaping].
Treat mark_dependence [nonescaping] as a dependent value even if the dependence base does not have a recognizable
scope (e.g. a multiply-defined alloc_stack). This happens because ClosureLifetimeFixup creates redundant mark_dependence
instructions for partial_apply captures. We constantly need to work around this broken representation of nonescaping closures.
2024-03-18 17:45:33 -07:00
Andrew Trick
009bc58045 Disable verbose AddressUtils 2024-03-18 17:45:28 -07:00
Andrew Trick
bdabc2145a Add computeKnownLiveness utility
To fix LifetimeDependenceScopeFixup in the presense of pointer escapes.
2024-03-18 17:38:12 -07:00
Andrew Trick
aa208bbf91 Add SILType::containsNoEscapeFunction()
Add PartialApplyInst.hasNoescapeCapture
Add PartialApplyInst.mayEscape

Refactor DiagnoseInvalidEscapingCaptures. This may change functionality because tuples containing a noescape closure are now correctly recognized. Although I'm not sure such tupes can ever be captured directly.
2024-03-18 17:38:12 -07:00
Andrew Trick
75f2f88bce Add AddressOwnershipLiveRange
A live range representing the ownership of addressible memory.

This live range represents the minimal guaranteed lifetime of the object being addressed. Uses of derived addresses
may be extended up to the ends of this scope without violating ownership.

.liveOut objects (@in_guaranteed, @out and globals) have no instruction range.

.local objects (alloc_stack, yield, @in, @inout) report the single live range of the full assignment that reaches
this address.

.owned values (boxes and references) simply report OSSA liveness.

.borrow values report each borrow scope's range. The effective live range is their intersection. A valid use must
lie within
2024-03-05 17:08:13 -08:00
Andrew Trick
5fc50a0092 AddressUtils: refactor the findSingleInitializer API. 2024-02-25 10:29:15 -08:00
Andrew Trick
2e7c29cdf5 Restrict findSingleInitializer @out arguments.
The client should handle @in/@inout arguments differently.
2024-02-12 20:03:38 -08:00
Andrew Trick
b08f2dedf1 Add AccessBase.findSingleInitializer 2024-02-12 09:57:14 -08:00
Andrew Trick
17319fa843 Improve the AddressUtils and OwnershipLiveness APIs 2024-01-30 08:38:57 -08:00
Andrew Trick
3bf7e715e7 Add AddressUtils.swift 2024-01-22 23:42:54 -08:00