What is this fixing? I would expect SelectionDAG to constant evaluating it to a constant node?
Evan On Feb 10, 2008, at 12:10 AM, Bill Wendling wrote: > 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); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits