diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-12-13 17:05:01 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-12-13 17:05:01 +0000 |
commit | 791ae69afe1fb1953dc9b66cf2f4bbd5ce642d38 (patch) | |
tree | 27f6fd672ae7a78d28b88c3fd5fb4bed257377e1 /llvm/lib/CodeGen | |
parent | b5aaa673c64ecb86095bf69581e62de781816108 (diff) | |
download | bcm5719-llvm-791ae69afe1fb1953dc9b66cf2f4bbd5ce642d38.tar.gz bcm5719-llvm-791ae69afe1fb1953dc9b66cf2f4bbd5ce642d38.zip |
[DAGCombiner] after simplifying demanded elements of vector operand of extract, revisit the extract; 2nd try
This is a retry of rL349051 (reverted at rL349056). I changed the check for dead-ness from
number of uses to an opcode test for DELETED_NODE based on existing similar code.
Differential Revision: https://reviews.llvm.org/D55655
llvm-svn: 349058
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 7768d12c75c..ceb7e482603 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -15698,8 +15698,13 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) { if (CstElt->getAPIntValue().ult(VT.getVectorNumElements())) DemandedElts.setBit(CstElt->getZExtValue()); } - if (SimplifyDemandedVectorElts(InVec, DemandedElts, true)) + if (SimplifyDemandedVectorElts(InVec, DemandedElts, true)) { + // We simplified the vector operand of this extract element. If this + // extract is not dead, visit it again so it is folded properly. + if (N->getOpcode() != ISD::DELETED_NODE) + AddToWorklist(N); return SDValue(N, 0); + } } bool BCNumEltsChanged = false; |