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

Anton Korobeynikov asl at math.spbu.ru
Sat Apr 14 06:26:27 PDT 2007



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.419 -> 1.420
---
Log message:

Fix PR1325: http://llvm.org/PR1325 : Case range optimization was performed in the case it 
shouldn't. Also fix some "latent" bug on 64-bit platforms


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.419 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.420
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.419	Fri Apr 13 21:26:56 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Sat Apr 14 08:25:55 2007
@@ -1678,8 +1678,6 @@
                                                     CaseRecVector& WorkList,
                                                     Value* SV,
                                                     MachineBasicBlock* Default){
-  return false;  // DISABLED FOR NOW: PR1325.
-  
   unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy());
 
   Case& FrontCase = *CR.Range.first;
@@ -1732,7 +1730,7 @@
   // word without having to subtract minValue. In this case,
   // we can optimize away the subtraction.
   if (cast<ConstantInt>(minValue)->getSExtValue() >= 0 &&
-      cast<ConstantInt>(maxValue)->getSExtValue() <= IntPtrBits) {
+      cast<ConstantInt>(maxValue)->getSExtValue() <  IntPtrBits) {
     range = cast<ConstantInt>(maxValue)->getSExtValue();
   } else {
     lowBound = cast<ConstantInt>(minValue)->getSExtValue();
@@ -1757,7 +1755,7 @@
     uint64_t hi = cast<ConstantInt>(I->High)->getSExtValue() - lowBound;
     
     for (uint64_t j = lo; j <= hi; j++) {
-      CasesBits[i].Mask |=  1 << j;
+      CasesBits[i].Mask |=  1ULL << j;
       CasesBits[i].Bits++;
     }
       






More information about the llvm-commits mailing list