forked from OSchip/llvm-project
[InstCombine] Erase old instruction when replacing extractelements
As we are not returning the result of replaceInstUsesWith(), so we need to clean up ourselves. NFC apart from worklist order.
This commit is contained in:
parent
4b35c816ef
commit
d40368fdb5
|
@ -597,6 +597,7 @@ static void replaceExtractElements(InsertElementInst *InsElt,
|
|||
auto *NewExt = ExtractElementInst::Create(WideVec, OldExt->getOperand(1));
|
||||
NewExt->insertAfter(OldExt);
|
||||
IC.replaceInstUsesWith(*OldExt, NewExt);
|
||||
IC.eraseInstFromFunction(*OldExt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue