[InstCombine] Add old extract to worklist for DCE

To make sure it is removed in the same InstCombine iteration.
This commit is contained in:
Nikita Popov 2023-07-05 16:59:29 +02:00
parent ae8f929b93
commit b7e38ff223

View File

@ -171,8 +171,11 @@ Instruction *InstCombinerImpl::scalarizePHI(ExtractElementInst &EI,
}
}
for (auto *E : Extracts)
for (auto *E : Extracts) {
replaceInstUsesWith(*E, scalarPHI);
// Add old extract to worklist for DCE.
addToWorklist(E);
}
return &EI;
}