From 179463c0d4c20bfb2c6b1e697eed6f16305a201e Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 8 Aug 2007 21:53:20 +0000 Subject: [PATCH] Cleanup and comment-ize the memdep header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40948 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../llvm/Analysis/MemoryDependenceAnalysis.h | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index 2abb6e62db9..409c10b01d5 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -31,23 +31,24 @@ class Instruction; class MemoryDependenceAnalysis : public FunctionPass { private: - + // A map from instructions to their dependency, with a boolean + // flags for whether this mapping is confirmed or not typedef DenseMap > - depMapType; - + depMapType; depMapType depGraphLocal; - typedef DenseMap > reverseDepMapType; + // A reverse mapping form dependencies to the dependees. This is + // used when removing instructions to keep the cache coherent. + typedef DenseMap > + reverseDepMapType; reverseDepMapType reverseDep; - - const Instruction* getCallSiteDependency(CallSite C, Instruction* start, - BasicBlock* block); - void nonLocalHelper(Instruction* query, BasicBlock* block, - DenseMap& resp); - public: + public: + // Special marker indicating that the query has no dependency + // in the specified block. static const Instruction* NonLocal; + + // Special marker indicating that the query has no dependency at all static const Instruction* None; static char ID; // Class identification, replacement for typeinfo @@ -79,6 +80,12 @@ class MemoryDependenceAnalysis : public FunctionPass { /// removeInstruction - Remove an instruction from the dependence analysis, /// updating the dependence of instructions that previously depended on it. void removeInstruction(Instruction* rem); + + private: + const Instruction* getCallSiteDependency(CallSite C, Instruction* start, + BasicBlock* block); + void nonLocalHelper(Instruction* query, BasicBlock* block, + DenseMap& resp); }; } // End llvm namespace -- 2.34.1