[llvm] r361570 - [InstCombine] remove redundant fold for extractelement; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 16:33:39 PDT 2019
Author: spatel
Date: Thu May 23 16:33:38 2019
New Revision: 361570
URL: http://llvm.org/viewvc/llvm-project?rev=361570&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp?rev=361570&r1=361569&r2=361570&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp Thu May 23 16:33:38 2019
@@ -884,10 +884,6 @@ Instruction *InstCombiner::visitInsertEl
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)
More information about the llvm-commits
mailing list