diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-30 01:26:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-30 01:26:32 +0000 |
commit | 73ec3cdd7140aee6d2b9ac32bc2298254ff48c97 (patch) | |
tree | d62e13619bdcb7831ef4e51c432374236b3d0df6 /include/llvm/Analysis/MemoryDependenceAnalysis.h | |
parent | 37d041c25f6cac462efef0d614a67ef657aad11a (diff) |
implement a fixme by introducing a new getDependencyFromInternal
method that returns its result as a DepResultTy instead of as a
MemDepResult. This reduces conversion back and forth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h')
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index 00dcaf508c..fa45718758 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -170,8 +170,13 @@ namespace llvm { /// getDependencyFrom - Return the instruction on which the memory operation /// 'QueryInst' depends. This starts scanning from the instruction before /// the position indicated by ScanIt. + /// + /// Note that this method does no caching at all. You should use + /// getDependency where possible. MemDepResult getDependencyFrom(Instruction *QueryInst, - BasicBlock::iterator ScanIt, BasicBlock *BB); + BasicBlock::iterator ScanIt, BasicBlock *BB){ + return ConvToResult(getDependencyFromInternal(QueryInst, ScanIt, BB)); + } /// getNonLocalDependency - Perform a full dependency query for the @@ -190,15 +195,6 @@ namespace llvm { void removeInstruction(Instruction *InstToRemove); private: - DepResultTy ConvFromResult(MemDepResult R) { - if (Instruction *I = R.getInst()) - return DepResultTy(I, Normal); - if (R.isNonLocal()) - return DepResultTy(0, NonLocal); - assert(R.isNone() && "Unknown MemDepResult!"); - return DepResultTy(0, None); - } - MemDepResult ConvToResult(DepResultTy R) { if (R.getInt() == Normal) return MemDepResult::get(R.getPointer()); @@ -212,8 +208,13 @@ namespace llvm { /// in our internal data structures. void verifyRemoved(Instruction *Inst) const; - MemDepResult getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt, - BasicBlock *BB); + /// getDependencyFromInternal - Return the instruction on which the memory + /// operation 'QueryInst' depends. This starts scanning from the + /// instruction before the position indicated by ScanIt. + DepResultTy getDependencyFromInternal(Instruction *QueryInst, + BasicBlock::iterator ScanIt, BasicBlock *BB); + DepResultTy getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt, + BasicBlock *BB); }; } // End llvm namespace |