summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 76c825f6bab..bc90b929cf0 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -1155,9 +1155,10 @@ LVILatticeVal LazyValueInfoCache::getValueInBlock(Value *V, BasicBlock *BB,
<< BB->getName() << "'\n");
assert(BlockValueStack.empty() && BlockValueSet.empty());
- pushBlockValue(std::make_pair(BB, V));
-
- solve();
+ if (!hasBlockValue(V, BB)) {
+ pushBlockValue(std::make_pair(BB, V));
+ solve();
+ }
LVILatticeVal Result = getBlockValue(V, BB);
intersectAssumeBlockValueConstantRange(V, Result, CxtI);
@@ -1169,6 +1170,9 @@ LVILatticeVal LazyValueInfoCache::getValueAt(Value *V, Instruction *CxtI) {
DEBUG(dbgs() << "LVI Getting value " << *V << " at '"
<< CxtI->getName() << "'\n");
+ if (auto *C = dyn_cast<Constant>(V))
+ return LVILatticeVal::get(C);
+
LVILatticeVal Result = LVILatticeVal::getOverdefined();
if (auto *I = dyn_cast<Instruction>(V))
Result = getFromRangeMetadata(I);
OpenPOWER on IntegriCloud