DeadObjectElimination: handle OSSA instructions when analyzing class destructors

Handle typical patterns which are generated by SILGen.
This commit is contained in:
Erik Eckstein
2024-12-24 11:56:34 +01:00
parent 55189bae8e
commit 41dd3dc453
3 changed files with 43 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ SILValue swift::stripCasts(SILValue v) {
if (auto *svi = dyn_cast<SingleValueInstruction>(v)) {
if (isIdentityPreservingRefCast(svi) ||
isa<UncheckedTrivialBitCastInst>(v) || isa<MarkDependenceInst>(v) ||
isa<UncheckedOwnershipConversionInst>(v) ||
isa<BeginAccessInst>(v)) {
v = cast<SingleValueInstruction>(v)->getOperand(0);
continue;