summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-12-21 21:26:30 +0000
committerSanjay Patel <spatel@rotateright.com>2018-12-21 21:26:30 +0000
commit47a6129e2682648a8450ed05edcfffb68cd9038f (patch)
tree7bdf93c754efe7d98fcceebe42ac8554270c54a8 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent14e0d9ed89ac50b885ef6419aa3128090d85fe3c (diff)
downloadbcm5719-llvm-47a6129e2682648a8450ed05edcfffb68cd9038f.tar.gz
bcm5719-llvm-47a6129e2682648a8450ed05edcfffb68cd9038f.zip
[DAGCombiner] simplify code leading to scalarizeExtractedVectorLoad; NFC
llvm-svn: 349958
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 3631a8cb861..a68980a9626 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -15734,14 +15734,13 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
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
OpenPOWER on IntegriCloud