[llvm-commits] [llvm] r122908 - /llvm/trunk/lib/Analysis/LazyValueInfo.cpp

Owen Anderson resistor at mac.com
Wed Jan 5 13:37:18 PST 2011


Author: resistor
Date: Wed Jan  5 15:37:18 2011
New Revision: 122908

URL: http://llvm.org/viewvc/llvm-project?rev=122908&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Analysis/LazyValueInfo.cpp

Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=122908&r1=122907&r2=122908&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Wed Jan  5 15:37:18 2011
@@ -817,6 +817,11 @@
           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);





More information about the llvm-commits mailing list