Skip to content

Commit c63a1c0

Browse files
committed
Use erasePhiArgument instead of eraseArgument in DCE
Fixes rdar://73500476
1 parent 9ef7b2a commit c63a1c0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/SILOptimizer/Transforms/DeadCodeElimination.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,12 @@ bool DCE::removeDead(SILFunction &F) {
552552
// This is not necessary in non-OSSA, and will infact be incorrect.
553553
// Because, passing a value as a phi argument does not imply end of
554554
// lifetime in non-OSSA.
555-
BB.eraseArgument(i);
556555
for (auto *pred : BB.getPredecessorBlocks()) {
557556
auto *predTerm = pred->getTerminator();
558557
auto predArg = predTerm->getAllOperands()[i].get();
559558
endLifetimeOfLiveValue(predArg, predTerm);
560-
deleteEdgeValue(pred->getTerminator(), &BB, i);
561559
}
560+
erasePhiArgument(&BB, i);
562561
Changed = true;
563562
BranchesChanged = true;
564563
}

0 commit comments

Comments
 (0)