summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-01-14 12:12:42 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-01-14 12:12:42 +0000
commit67610926fc74d03061da2c1ce4c895d17bee236f (patch)
tree37448332f8936ea2d271542c7c2518e9f8ef5edb /llvm/lib
parent8987d00653a15214c5e21691c139ea8304bc99e6 (diff)
downloadbcm5719-llvm-67610926fc74d03061da2c1ce4c895d17bee236f.tar.gz
bcm5719-llvm-67610926fc74d03061da2c1ce4c895d17bee236f.zip
[DAGCombiner] Add add saturation constant folding tests.
Exposes an issue with sadd_sat for computeOverflowKind, so I've disabled it for now. llvm-svn: 351057
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 6d828d3972d..580a668100b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2207,8 +2207,9 @@ SDValue DAGCombiner::visitADDSAT(SDNode *N) {
return N0;
// If it cannot overflow, transform into an add.
- if (DAG.computeOverflowKind(N0, N1) == SelectionDAG::OFK_Never)
- return DAG.getNode(ISD::ADD, DL, VT, N0, N1);
+ if (Opcode == ISD::UADDSAT)
+ if (DAG.computeOverflowKind(N0, N1) == SelectionDAG::OFK_Never)
+ return DAG.getNode(ISD::ADD, DL, VT, N0, N1);
return SDValue();
}
OpenPOWER on IntegriCloud