diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 1f7279fb92993..2d72696ee5319 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -597,7 +597,6 @@ static void replaceExtractElements(InsertElementInst *InsElt, auto *NewExt = ExtractElementInst::Create(WideVec, OldExt->getOperand(1)); NewExt->insertAfter(OldExt); IC.replaceInstUsesWith(*OldExt, NewExt); - IC.eraseInstFromFunction(*OldExt); } }