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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Sun Apr 2 20:17:03 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.140 -> 1.141
---
Log message:

back this out

---
Diffs of the changes:  (+0 -25)

 DAGCombiner.cpp |   25 -------------------------
 1 files changed, 25 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.140 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.141
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.140	Sun Apr  2 16:42:45 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Sun Apr  2 22:16:50 2006
@@ -819,31 +819,6 @@
                                             TLI.getShiftAmountTy())));
   }
 
-  //These two might be better as:
-  // mul x, ((1 << c) + cn) -> (x << c) + (x * cn)
-  // where TargetInfo tells us cn is a cheap constant to multiply by
-
-  // fold (mul x, (1 << c) + 1) -> (x << c) + x
-  //FIXME: there should be a target hint to allow other constants based on 
-  //       expense of mul
-  if (N1C && isPowerOf2_64(N1C->getSignExtended() - 1)) {
-    return DAG.getNode(ISD::ADD, VT, 
-		       DAG.getNode(ISD::SHL, VT, N0,
-			   DAG.getConstant(Log2_64(N1C->getSignExtended() - 1),
-						   TLI.getShiftAmountTy())),
-		       N0);
-  }
-  // fold (mul x, (1 << c) - 1) -> (x << c) - x
-  //FIXME: there should be a target hint to allow other constants based on 
-  //       the expense of mul
-  if (N1C && isPowerOf2_64(N1C->getSignExtended() + 1)) {
-    return DAG.getNode(ISD::SUB, VT, 
-		       DAG.getNode(ISD::SHL, VT, N0,
-			   DAG.getConstant(Log2_64(N1C->getSignExtended() + 1),
-					   TLI.getShiftAmountTy())),
-		       N0);
-  }
-
   // (mul (shl X, c1), c2) -> (mul X, c2 << c1)
   if (N1C && N0.getOpcode() == ISD::SHL && 
       isa<ConstantSDNode>(N0.getOperand(1))) {






More information about the llvm-commits mailing list