[llvm-commits] [llvm] r55889 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Bill Wendling isanbard at gmail.com
Sun Sep 7 18:56:33 PDT 2008


Author: void
Date: Sun Sep  7 20:56:32 2008
New Revision: 55889

URL: http://llvm.org/viewvc/llvm-project?rev=55889&view=rev
Log:
Revert my previous change -- the subtraction of two constants was a no-op
before. This is taken care of in the selection DAG pass. In my opinion, this
should be in one place or the other. I.e., it should probably be removed from
the DAG combiner (along with the other arithmetic transformations on constants
that are essentially no-ops).

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=55889&r1=55888&r2=55889&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Sep  7 20:56:32 2008
@@ -1111,7 +1111,7 @@
     return DAG.getConstant(0, N->getValueType(0));
   // fold (sub c1, c2) -> c1-c2
   if (N0C && N1C)
-    return DAG.getConstant(N0C->getAPIntValue() - N1C->getAPIntValue(), VT);
+    return DAG.getNode(ISD::SUB, VT, N0, N1);
   // fold (sub x, c) -> (add x, -c)
   if (N1C)
     return DAG.getNode(ISD::ADD, VT, N0,





More information about the llvm-commits mailing list