1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[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:
Nikita Popov 2020-03-30 22:05:34 +02:00
parent 00a4727da6
commit 86d202f6d2

View File

@ -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);
}
}