REmove an old fixme, resolve another fixme by adding liberal

comments about what this class does.

llvm-svn: 60264
This commit is contained in:
Chris Lattner 2008-11-30 01:17:08 +00:00
parent ada1f87988
commit 3d5d5f2c6d
2 changed files with 12 additions and 3 deletions

View File

@ -80,6 +80,17 @@ namespace llvm {
/// given memory operation, what preceding memory operations it depends on. /// given memory operation, what preceding memory operations it depends on.
/// It builds on alias analysis information, and tries to provide a lazy, /// It builds on alias analysis information, and tries to provide a lazy,
/// caching interface to a common kind of alias information query. /// 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 { class MemoryDependenceAnalysis : public FunctionPass {
/// DepType - This enum is used to indicate what flavor of dependence this /// DepType - This enum is used to indicate what flavor of dependence this
/// is. If the type is Normal, there is an associated instruction pointer. /// is. If the type is Normal, there is an associated instruction pointer.
@ -153,7 +164,7 @@ namespace llvm {
virtual void getAnalysisUsage(AnalysisUsage &AU) const; virtual void getAnalysisUsage(AnalysisUsage &AU) const;
/// getDependency - Return the instruction on which a memory operation /// getDependency - Return the instruction on which a memory operation
/// depends. /// depends. See the class comment for more details.
MemDepResult getDependency(Instruction *QueryInst); MemDepResult getDependency(Instruction *QueryInst);
/// getDependencyFrom - Return the instruction on which the memory operation /// getDependencyFrom - Return the instruction on which the memory operation

View File

@ -153,7 +153,6 @@ getNonLocalDependency(Instruction *QueryInst,
if (DirtyBBEntry.getInt() != Dirty) continue; if (DirtyBBEntry.getInt() != Dirty) continue;
// Find out if this block has a local dependency for QueryInst. // 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. // 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 // 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 // MemDep is broken w.r.t. loads: it says that two loads of the same pointer
// depend on each other. :( // depend on each other. :(
// FIXME: ELIMINATE THIS!
if (LoadInst *L = dyn_cast<LoadInst>(Inst)) { if (LoadInst *L = dyn_cast<LoadInst>(Inst)) {
Value *Pointer = L->getPointerOperand(); Value *Pointer = L->getPointerOperand();
uint64_t PointerSize = TD.getTypeStoreSize(L->getType()); uint64_t PointerSize = TD.getTypeStoreSize(L->getType());