diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-05-23 21:49:47 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-05-23 21:49:47 +0000 |
commit | e60cb7d1be4aac850c69486cf69f0c5fe250e3af (patch) | |
tree | 907607be2f8276beb6a77c9e213d71e75e11793e /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | |
parent | 5bc40d9b188bb43e2aafafe58d8d169cc7c9b4f1 (diff) | |
download | bcm5719-llvm-e60cb7d1be4aac850c69486cf69f0c5fe250e3af.tar.gz bcm5719-llvm-e60cb7d1be4aac850c69486cf69f0c5fe250e3af.zip |
[InstSimplify] insertelement V, undef, ? --> V
This was part of InstCombine, but it's better placed in
InstSimplify. InstCombine also had an unreachable but weaker
fold for insertelement with undef index, so that is deleted.
llvm-svn: 361559
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index c2ea0733a48..44130d3246b 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -863,10 +863,6 @@ Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) { VecOp, ScalarOp, IdxOp, SQ.getWithInstruction(&IE))) return replaceInstUsesWith(IE, V); - // Inserting an undef or into an undefined place, remove this. - if (isa<UndefValue>(ScalarOp) || isa<UndefValue>(IdxOp)) - replaceInstUsesWith(IE, VecOp); - // If the vector and scalar are both bitcast from the same element type, do // the insert in that source type followed by bitcast. Value *VecSrc, *ScalarSrc; |