[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCISelLowering.cpp

Nate Begeman natebegeman at mac.com
Thu Oct 20 17:02:55 PDT 2005



Changes in directory llvm/lib/Target/PowerPC:

PPCISelDAGToDAG.cpp updated: 1.114 -> 1.115
PPCISelLowering.cpp updated: 1.35 -> 1.36
---
Log message:

Invert the TargetLowering flag that controls divide by consant expansion.
Add a new flag to TargetLowering indicating if the target has really cheap
  signed division by powers of two, make ppc use it.  This will probably go
  away in the future.
Implement some more ISD::SDIV folds in the dag combiner
Remove now dead code in the x86 backend.


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

 PPCISelDAGToDAG.cpp |    5 +++++
 PPCISelLowering.cpp |    3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.114 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.115
--- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.114	Wed Oct 19 21:15:44 2005
+++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp	Thu Oct 20 19:02:42 2005
@@ -996,6 +996,11 @@
     return SDOperand(N, 0);
   }
   case ISD::SDIV: {
+    // FIXME: since this depends on the setting of the carry flag from the srawi
+    //        we should really be making notes about that for the scheduler.
+    // FIXME: It sure would be nice if we could cheaply recognize the 
+    //        srl/add/sra pattern the dag combiner will generate for this as
+    //        sra/addze rather than having to handle sdiv ourselves.  oh well.
     unsigned Imm;
     if (isIntImmediate(N->getOperand(1), Imm)) {
       if ((signed)Imm > 0 && isPowerOf2_32(Imm)) {


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.35 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.36
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.35	Wed Oct 19 21:15:44 2005
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Thu Oct 20 19:02:42 2005
@@ -27,8 +27,7 @@
     
   // Fold away setcc operations if possible.
   setSetCCIsExpensive();
-  // Fold constant integer div/rem into an alternate sequence of instructions  
-  setIntDivIsExpensive();
+  setPow2DivIsCheap();
   
   // Use _setjmp/_longjmp instead of setjmp/longjmp.
   setUseUnderscoreSetJmpLongJmp(true);






More information about the llvm-commits mailing list