mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #35591 from meg-gupta/fixdcebug
Use erasePhiArgument instead of eraseArgument in DCE
This commit is contained in:
@@ -551,13 +551,12 @@ bool DCE::removeDead(SILFunction &F) {
|
||||
// This is not necessary in non-OSSA, and will infact be incorrect.
|
||||
// Because, passing a value as a phi argument does not imply end of
|
||||
// lifetime in non-OSSA.
|
||||
BB.eraseArgument(i);
|
||||
for (auto *pred : BB.getPredecessorBlocks()) {
|
||||
auto *predTerm = pred->getTerminator();
|
||||
auto predArg = predTerm->getAllOperands()[i].get();
|
||||
endLifetimeOfLiveValue(predArg, predTerm);
|
||||
deleteEdgeValue(pred->getTerminator(), &BB, i);
|
||||
}
|
||||
erasePhiArgument(&BB, i);
|
||||
Changed = true;
|
||||
BranchesChanged = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user