[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGISel.h

Anton Korobeynikov asl at math.spbu.ru
Mon Apr 9 05:32:20 PDT 2007



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGISel.h updated: 1.36 -> 1.37
---
Log message:

Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word 
length) cases with few destinations. Good testcase will follow.


---
Diffs of the changes:  (+29 -1)

 SelectionDAGISel.h |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/CodeGen/SelectionDAGISel.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.36 llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.37
--- llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.36	Wed Apr  4 16:14:49 2007
+++ llvm/include/llvm/CodeGen/SelectionDAGISel.h	Mon Apr  9 07:31:58 2007
@@ -124,7 +124,33 @@
     bool Emitted;
   };
   typedef std::pair<JumpTableHeader, JumpTable> JumpTableBlock;
- 
+
+  struct BitTestCase {
+    BitTestCase(uint64_t M, MachineBasicBlock* T, MachineBasicBlock* Tr):
+      Mask(M), ThisBB(T), TargetBB(Tr) { };
+    uint64_t Mask;
+    MachineBasicBlock* ThisBB;
+    MachineBasicBlock* TargetBB;
+  };
+  
+  typedef SmallVector<BitTestCase, 3> BitTestInfo;
+
+  struct BitTestBlock {
+    BitTestBlock(uint64_t F, uint64_t R, Value* SV,
+                 unsigned Rg, bool E,
+                 MachineBasicBlock* P, MachineBasicBlock* D,
+                 const BitTestInfo& C):
+      First(F), Range(R), SValue(SV), Reg(Rg), Emitted(E),
+      Parent(P), Default(D), Cases(C) { };
+    uint64_t First;
+    uint64_t Range;
+    Value  *SValue;
+    unsigned Reg;
+    bool Emitted;
+    MachineBasicBlock *Parent;
+    MachineBasicBlock *Default;
+    BitTestInfo Cases;
+  };
 protected:
   /// Pick a safe ordering and emit instructions for each target node in the
   /// graph.
@@ -157,6 +183,8 @@
   /// JTCases - Vector of JumpTable structures which holds necessary information
   /// for emitting a jump tables during SwitchInst code generation.
   std::vector<JumpTableBlock> JTCases;
+
+  std::vector<BitTestBlock> BitTestCases;
 };
 
 }






More information about the llvm-commits mailing list