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

Chris Lattner sabre at nondot.org
Sun Nov 29 18:26:34 PST 2009


Author: lattner
Date: Sun Nov 29 20:26:29 2009
New Revision: 90107

URL: http://llvm.org/viewvc/llvm-project?rev=90107&view=rev
Log:
reapply r90093 with an addition of keeping the forward
and reverse nonlocal memdep maps in synch, this should
fix 255.vortex.


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=90107&r1=90106&r2=90107&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Sun Nov 29 20:26:29 2009
@@ -1156,8 +1156,21 @@
       // 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;
       }
 





More information about the llvm-commits mailing list