reapply r90093 with an addition of keeping the forward

and reverse nonlocal memdep maps in synch, this should
fix 255.vortex.

llvm-svn: 90107
This commit is contained in:
Chris Lattner 2009-11-30 02:26:29 +00:00
parent fef0c67d01
commit 4d252d20e8
1 changed files with 15 additions and 2 deletions

View File

@ -1156,8 +1156,21 @@ getNonLocalPointerDepFromBB(Value *Pointer, uint64_t PointeeSize,
// that predecessor. We can still do PRE of the load, which would insert // that predecessor. We can still do PRE of the load, which would insert
// a computation of the pointer in this predecessor. // a computation of the pointer in this predecessor.
if (PredPtr == 0) { if (PredPtr == 0) {
Result.push_back(NonLocalDepEntry(Pred, // Add the entry to the Result list.
MemDepResult::getClobber(Pred->getTerminator()))); NonLocalDepEntry Entry(Pred,
MemDepResult::getClobber(Pred->getTerminator()));
Result.push_back(Entry);
// Add it to the cache for this CacheKey so that subsequent queries get
// this result.
Cache = &NonLocalPointerDeps[CacheKey].second;
MemoryDependenceAnalysis::NonLocalDepInfo::iterator It =
std::upper_bound(Cache->begin(), Cache->end(), Entry);
Cache->insert(It, Entry);
Cache = 0;
// Add it to the reverse map next.
ReverseNonLocalPtrDeps[Pred->getTerminator()].insert(CacheKey);
continue; continue;
} }