diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-09 07:31:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-09 07:31:04 +0000 |
commit | dad451cb7c6b94b3af40f59271e24357616a05a9 (patch) | |
tree | fcc0ac3dd4a24324001cd68a8765c6311860b2db /include/llvm/Analysis/MemoryDependenceAnalysis.h | |
parent | 022840e9608207305a2e0488763f06fb1b5ad5e5 (diff) | |
download | external_llvm-dad451cb7c6b94b3af40f59271e24357616a05a9.zip external_llvm-dad451cb7c6b94b3af40f59271e24357616a05a9.tar.gz external_llvm-dad451cb7c6b94b3af40f59271e24357616a05a9.tar.bz2 |
enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h')
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index 34a4a17..c04631b 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -16,6 +16,7 @@ #include "llvm/BasicBlock.h" #include "llvm/Pass.h" +#include "llvm/Support/ValueHandle.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/OwningPtr.h" @@ -133,20 +134,38 @@ namespace llvm { /// NonLocalDepEntry - This is an entry in the NonLocalDepInfo cache, and an /// entry in the results set for a non-local query. For each BasicBlock (the - /// BB entry) it keeps a MemDepResult. + /// BB entry) it keeps a MemDepResult and the (potentially phi translated) + /// address that was live in the block. class NonLocalDepEntry { BasicBlock *BB; MemDepResult Result; + WeakVH Address; public: - NonLocalDepEntry(BasicBlock *bb, MemDepResult result) - : BB(bb), Result(result) {} - + NonLocalDepEntry(BasicBlock *bb, MemDepResult result, Value *address) + : BB(bb), Result(result), Address(address) {} + + // This is used for searches. + NonLocalDepEntry(BasicBlock *bb) : BB(bb) {} + // BB is the sort key, it can't be changed. BasicBlock *getBB() const { return BB; } + void setResult(const MemDepResult &R, Value *Addr) { + Result = R; + Address = Addr; + } + const MemDepResult &getResult() const { return Result; } - void setResult(const MemDepResult &R) { Result = R; } + /// getAddress - Return the address of this pointer in this block. This can + /// be different than the address queried for the non-local result because + /// of phi translation. This returns null if the address was not available + /// in a block (i.e. because phi translation failed) or if this is a cached + /// result and that address was deleted. + /// + /// The address is always null for a non-local 'call' dependence. + Value *getAddress() const { return Address; } + bool operator<(const NonLocalDepEntry &RHS) const { return BB < RHS.BB; } |