REmove an old fixme, resolve another fixme by adding liberal
authorChris Lattner <sabre@nondot.org>
Sun, 30 Nov 2008 01:17:08 +0000 (01:17 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 30 Nov 2008 01:17:08 +0000 (01:17 +0000)
comments about what this class does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60264 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/MemoryDependenceAnalysis.h
lib/Analysis/MemoryDependenceAnalysis.cpp

index b3c12c1d8562f90d690c8703cedc009321f62232..00dcaf508c13deb89ede8b630d36d3139b343ee7 100644 (file)
@@ -80,6 +80,17 @@ namespace llvm {
   /// 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 @@ namespace llvm {
     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
index ef4440fbe767d4395a710d27772224f3c6a5c7b0..45ca83ab58fc9dbd891639b98b9be2a5228b1185 100644 (file)
@@ -153,7 +153,6 @@ getNonLocalDependency(Instruction *QueryInst,
     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 @@ getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt,
 
     // 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());