Remove the code that tried to evaluate whether (A pred B) is known

by determining if (B pred (B-A)) is known, as it doesn't handle
overflow correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76504 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-07-20 23:53:35 +00:00
parent 71bbebdac9
commit 4500e9eb80

View File

@ -4274,20 +4274,6 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
return true;
if (LHSRange.getSignedMin().sge(RHSRange.getSignedMax()))
return false;
const SCEV *Diff = getMinusSCEV(LHS, RHS);
ConstantRange DiffRange = getUnsignedRange(Diff);
if (isKnownNegative(Diff)) {
if (DiffRange.getUnsignedMax().ult(LHSRange.getUnsignedMin()))
return true;
if (DiffRange.getUnsignedMin().uge(LHSRange.getUnsignedMax()))
return false;
} else if (isKnownPositive(Diff)) {
if (LHSRange.getUnsignedMax().ult(DiffRange.getUnsignedMin()))
return true;
if (LHSRange.getUnsignedMin().uge(DiffRange.getUnsignedMax()))
return false;
}
break;
}
case ICmpInst::ICMP_SGE:
@ -4300,20 +4286,6 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
return true;
if (LHSRange.getSignedMin().sgt(RHSRange.getSignedMax()))
return false;
const SCEV *Diff = getMinusSCEV(LHS, RHS);
ConstantRange DiffRange = getUnsignedRange(Diff);
if (isKnownNonPositive(Diff)) {
if (DiffRange.getUnsignedMax().ule(LHSRange.getUnsignedMin()))
return true;
if (DiffRange.getUnsignedMin().ugt(LHSRange.getUnsignedMax()))
return false;
} else if (isKnownNonNegative(Diff)) {
if (LHSRange.getUnsignedMax().ule(DiffRange.getUnsignedMin()))
return true;
if (LHSRange.getUnsignedMin().ugt(DiffRange.getUnsignedMax()))
return false;
}
break;
}
case ICmpInst::ICMP_UGT:
@ -4326,13 +4298,6 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
return true;
if (LHSRange.getUnsignedMin().uge(RHSRange.getUnsignedMax()))
return false;
const SCEV *Diff = getMinusSCEV(LHS, RHS);
ConstantRange DiffRange = getUnsignedRange(Diff);
if (LHSRange.getUnsignedMax().ult(DiffRange.getUnsignedMin()))
return true;
if (LHSRange.getUnsignedMin().uge(DiffRange.getUnsignedMax()))
return false;
break;
}
case ICmpInst::ICMP_UGE:
@ -4345,13 +4310,6 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
return true;
if (LHSRange.getUnsignedMin().ugt(RHSRange.getUnsignedMax()))
return false;
const SCEV *Diff = getMinusSCEV(LHS, RHS);
ConstantRange DiffRange = getUnsignedRange(Diff);
if (LHSRange.getUnsignedMax().ule(DiffRange.getUnsignedMin()))
return true;
if (LHSRange.getUnsignedMin().ugt(DiffRange.getUnsignedMax()))
return false;
break;
}
case ICmpInst::ICMP_NE: {