parent
13ce07fa92
commit
38f6b7fe3b
|
@ -846,6 +846,11 @@ Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB) {
|
|||
|
||||
if (Result.isConstant())
|
||||
return Result.getConstant();
|
||||
else if (Result.isConstantRange()) {
|
||||
ConstantRange CR = Result.getConstantRange();
|
||||
if (const APInt *SingleVal = CR.getSingleElement())
|
||||
return ConstantInt::get(V->getContext(), *SingleVal);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue