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

Anton Korobeynikov asl at math.spbu.ru
Wed Apr 4 14:15:11 PDT 2007



Changes in directory llvm/include/llvm/CodeGen:

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

Properly emit range comparisons for switch cases, where neighbour cases 
go to the same destination. Now we're producing really good code for 
switch-lower-feature.ll testcase


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

 SelectionDAGISel.h |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAGISel.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.35 llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.36
--- llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.35	Sun Mar 25 10:07:15 2007
+++ llvm/include/llvm/CodeGen/SelectionDAGISel.h	Wed Apr  4 16:14:49 2007
@@ -82,15 +82,17 @@
   /// SDISel for the code generation of additional basic blocks needed by multi-
   /// case switch statements.
   struct CaseBlock {
-    CaseBlock(ISD::CondCode cc, Value *cmplhs, Value *cmprhs, 
+    CaseBlock(ISD::CondCode cc, Value *cmplhs, Value *cmprhs, Value *cmpmiddle,
               MachineBasicBlock *truebb, MachineBasicBlock *falsebb,
               MachineBasicBlock *me)
-      : CC(cc), CmpLHS(cmplhs), CmpRHS(cmprhs),
+      : CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
         TrueBB(truebb), FalseBB(falsebb), ThisBB(me) {}
     // CC - the condition code to use for the case block's setcc node
     ISD::CondCode CC;
-    // CmpLHS/CmpRHS - The LHS/RHS of the comparison to emit.
-    Value *CmpLHS, *CmpRHS;
+    // CmpLHS/CmpRHS/CmpMHS - The LHS/MHS/RHS of the comparison to emit.
+    // Emit by default LHS op RHS. MHS is used for range comparisons:
+    // If MHS is not null: (LHS <= MHS) and (MHS <= RHS).
+    Value *CmpLHS, *CmpMHS, *CmpRHS;
     // TrueBB/FalseBB - the block to branch to if the setcc is true/false.
     MachineBasicBlock *TrueBB, *FalseBB;
     // ThisBB - the block into which to emit the code for the setcc and branches






More information about the llvm-commits mailing list