For PR1205:

First round of ConstantRange changes. This makes all CR constructors use
only APInt and not use ConstantInt. Clients are adjusted accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34756 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2007-02-28 18:57:32 +00:00
parent f1b214d3ca
commit dc5c159701
5 changed files with 51 additions and 105 deletions

View File

@@ -1150,7 +1150,7 @@ Relation::KnownResult CEE::getCmpResult(CmpInst *CI,
//
if (ConstantInt *C = dyn_cast<ConstantInt>(Op1)) {
// Check to see if we already know the result of this comparison...
ConstantRange R = ConstantRange(predicate, C);
ConstantRange R = ConstantRange(predicate, C->getValue());
ConstantRange Int = R.intersectWith(Op0VI->getBounds(),
ICmpInst::isSignedPredicate(ICmpInst::Predicate(predicate)));
@@ -1197,7 +1197,7 @@ bool Relation::contradicts(unsigned Op,
if (ConstantInt *C = dyn_cast<ConstantInt>(Val))
if (Op >= ICmpInst::FIRST_ICMP_PREDICATE &&
Op <= ICmpInst::LAST_ICMP_PREDICATE)
if (ConstantRange(Op, C).intersectWith(VI.getBounds(),
if (ConstantRange(Op, C->getValue()).intersectWith(VI.getBounds(),
ICmpInst::isSignedPredicate(ICmpInst::Predicate(Op))).isEmptySet())
return true;
@@ -1255,8 +1255,9 @@ bool Relation::incorporate(unsigned Op, ValueInfo &VI) {
if (ConstantInt *C = dyn_cast<ConstantInt>(Val))
if (Op >= ICmpInst::FIRST_ICMP_PREDICATE &&
Op <= ICmpInst::LAST_ICMP_PREDICATE)
VI.getBounds() = ConstantRange(Op, C).intersectWith(VI.getBounds(),
ICmpInst::isSignedPredicate(ICmpInst::Predicate(Op)));
VI.getBounds() =
ConstantRange(Op, C->getValue()).intersectWith(VI.getBounds(),
ICmpInst::isSignedPredicate(ICmpInst::Predicate(Op)));
switch (Rel) {
default: assert(0 && "Unknown prior value!");