Skip to content

Commit 49eb3ca

Browse files
committed
[SILCombine] Keep dead drop_deinits.
1 parent d28a12d commit 49eb3ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/Utils/CanonicalizeInstruction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ static SILBasicBlock::iterator
547547
eliminateUnneededForwardingUnarySingleValueInst(SingleValueInstruction *inst,
548548
CanonicalizeInstruction &pass) {
549549
auto next = std::next(inst->getIterator());
550+
if (isa<DropDeinitInst>(inst))
551+
return next;
550552
for (auto *use : getNonDebugUses(inst)) {
551553
if (auto *destroy = dyn_cast<DestroyValueInst>(use->getUser())) {
552554
if (destroy->isFullDeinitialization())

0 commit comments

Comments
 (0)