aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-01-05 21:37:18 +0000
committerOwen Anderson <resistor@mac.com>2011-01-05 21:37:18 +0000
commitbe41901d5a8b48ef6587a9f4c688376033e4a590 (patch)
tree54f26adc6382fc1c0b6a9a47e15a728ab1f98f6e /lib/Analysis
parentbfb7dd9e9ed26aba40febe726dc46bcd4426d8ae (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/LazyValueInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index 38355edb83..17348cd028 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -817,6 +817,11 @@ bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom,
if (!isTrueDest) TrueValues = TrueValues.inverse();
// 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);
if (!InBlock.isConstantRange()) {
Result = LVILatticeVal::getRange(TrueValues);