Cache non-local memory dependence analysis. This is a significant compile
[oota-llvm.git] / include / llvm / Analysis / MemoryDependenceAnalysis.h
index 0b8dec8310501aa4ea418db611be4178a7cf2ee6..067bbcb8bc986d778d41dd8e2aa3a1226f9c91bd 100644 (file)
@@ -37,12 +37,20 @@ class MemoryDependenceAnalysis : public FunctionPass {
             depMapType;
     depMapType depGraphLocal;
 
+    // A map from instructions to their non-local dependencies.
+    typedef DenseMap<Instruction*, DenseMap<BasicBlock*, Value*> >
+            nonLocalDepMapType;
+    nonLocalDepMapType depGraphNonLocal;
+    
     // A reverse mapping form dependencies to the dependees.  This is
     // used when removing instructions to keep the cache coherent.
-    typedef DenseMap<Instruction*, SmallPtrSet<Instruction*, 4> >
+    typedef DenseMap<Value*, SmallPtrSet<Instruction*, 4> >
             reverseDepMapType;
     reverseDepMapType reverseDep;
     
+    // A reverse mapping form dependencies to the non-local dependees.
+    reverseDepMapType reverseDepNonLocal;
+    
   public:
     // Special marker indicating that the query has no dependency
     // in the specified block.
@@ -61,7 +69,9 @@ class MemoryDependenceAnalysis : public FunctionPass {
     /// Clean up memory in between runs
     void releaseMemory() {
       depGraphLocal.clear();
+      depGraphNonLocal.clear();
       reverseDep.clear();
+      reverseDepNonLocal.clear();
     }
 
     /// getAnalysisUsage - Does not modify anything.  It uses Value Numbering