aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2009-01-28 15:22:24 +0000
committerTanya Lattner <tonic@nondot.org>2009-01-28 15:22:24 +0000
commitf3ccc98d6acbb533a8b81f479c1b47b14baf7a6c (patch)
tree4de71167049696d4a4755fd06956f0277986fd25
parentfbb018133766f9af2195b802be8fda780e5c2cec (diff)
a minor tweak to my previous patch, handle the invalidation case
when there are multiple iterations of the loop. This fixes PR3375. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_25@63201 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index ddfb26eebc..c84a51fb06 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/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