mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
Don't assume that all constants with integer types are ConstantInts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111906 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d01347e080
commit
59b06dc775
@ -216,6 +216,8 @@ public:
|
|||||||
return markOverdefined();
|
return markOverdefined();
|
||||||
else
|
else
|
||||||
return markConstantRange(NewR);
|
return markConstantRange(NewR);
|
||||||
|
} else if (!isUndefined()) {
|
||||||
|
return markOverdefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(isUndefined() && "Unexpected lattice");
|
assert(isUndefined() && "Unexpected lattice");
|
||||||
@ -541,7 +543,12 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
|
|||||||
ConstantRange RHSRange(1);
|
ConstantRange RHSRange(1);
|
||||||
const IntegerType *ResultTy = cast<IntegerType>(BBI->getType());
|
const IntegerType *ResultTy = cast<IntegerType>(BBI->getType());
|
||||||
if (isa<BinaryOperator>(BBI)) {
|
if (isa<BinaryOperator>(BBI)) {
|
||||||
RHS = cast<ConstantInt>(BBI->getOperand(1));
|
RHS = dyn_cast<ConstantInt>(BBI->getOperand(1));
|
||||||
|
if (!RHS) {
|
||||||
|
Result.markOverdefined();
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
RHSRange = ConstantRange(RHS->getValue(), RHS->getValue()+1);
|
RHSRange = ConstantRange(RHS->getValue(), RHS->getValue()+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -842,7 +849,9 @@ LazyValueInfo::getPredicateOnEdge(unsigned Pred, Value *V, Constant *C,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Result.isConstantRange()) {
|
if (Result.isConstantRange()) {
|
||||||
ConstantInt *CI = cast<ConstantInt>(C);
|
ConstantInt *CI = dyn_cast<ConstantInt>(C);
|
||||||
|
if (!CI) return Unknown;
|
||||||
|
|
||||||
ConstantRange CR = Result.getConstantRange();
|
ConstantRange CR = Result.getConstantRange();
|
||||||
if (Pred == ICmpInst::ICMP_EQ) {
|
if (Pred == ICmpInst::ICMP_EQ) {
|
||||||
if (!CR.contains(CI->getValue()))
|
if (!CR.contains(CI->getValue()))
|
||||||
|
Loading…
Reference in New Issue
Block a user