forked from OSchip/llvm-project
Fix another iterator invalidation that caused a *really* nasty miscompilation in 403.gcc.
llvm-svn: 111210
This commit is contained in:
parent
c350e7a509
commit
fa7d44687f
|
@ -379,7 +379,7 @@ namespace {
|
||||||
LVILatticeVal getEdgeValue(BasicBlock *FromBB, BasicBlock *ToBB);
|
LVILatticeVal getEdgeValue(BasicBlock *FromBB, BasicBlock *ToBB);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LVILatticeVal &getCachedEntryForBlock(BasicBlock *BB);
|
LVILatticeVal getCachedEntryForBlock(BasicBlock *BB);
|
||||||
};
|
};
|
||||||
} // end anonymous namespace
|
} // end anonymous namespace
|
||||||
|
|
||||||
|
@ -402,14 +402,14 @@ void LazyValueInfoCache::LVIValueHandle::deleted() {
|
||||||
|
|
||||||
/// getCachedEntryForBlock - See if we already have a value for this block. If
|
/// 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.
|
/// 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);
|
NewBlockInfo.insert(BB);
|
||||||
return Cache[BB];
|
return Cache[BB];
|
||||||
}
|
}
|
||||||
|
|
||||||
LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
|
LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
|
||||||
// See if we already have a value for this block.
|
// 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 we've already computed this block's value, return it.
|
||||||
if (!BBLV.isUndefined()) {
|
if (!BBLV.isUndefined()) {
|
||||||
|
@ -421,6 +421,7 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
|
||||||
// lattice value to overdefined, so that cycles will terminate and be
|
// lattice value to overdefined, so that cycles will terminate and be
|
||||||
// conservatively correct.
|
// conservatively correct.
|
||||||
BBLV.markOverdefined();
|
BBLV.markOverdefined();
|
||||||
|
Cache[BB] = BBLV;
|
||||||
|
|
||||||
// If V is live into BB, see if our predecessors know anything about it.
|
// If V is live into BB, see if our predecessors know anything about it.
|
||||||
Instruction *BBI = dyn_cast<Instruction>(Val);
|
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'.
|
// Return the merged value, which is more precise than 'overdefined'.
|
||||||
assert(!Result.isOverdefined());
|
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
|
// 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'.
|
// Return the merged value, which is more precise than 'overdefined'.
|
||||||
assert(!Result.isOverdefined());
|
assert(!Result.isOverdefined());
|
||||||
return getCachedEntryForBlock(BB) = Result;
|
Cache[BB] = Result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -489,7 +490,7 @@ LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) {
|
||||||
|
|
||||||
LVILatticeVal Result;
|
LVILatticeVal Result;
|
||||||
Result.markOverdefined();
|
Result.markOverdefined();
|
||||||
return getCachedEntryForBlock(BB) = Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue