File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -884,14 +884,10 @@ Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) {
884
884
if (match (IdxOp, m_ConstantInt (InsertedIdx)) &&
885
885
match (ScalarOp, m_ExtractElement (m_Value (ExtVecOp),
886
886
m_ConstantInt (ExtractedIdx)))) {
887
- unsigned NumInsertVectorElts = IE.getType ()->getNumElements ();
888
887
unsigned NumExtractVectorElts = ExtVecOp->getType ()->getVectorNumElements ();
889
888
if (ExtractedIdx >= NumExtractVectorElts) // Out of range extract.
890
889
return replaceInstUsesWith (IE, VecOp);
891
890
892
- if (InsertedIdx >= NumInsertVectorElts) // Out of range insert.
893
- return replaceInstUsesWith (IE, UndefValue::get (IE.getType ()));
894
-
895
891
// If we are extracting a value from a vector, then inserting it right
896
892
// back into the same place, just use the input vector.
897
893
if (ExtVecOp == VecOp && ExtractedIdx == InsertedIdx)
You can’t perform that action at this time.
0 commit comments