Add a flag to mark a dirty cache entry. This is not yet used, but will eventually
[oota-llvm.git] / include / llvm / Analysis / MemoryDependenceAnalysis.h
index 0b8dec8310501aa4ea418db611be4178a7cf2ee6..733e702506eed3b52e17369a891e956f9b6c5859 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.
@@ -51,6 +59,10 @@ class MemoryDependenceAnalysis : public FunctionPass {
     // Special marker indicating that the query has no dependency at all
     static Instruction* const None;
     
+    
+    // Special marker indicating a dirty cache entry
+    static Instruction* const Dirty;
+    
     static char ID; // Class identification, replacement for typeinfo
     MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {}
 
@@ -61,7 +73,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