diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-30 22:05:34 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-04-01 19:55:28 +0200 |
commit | d40368fdb5e1b90e68b1078f32c283aa800238be (patch) | |
tree | 1750d8b012d80646f5ce30549d41302d894d5ce7 | |
parent | 4b35c816ef7afd9e39da621174c1b03b2f325830 (diff) | |
download | llvm-d40368fdb5e1b90e68b1078f32c283aa800238be.zip llvm-d40368fdb5e1b90e68b1078f32c283aa800238be.tar.gz llvm-d40368fdb5e1b90e68b1078f32c283aa800238be.tar.bz2 |
[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.
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 2d72696..1f7279f 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -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); } } |