diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-09-07 11:34:47 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-09-07 11:34:47 +0000 |
commit | df8174988614f728d635f074b59a48ae5166adbf (patch) | |
tree | 41ba3d745570502c1cd4e3965be0a0e30fcbdb40 /llvm/lib/CodeGen | |
parent | 5703c6e8dd885375cfe8ad664ee438b0b7e1df43 (diff) | |
download | bcm5719-llvm-df8174988614f728d635f074b59a48ae5166adbf.tar.gz bcm5719-llvm-df8174988614f728d635f074b59a48ae5166adbf.zip |
Convert
// fold (sub c1, c2) -> c1-c2
from a no-op into an actual transformation.
llvm-svn: 55886
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 2d400bdfb25..4e4984789bc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/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, |