Skip to content

Commit 093c922

Browse files
committed
[InstCombine] remove redundant fold for extractelement; NFC
The out-of-bounds index pattern is handled by InstSimplify, so the extractelement should be eliminated next time it is visited. llvm-svn: 361570
1 parent 4d4df6f commit 093c922

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,10 +884,6 @@ Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) {
884884
if (match(IdxOp, m_ConstantInt(InsertedIdx)) &&
885885
match(ScalarOp, m_ExtractElement(m_Value(ExtVecOp),
886886
m_ConstantInt(ExtractedIdx)))) {
887-
unsigned NumExtractVectorElts = ExtVecOp->getType()->getVectorNumElements();
888-
if (ExtractedIdx >= NumExtractVectorElts) // Out of range extract.
889-
return replaceInstUsesWith(IE, VecOp);
890-
891887
// If we are extracting a value from a vector, then inserting it right
892888
// back into the same place, just use the input vector.
893889
if (ExtVecOp == VecOp && ExtractedIdx == InsertedIdx)

0 commit comments

Comments
 (0)