aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-09-07 11:34:47 +0000
committerBill Wendling <isanbard@gmail.com>2008-09-07 11:34:47 +0000
commitca460d5a39e09836e279405b85e2390fa7e7d859 (patch)
treefbcaa3d239634a900b0475748b1ccaab83c80032 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentc7e4c4dd3a3b34142629ba2ae14b9a503ad3f3de (diff)
Convert
// fold (sub c1, c2) -> c1-c2 from a no-op into an actual transformation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2d400bdfb2..4e4984789b 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1111,7 +1111,7 @@ SDValue DAGCombiner::visitSUB(SDNode *N) {
return DAG.getConstant(0, N->getValueType(0));
// fold (sub c1, c2) -> c1-c2
if (N0C && N1C)
- return DAG.getNode(ISD::SUB, VT, N0, N1);
+ return DAG.getConstant(N0C->getAPIntValue() - N1C->getAPIntValue(), VT);
// fold (sub x, c) -> (add x, -c)
if (N1C)
return DAG.getNode(ISD::ADD, VT, N0,