summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-06 11:04:21 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-06 11:04:21 +0000
commit642f53d292c884d39e9b1a45c74ea67617f871f0 (patch)
treee5018c94b8f8367b41fa3aef085fb9918e5136dc /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent468bb2e601ad96a5c4c563547ba28cbde6c33300 (diff)
downloadbcm5719-llvm-642f53d292c884d39e9b1a45c74ea67617f871f0.tar.gz
bcm5719-llvm-642f53d292c884d39e9b1a45c74ea67617f871f0.zip
[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)
Differential Revision: https://reviews.llvm.org/D58968 llvm-svn: 355495
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index a53219aa357..c99bb535b1d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3803,7 +3803,7 @@ SDValue DAGCombiner::visitUMUL_LOHI(SDNode *N) {
SDValue DAGCombiner::visitSMULO(SDNode *N) {
// (smulo x, 2) -> (saddo x, x)
- if (ConstantSDNode *C2 = dyn_cast<ConstantSDNode>(N->getOperand(1)))
+ if (ConstantSDNode *C2 = isConstOrConstSplat(N->getOperand(1)))
if (C2->getAPIntValue() == 2)
return DAG.getNode(ISD::SADDO, SDLoc(N), N->getVTList(),
N->getOperand(0), N->getOperand(0));
@@ -3813,7 +3813,7 @@ SDValue DAGCombiner::visitSMULO(SDNode *N) {
SDValue DAGCombiner::visitUMULO(SDNode *N) {
// (umulo x, 2) -> (uaddo x, x)
- if (ConstantSDNode *C2 = dyn_cast<ConstantSDNode>(N->getOperand(1)))
+ if (ConstantSDNode *C2 = isConstOrConstSplat(N->getOperand(1)))
if (C2->getAPIntValue() == 2)
return DAG.getNode(ISD::UADDO, SDLoc(N), N->getVTList(),
N->getOperand(0), N->getOperand(0));
OpenPOWER on IntegriCloud