[llvm] r349958 - [DAGCombiner] simplify code leading to scalarizeExtractedVectorLoad; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 21 13:26:30 PST 2018
Author: spatel
Date: Fri Dec 21 13:26:30 2018
New Revision: 349958
URL: http://llvm.org/viewvc/llvm-project?rev=349958&view=rev
Log:
[DAGCombiner] simplify code leading to scalarizeExtractedVectorLoad; NFC
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=349958&r1=349957&r2=349958&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Dec 21 13:26:30 2018
@@ -15734,14 +15734,13 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR
ExtVT = BCVT.getVectorElementType();
}
- // (vextract (vN[if]M load $addr), i) -> ([if]M load $addr + i * size)
+ // extract (vector load $addr), i --> load $addr + i * size
if (!LegalOperations && !IndexC && VecOp.hasOneUse() &&
ISD::isNormalLoad(VecOp.getNode()) &&
- !N->getOperand(1)->hasPredecessor(VecOp.getNode())) {
- SDValue Index = N->getOperand(1);
- if (auto *OrigLoad = dyn_cast<LoadSDNode>(VecOp))
- if (!OrigLoad->isVolatile())
- return scalarizeExtractedVectorLoad(N, VecVT, Index, OrigLoad);
+ !Index->hasPredecessor(VecOp.getNode())) {
+ auto *VecLoad = dyn_cast<LoadSDNode>(VecOp);
+ if (VecLoad && !VecLoad->isVolatile())
+ return scalarizeExtractedVectorLoad(N, VecVT, Index, VecLoad);
}
// Perform only after legalization to ensure build_vector / vector_shuffle
More information about the llvm-commits
mailing list