summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-04-14 13:25:55 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-04-14 13:25:55 +0000
commit8a1a84f96ea55097e76826184e7afa8f8430f551 (patch)
tree5735a98009a4af1acdb0ac17ec8aab73246a0770 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parentb4a7326c2059d1da981358b947dcd4554564031c (diff)
downloadbcm5719-llvm-8a1a84f96ea55097e76826184e7afa8f8430f551.tar.gz
bcm5719-llvm-8a1a84f96ea55097e76826184e7afa8f8430f551.zip
Fix PR1325: Case range optimization was performed in the case it
shouldn't. Also fix some "latent" bug on 64-bit platforms llvm-svn: 35990
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 8a9efadd5b4..1f982ce40cc 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1678,8 +1678,6 @@ bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR,
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 @@ bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR,
// 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 @@ bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR,
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++;
}
OpenPOWER on IntegriCloud