diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-23 00:27:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-23 00:27:03 +0000 |
| commit | 706d40e66235dafb85557ade0bb6c2209111d878 (patch) | |
| tree | 88c20ad24e264f9ab908511e827ba0c7c5715e4b /llvm/lib | |
| parent | 48abf2380b7657c57c61524c34aecf5b157e4cd4 (diff) | |
| download | bcm5719-llvm-706d40e66235dafb85557ade0bb6c2209111d878.tar.gz bcm5719-llvm-706d40e66235dafb85557ade0bb6c2209111d878.zip | |
a minor tweak to my previous patch, handle the invalidation case
when there are multiple iterations of the loop. This fixes PR3375.
llvm-svn: 62822
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index ddfb26eebc1..c84a51fb062 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -751,9 +751,10 @@ getNonLocalPointerDepFromBB(Value *Pointer, uint64_t PointeeSize, // cache remains sorted. Sort it now (if needed) so that recursive // invocations of getNonLocalPointerDepFromBB that could reuse the cache // value will only see properly sorted cache arrays. - if (NumSortedEntries != Cache->size()) { + if (Cache && NumSortedEntries != Cache->size()) { std::sort(Cache->begin(), Cache->end()); NumSortedEntries = Cache->size(); + Cache = 0; } // FIXME: it is entirely possible that PHI translating will end up with @@ -767,12 +768,12 @@ getNonLocalPointerDepFromBB(Value *Pointer, uint64_t PointeeSize, Result, Visited)) goto PredTranslationFailure; } - + // Refresh the CacheInfo/Cache pointer so that it isn't invalidated. CacheInfo = &NonLocalPointerDeps[CacheKey]; Cache = &CacheInfo->second; NumSortedEntries = Cache->size(); - + // Since we did phi translation, the "Cache" set won't contain all of the // results for the query. This is ok (we can still use it to accelerate // specific block queries) but we can't do the fastpath "return all |

