diff options
author | Owen Anderson <resistor@mac.com> | 2011-01-05 21:37:18 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-01-05 21:37:18 +0000 |
commit | e86dacf4494f1d16aa0fe0b1be291b712dd2ea28 (patch) | |
tree | fe4a8157b4f869bd234acf77679c1d6c855d4097 /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 7bdd4400350d6b05adc521573128be338bd85404 (diff) | |
download | bcm5719-llvm-e86dacf4494f1d16aa0fe0b1be291b712dd2ea28.tar.gz bcm5719-llvm-e86dacf4494f1d16aa0fe0b1be291b712dd2ea28.zip |
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
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 38355edb83d..17348cd028e 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/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); |