It is done to uniformly handle instructions removal.
Differential Revision: https://reviews.llvm.org/D39369
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316884
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!CanDoPRE) {
while (!NewInsts.empty()) {
Instruction *I = NewInsts.pop_back_val();
- if (MD) MD->removeInstruction(I);
- I->eraseFromParent();
+ markInstructionForDeletion(I);
}
// HINT: Don't revert the edge-splitting as following transformation may
// also need to split these critical edges.