[OSSACanonicalizeOwned] Fix liveness passed to completion. #78624
[SIL] Print AST types with print-module-on-error.
9f87e0a8
[NFC] SILCombine: Ennamespace canonicalize class.
afe95135
[NFC] SILCombine: Extract processing function.
5ce6c6cf
[Test] Renamed test case.
6deba027
[Test] Added test for SILCombiner::processInst.
af5cd31f
[NFC] PrunedLiveness: Permit postDomBlocks dupes.
4135540f
nate-chandler
force pushed
from
af23ca0d
to
30024b34
158 days ago
nate-chandler
force pushed
from
30024b34
to
4f8cf611
158 days ago
nate-chandler
marked this pull request as ready for review 157 days ago
nate-chandler
force pushed
from
4f8cf611
to
6a2fadca
156 days ago
[OSSACanOwned] Fix liveness passed to completion.
ebf60280
nate-chandler
force pushed
from
6a2fadca
to
ebf60280
156 days ago
atrick
approved these changes
on 2025-01-15
Assignees
No one assigned
To determine where a lifetime ends within dead-end blocks,
OSSACanonicalizeOwned
usesOSSACompleteLifetime
's visitAvailabilityBoundary. This API takes a liveness which it uses to walk forward to the availability boundary. Specifically, the liveness passed fromOSSACanonicalizeOwned
toOSSACompleteLifetime
is a variation ofOSSACanonicalizeOwned
's own liveness (it has destroys added).There is a mismatch in the characteristics of livenesses created by
OSSACanonicalizeOwned
andOSSACompleteLifetime
: The former deals with not only direct uses of a value but also uses of its copies; that introduces the possibility for consuming uses in the middle of liveness. The latter on the other hand deals only with uses of a single value (nestedly, but at each level of nesting only a single value). Passing a liveness from the former to the latter without handling this mismatch is incorrect:OSSACompleteLifetime
understands consuming uses to always end a lifetime, even when they are in the middle of a copy-extended liveness. The result is thatOSSACompleteLifetime
produces non-sensical results when provided with such a liveness.To address this, fixup the liveness passed from
OSSACanonicalizeOwned
toOSSACompleteLifetime
by demoting consuming uses that appear within (that's to say not on the boundary) of liveness to non-consuming uses.Also, check in a few other changes that facilitated tracking this down:
-sil-print-module-on-error
SILCombine
to extract the processing it does on a single instruction into a separate functionFunctionTest
to call that newSILCombine
functionrdar://142846936