diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-02-10 08:10:24 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-02-10 08:10:24 +0000 |
commit | e58f7b81562784e4194905e0f233092360d7782a (patch) | |
tree | 7753a8dcbb31c4a923e6620070260fa2e15837e6 /lib/CodeGen | |
parent | 8fda4951b12696884f060197137bee31f3959b38 (diff) | |
download | external_llvm-e58f7b81562784e4194905e0f233092360d7782a.zip external_llvm-e58f7b81562784e4194905e0f233092360d7782a.tar.gz external_llvm-e58f7b81562784e4194905e0f233092360d7782a.tar.bz2 |
Return "(c1 + c2)" instead of yet another ADD node (which made this a
no-op).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index be4e010..3a03f2c 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -923,7 +923,7 @@ SDOperand DAGCombiner::visitADD(SDNode *N) { return N1; // fold (add c1, c2) -> c1+c2 if (N0C && N1C) - return DAG.getNode(ISD::ADD, VT, N0, N1); + return DAG.getConstant(N0C->getValue() + N1C->getValue(), VT); // canonicalize constant to RHS if (N0C && !N1C) return DAG.getNode(ISD::ADD, VT, N1, N0); |