[llvm-commits] [llvm] r46922 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Bill Wendling
isanbard at gmail.com
Sun Feb 10 00:10:24 PST 2008
Author: void
Date: Sun Feb 10 02:10:24 2008
New Revision: 46922
URL: http://llvm.org/viewvc/llvm-project?rev=46922&view=rev
Log:
Return "(c1 + c2)" instead of yet another ADD node (which made this a
no-op).
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46922&r1=46921&r2=46922&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Feb 10 02:10:24 2008
@@ -923,7 +923,7 @@
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);
More information about the llvm-commits
mailing list