[llvm-commits] [llvm] r55886 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Bill Wendling
isanbard at gmail.com
Sun Sep 7 04:34:48 PDT 2008
Author: void
Date: Sun Sep 7 06:34:47 2008
New Revision: 55886
URL: http://llvm.org/viewvc/llvm-project?rev=55886&view=rev
Log:
Convert
// fold (sub c1, c2) -> c1-c2
from a no-op into an actual transformation.
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=55886&r1=55885&r2=55886&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Sep 7 06:34:47 2008
@@ -1111,7 +1111,7 @@
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,
More information about the llvm-commits
mailing list