aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-08-27 17:12:29 +0000
committerOwen Anderson <resistor@mac.com>2010-08-27 17:12:29 +0000
commit6ebbd9238036369a11b709332ddec9a4771f5be2 (patch)
tree7ac4ade2ed055bf7bcad4f338f716fe5e21c8164 /llvm/lib/Analysis/LazyValueInfo.cpp
parent8b4c3207785390f4a3b0478bbb65c218d49c81ae (diff)
downloadllvm-6ebbd9238036369a11b709332ddec9a4771f5be2.zip
llvm-6ebbd9238036369a11b709332ddec9a4771f5be2.tar.gz
llvm-6ebbd9238036369a11b709332ddec9a4771f5be2.tar.bz2
Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change.
This fixes PR5652. llvm-svn: 112270
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 31ca2de..7e00f14 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -656,7 +656,8 @@ LVILatticeVal LVIQuery::getEdgeValue(BasicBlock *BBFrom, BasicBlock *BBTo) {
// Figure out the possible values of the query BEFORE this branch.
LVILatticeVal InBlock = getBlockValue(BBFrom);
- if (!InBlock.isConstantRange()) return InBlock;
+ if (!InBlock.isConstantRange())
+ return LVILatticeVal::getRange(TrueValues);
// Find all potential values that satisfy both the input and output
// conditions.