[llvm-commits] [llvm] r62822 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Chris Lattner sabre at nondot.org
Thu Jan 22 16:27:03 PST 2009


Author: lattner
Date: Thu Jan 22 18:27:03 2009
New Revision: 62822

URL: http://llvm.org/viewvc/llvm-project?rev=62822&view=rev
Log:
a minor tweak to my previous patch, handle the invalidation case
when there are multiple iterations of the loop.  This fixes PR3375.

Modified:
    llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=62822&r1=62821&r2=62822&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Jan 22 18:27:03 2009
@@ -751,9 +751,10 @@
         // 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 @@
                                         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





More information about the llvm-commits mailing list