Merge pull request #78361 from eeckstein/dead-obj-elimination

DeadObjectElimination: handle OSSA instructions when analyzing class destructors
This commit is contained in:
eeckstein
2025-01-02 08:41:15 +01:00
committed by GitHub
3 changed files with 43 additions and 0 deletions

View File

@@ -204,6 +204,10 @@ static DestructorEffects doesDestructorHaveSideEffects(AllocRefInstBase *ARI) {
continue;
}
if (isa<BeginBorrowInst>(I) || isa<EndBorrowInst>(I) || isa<EndLifetimeInst>(I)) {
continue;
}
// dealloc_ref on self can be ignored, but dealloc_ref on anything else
// cannot be eliminated.
if (auto *DeallocRef = dyn_cast<DeallocRefInst>(&I)) {