summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-12-13 15:44:26 +0000
committerSanjay Patel <spatel@rotateright.com>2018-12-13 15:44:26 +0000
commita7b115b392bcd0268a894ffe43b72a39d0094b62 (patch)
treefb0e3fe17e50b593c37be5ff127bad19c55a6525 /llvm/lib
parent4110967c7b6184b16a7c4ddffa99c7e3351ab520 (diff)
downloadbcm5719-llvm-a7b115b392bcd0268a894ffe43b72a39d0094b62.tar.gz
bcm5719-llvm-a7b115b392bcd0268a894ffe43b72a39d0094b62.zip
[DAGCombiner] after simplifying demanded elements of vector operand of extract, revisit the extract
Differential Revision: https://reviews.llvm.org/D55655 llvm-svn: 349051
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp7
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..b364b1baea7 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 operands of this extract element, but if this extract
+ // is still alive, visit it again to ensure that it is folded properly.
+ if (!N->use_empty())
+ AddToWorklist(N);
return SDValue(N, 0);
+ }
}
bool BCNumEltsChanged = false;
OpenPOWER on IntegriCloud