[llvm-commits] [llvm] r60264 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp

Chris Lattner sabre at nondot.org
Sat Nov 29 17:17:08 PST 2008


Author: lattner
Date: Sat Nov 29 19:17:08 2008
New Revision: 60264

URL: http://llvm.org/viewvc/llvm-project?rev=60264&view=rev
Log:
REmove an old fixme, resolve another fixme by adding liberal
comments about what this class does.

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

Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=60264&r1=60263&r2=60264&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Sat Nov 29 19:17:08 2008
@@ -80,6 +80,17 @@
   /// given memory operation, what preceding memory operations it depends on.
   /// It builds on alias analysis information, and tries to provide a lazy,
   /// caching interface to a common kind of alias information query.
+  ///
+  /// The dependency information returned is somewhat unusual, but is pragmatic.
+  /// If queried about a store or call that might modify memory, the analysis
+  /// will return the instruction[s] that may either load from that memory or
+  /// store to it.  If queried with a load or call that can never modify memory,
+  /// the analysis will return calls and stores that might modify the pointer,
+  /// but generally does not return loads unless a) they are volatile, or
+  /// b) they load from *must-aliased* pointers.  Returning a dependence on
+  /// must-alias'd pointers instead of all pointers interacts well with the
+  /// internal caching mechanism.
+  ///
   class MemoryDependenceAnalysis : public FunctionPass {
     /// DepType - This enum is used to indicate what flavor of dependence this
     /// is.  If the type is Normal, there is an associated instruction pointer.
@@ -153,7 +164,7 @@
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
     
     /// getDependency - Return the instruction on which a memory operation
-    /// depends.
+    /// depends.  See the class comment for more details.
     MemDepResult getDependency(Instruction *QueryInst);
 
     /// getDependencyFrom - Return the instruction on which the memory operation

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

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Sat Nov 29 19:17:08 2008
@@ -153,7 +153,6 @@
     if (DirtyBBEntry.getInt() != Dirty) continue;
 
     // Find out if this block has a local dependency for QueryInst.
-    // FIXME: If the dirty entry has an instruction pointer, scan from it!
     // FIXME: Don't convert back and forth for MemDepResult <-> DepResultTy.
     
     // If the dirty entry has a pointer, start scanning from it so we don't have
@@ -234,7 +233,6 @@
 
     // MemDep is broken w.r.t. loads: it says that two loads of the same pointer
     // depend on each other.  :(
-    // FIXME: ELIMINATE THIS!
     if (LoadInst *L = dyn_cast<LoadInst>(Inst)) {
       Value *Pointer = L->getPointerOperand();
       uint64_t PointerSize = TD.getTypeStoreSize(L->getType());





More information about the llvm-commits mailing list