Remove the "isSigned" parameters from ConstantRange. It turns out they

are not needed as the results are the same with or without it.

Patch by Nicholas Lewycky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2007-03-01 07:54:15 +00:00
parent cda067bad9
commit a6e8a955d6
4 changed files with 40 additions and 58 deletions

View File

@@ -1156,8 +1156,7 @@ Relation::KnownResult CEE::getCmpResult(CmpInst *CI,
// Check to see if we already know the result of this comparison...
ICmpInst::Predicate ipred = ICmpInst::Predicate(predicate);
ConstantRange R = ICmpInst::makeConstantRange(ipred, C->getValue());
ConstantRange Int = R.intersectWith(Op0VI->getBounds(),
ICmpInst::isSignedPredicate(ipred));
ConstantRange Int = R.intersectWith(Op0VI->getBounds());
// If the intersection of the two ranges is empty, then the condition
// could never be true!
@@ -1203,8 +1202,8 @@ bool Relation::contradicts(unsigned Op,
if (Op >= ICmpInst::FIRST_ICMP_PREDICATE &&
Op <= ICmpInst::LAST_ICMP_PREDICATE) {
ICmpInst::Predicate ipred = ICmpInst::Predicate(Op);
if (ICmpInst::makeConstantRange(ipred, C->getValue()).intersectWith(
VI.getBounds(), ICmpInst::isSignedPredicate(ipred)).isEmptySet())
if (ICmpInst::makeConstantRange(ipred, C->getValue())
.intersectWith(VI.getBounds()).isEmptySet())
return true;
}
@@ -1264,8 +1263,8 @@ bool Relation::incorporate(unsigned Op, ValueInfo &VI) {
Op <= ICmpInst::LAST_ICMP_PREDICATE) {
ICmpInst::Predicate ipred = ICmpInst::Predicate(Op);
VI.getBounds() =
ICmpInst::makeConstantRange(ipred, C->getValue()).intersectWith(
VI.getBounds(), ICmpInst::isSignedPredicate(ipred));
ICmpInst::makeConstantRange(ipred, C->getValue())
.intersectWith(VI.getBounds());
}
switch (Rel) {