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

Chris Lattner sabre at nondot.org
Sat Dec 6 17:21:14 PST 2008


Author: lattner
Date: Sat Dec  6 19:21:14 2008
New Revision: 60647

URL: http://llvm.org/viewvc/llvm-project?rev=60647&view=rev
Log:
make clients have to know how to call getCallSiteDependencyFrom
instead of making getDependencyFrom do it.

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=60647&r1=60646&r2=60647&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Sat Dec  6 19:21:14 2008
@@ -139,6 +139,7 @@
     // FreeInsts erase the entire structure, not just a field.
     MemSize = ~0UL;
   } else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) {
+    assert(0 && "Should use getCallSiteDependencyFrom!");
     return getCallSiteDependencyFrom(CallSite::get(QueryInst), ScanIt, BB);
   } else {
     // Otherwise, this is a vaarg or non-memory instruction, just return a
@@ -233,7 +234,11 @@
   }
   
   // Do the scan.
-  LocalCache = getDependencyFrom(QueryInst, ScanPos, QueryInst->getParent());
+  if (!isa<CallInst>(QueryInst) && !isa<InvokeInst>(QueryInst))
+    LocalCache = getDependencyFrom(QueryInst, ScanPos, QueryInst->getParent());
+  else 
+    LocalCache = getCallSiteDependencyFrom(CallSite::get(QueryInst), ScanPos,
+                                           QueryInst->getParent());
   
   // Remember the result!
   if (Instruction *I = LocalCache.getInst())
@@ -341,7 +346,12 @@
     }
     
     // Find out if this block has a local dependency for QueryInst.
-    MemDepResult Dep = getDependencyFrom(QueryInst, ScanPos, DirtyBB);
+    MemDepResult Dep;
+    if (!isa<CallInst>(QueryInst) && !isa<InvokeInst>(QueryInst))
+      Dep = getDependencyFrom(QueryInst, ScanPos, DirtyBB);
+    else 
+      Dep = getCallSiteDependencyFrom(CallSite::get(QueryInst), ScanPos,
+                                      DirtyBB);
     
     // If we had a dirty entry for the block, update it.  Otherwise, just add
     // a new entry.
@@ -368,6 +378,7 @@
   return Cache;
 }
 
+
 /// removeInstruction - Remove an instruction from the dependence analysis,
 /// updating the dependence of instructions that previously depended on it.
 /// This method attempts to keep the cache coherent using the reverse map.





More information about the llvm-commits mailing list