diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-30 02:26:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-30 02:26:29 +0000 |
commit | 366429b400c9ec41fbba7c24ed7d0a100e421136 (patch) | |
tree | 7f04692903307fc2ced5f24d115fa45249007842 /lib/Analysis/MemoryDependenceAnalysis.cpp | |
parent | d11ba72db9de3e797fc6557221b2f86359762591 (diff) | |
download | external_llvm-366429b400c9ec41fbba7c24ed7d0a100e421136.zip external_llvm-366429b400c9ec41fbba7c24ed7d0a100e421136.tar.gz external_llvm-366429b400c9ec41fbba7c24ed7d0a100e421136.tar.bz2 |
reapply r90093 with an addition of keeping the forward
and reverse nonlocal memdep maps in synch, this should
fix 255.vortex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index b5069ec..21baf42 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -1156,8 +1156,21 @@ getNonLocalPointerDepFromBB(Value *Pointer, uint64_t PointeeSize, // that predecessor. We can still do PRE of the load, which would insert // a computation of the pointer in this predecessor. if (PredPtr == 0) { - Result.push_back(NonLocalDepEntry(Pred, - MemDepResult::getClobber(Pred->getTerminator()))); + // Add the entry to the Result list. + 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; } |