aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-08-16 23:42:33 +0000
committerOwen Anderson <resistor@mac.com>2010-08-16 23:42:33 +0000
commit4bb3eafab535d5f5c3567e1d958df257c1e3a4aa (patch)
tree1c8fb529186aecb54af747dfe38cc004d7c36027 /lib/Analysis
parentca5e47d3f84dcf3dfbc6706bf1041e7029f3ce0a (diff)
downloadexternal_llvm-4bb3eafab535d5f5c3567e1d958df257c1e3a4aa.zip
external_llvm-4bb3eafab535d5f5c3567e1d958df257c1e3a4aa.tar.gz
external_llvm-4bb3eafab535d5f5c3567e1d958df257c1e3a4aa.tar.bz2
Fix another iterator invalidation that caused a *really* nasty miscompilation in 403.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/LazyValueInfo.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index d3a437f..6a7fd38 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -379,7 +379,7 @@ namespace {
LVILatticeVal getEdgeValue(BasicBlock *FromBB, BasicBlock *ToBB);
private:
- LVILatticeVal &getCachedEntryForBlock(BasicBlock *BB);
+ LVILatticeVal getCachedEntryForBlock(BasicBlock *BB);
};
} // end anonymous namespace
@@ -402,14 +402,14 @@ void LazyValueInfoCache::LVIValueHandle::deleted() {
/// getCachedEntryForBlock - See if we already have a value for this block. If
/// so, return it, otherwise create a new entry in the Cache map to use.
-LVILatticeVal &LVIQuery::getCachedEntryForBlock(BasicBlock *BB) {
+LVILatticeVal LVIQuery::getCachedEntryForBlock(BasicBlock *BB) {
NewBlockInfo.insert(BB);
return Cache[BB];
}
LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
// See if we already have a value for this block.
- LVILatticeVal &BBLV = getCachedEntryForBlock(BB);
+ LVILatticeVal BBLV = getCachedEntryForBlock(BB);
// If we've already computed this block's value, return it.
if (!BBLV.isUndefined()) {
@@ -421,6 +421,7 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
// lattice value to overdefined, so that cycles will terminate and be
// conservatively correct.
BBLV.markOverdefined();
+ Cache[BB] = BBLV;
// If V is live into BB, see if our predecessors know anything about it.
Instruction *BBI = dyn_cast<Instruction>(Val);
@@ -453,7 +454,7 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
// Return the merged value, which is more precise than 'overdefined'.
assert(!Result.isOverdefined());
- return getCachedEntryForBlock(BB) = Result;
+ return Cache[BB] = Result;
}
// If this value is defined by an instruction in this block, we have to
@@ -478,7 +479,7 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
// Return the merged value, which is more precise than 'overdefined'.
assert(!Result.isOverdefined());
- return getCachedEntryForBlock(BB) = Result;
+ Cache[BB] = Result;
} else {
@@ -489,7 +490,7 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
LVILatticeVal Result;
Result.markOverdefined();
- return getCachedEntryForBlock(BB) = Result;
+ return Result;
}