diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-12-22 04:25:02 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-12-22 04:25:02 +0000 |
| commit | 9b7d99eb76f6e72b7f08e0a66c16f4f0a1b00e60 (patch) | |
| tree | 0297452e18d61e038080a2202b2c9a32706a0659 /llvm/include | |
| parent | e2808379b8ac8735bca773a346f6552ce45d4ec4 (diff) | |
| download | bcm5719-llvm-9b7d99eb76f6e72b7f08e0a66c16f4f0a1b00e60.tar.gz bcm5719-llvm-9b7d99eb76f6e72b7f08e0a66c16f4f0a1b00e60.zip | |
The phi translated pointer can be computed when returning a partially cached result
instead of stored. This reduces memdep memory usage, and also eliminates a bunch of
weakvh's. This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x)
on a different machine than earlier.
llvm-svn: 91885
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h index c04631b2a1c..f83cc4f710e 100644 --- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -132,21 +132,17 @@ 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 and the (potentially phi translated) - /// address that was live in the block. - class NonLocalDepEntry { + /// NonLocalDepResult - This is a result from a NonLocal dependence query. + /// For each BasicBlock (the BB entry) it keeps a MemDepResult and the + /// (potentially phi translated) address that was live in the block. + class NonLocalDepResult { BasicBlock *BB; MemDepResult Result; - WeakVH Address; + Value *Address; public: - NonLocalDepEntry(BasicBlock *bb, MemDepResult result, Value *address) + NonLocalDepResult(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; } @@ -154,7 +150,7 @@ namespace llvm { Result = R; Address = Addr; } - + const MemDepResult &getResult() const { return Result; } /// getAddress - Return the address of this pointer in this block. This can @@ -165,7 +161,27 @@ namespace llvm { /// /// The address is always null for a non-local 'call' dependence. Value *getAddress() const { return Address; } + }; + + /// NonLocalDepEntry - This is an entry in the NonLocalDepInfo cache. For + /// each BasicBlock (the BB entry) it keeps a MemDepResult. + class NonLocalDepEntry { + BasicBlock *BB; + MemDepResult Result; + public: + NonLocalDepEntry(BasicBlock *bb, MemDepResult result) + : BB(bb), Result(result) {} + + // 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) { Result = R; } + + const MemDepResult &getResult() const { return Result; } + bool operator<(const NonLocalDepEntry &RHS) const { return BB < RHS.BB; } @@ -283,7 +299,7 @@ namespace llvm { /// This method assumes the pointer has a "NonLocal" dependency within BB. void getNonLocalPointerDependency(Value *Pointer, bool isLoad, BasicBlock *BB, - SmallVectorImpl<NonLocalDepEntry> &Result); + SmallVectorImpl<NonLocalDepResult> &Result); /// removeInstruction - Remove an instruction from the dependence analysis, /// updating the dependence of instructions that previously depended on it. @@ -307,7 +323,7 @@ namespace llvm { BasicBlock *BB); bool getNonLocalPointerDepFromBB(const PHITransAddr &Pointer, uint64_t Size, bool isLoad, BasicBlock *BB, - SmallVectorImpl<NonLocalDepEntry> &Result, + SmallVectorImpl<NonLocalDepResult> &Result, DenseMap<BasicBlock*, Value*> &Visited, bool SkipFirstBlock = false); MemDepResult GetNonLocalInfoForBlock(Value *Pointer, uint64_t PointeeSize, |

