forked from OSchip/llvm-project
When computing the value on an edge, in certain cases LVI would fail to compute the value range
in the predecessor block, leading to an incorrect conclusion for the edge value. Found by inspection. llvm-svn: 122908
This commit is contained in:
parent
7bdd440035
commit
e86dacf449
|
@ -817,6 +817,11 @@ bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom,
|
||||||
if (!isTrueDest) TrueValues = TrueValues.inverse();
|
if (!isTrueDest) TrueValues = TrueValues.inverse();
|
||||||
|
|
||||||
// Figure out the possible values of the query BEFORE this branch.
|
// Figure out the possible values of the query BEFORE this branch.
|
||||||
|
if (!hasBlockValue(Val, BBFrom)) {
|
||||||
|
block_value_stack.push(std::make_pair(BBFrom, Val));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
LVILatticeVal InBlock = getBlockValue(Val, BBFrom);
|
LVILatticeVal InBlock = getBlockValue(Val, BBFrom);
|
||||||
if (!InBlock.isConstantRange()) {
|
if (!InBlock.isConstantRange()) {
|
||||||
Result = LVILatticeVal::getRange(TrueValues);
|
Result = LVILatticeVal::getRange(TrueValues);
|
||||||
|
|
Loading…
Reference in New Issue