diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-05-23 23:33:38 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-05-23 23:33:38 +0000 |
commit | 093c922205fe53be35edcf99258aa5a00981c605 (patch) | |
tree | 809a5842678dad61d2670b6c2e63202890095819 /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | |
parent | 4d4df6f144d93a901387c66d73183a72e198ee4f (diff) | |
download | bcm5719-llvm-093c922205fe53be35edcf99258aa5a00981c605.tar.gz bcm5719-llvm-093c922205fe53be35edcf99258aa5a00981c605.zip |
[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
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 063175b45cb..c3fd612a9d0 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -884,10 +884,6 @@ Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) { if (match(IdxOp, m_ConstantInt(InsertedIdx)) && match(ScalarOp, m_ExtractElement(m_Value(ExtVecOp), m_ConstantInt(ExtractedIdx)))) { - unsigned NumExtractVectorElts = ExtVecOp->getType()->getVectorNumElements(); - if (ExtractedIdx >= NumExtractVectorElts) // Out of range extract. - return replaceInstUsesWith(IE, VecOp); - // If we are extracting a value from a vector, then inserting it right // back into the same place, just use the input vector. if (ExtVecOp == VecOp && ExtractedIdx == InsertedIdx) |