[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Nate Begeman natebegeman at mac.com
Thu Feb 16 23:26:32 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.104 -> 1.105
---
Log message:

Don't expand sdiv by power of two before legalize, since it will likely
generate illegal nodes.


---
Diffs of the changes:  (+2 -2)

 DAGCombiner.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.104 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.105
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.104	Thu Feb 16 23:43:56 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Fri Feb 17 01:26:20 2006
@@ -731,8 +731,8 @@
   if (TLI.MaskedValueIsZero(N1, SignBit) &&
       TLI.MaskedValueIsZero(N0, SignBit))
     return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1);
-  // fold (sdiv X, pow2) -> simple ops.
-  if (N1C && N1C->getValue() && !TLI.isIntDivCheap() && 
+  // fold (sdiv X, pow2) -> simple ops after legalize
+  if (N1C && N1C->getValue() && !TLI.isIntDivCheap() && AfterLegalize &&
       (isPowerOf2_64(N1C->getSignExtended()) || 
        isPowerOf2_64(-N1C->getSignExtended()))) {
     // If dividing by powers of two is cheap, then don't perform the following






More information about the llvm-commits mailing list