diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-30 02:52:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-30 02:52:26 +0000 |
commit | 4a69bade2385022ca776edc22150f3b750cdf23c (patch) | |
tree | 3b4afca67a304f74bb722d84099c6f734d3fde67 /include/llvm/Analysis/MemoryDependenceAnalysis.h | |
parent | 56e6d644d0668cb5d644352c64fe1c357b254d58 (diff) |
Two changes: Make getDependency remove QueryInst for a dirty record's
ReverseLocalDeps when we update it. This fixes a regression test
failure from my last commit.
Second, for each non-local cached information structure, keep a bit that
indicates whether it is dirty or not. This saves us a scan over the whole
thing in the common case when it isn't dirty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h')
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index 66e2f429c9..2dcec1b974 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -129,11 +129,14 @@ namespace llvm { typedef DenseMap<BasicBlock*, DepResultTy> NonLocalDepInfo; + /// PerInstNLInfo - This is the instruction we keep for each cached access + /// that we have for an instruction. The pointer is an owning pointer and + /// the bool indicates whether we have any dirty bits in the set. + typedef PointerIntPair<NonLocalDepInfo*, 1, bool> PerInstNLInfo; // A map from instructions to their non-local dependencies. - typedef DenseMap<Instruction*, - // This is an owning pointer. - NonLocalDepInfo*> NonLocalDepMapType; + typedef DenseMap<Instruction*, PerInstNLInfo> NonLocalDepMapType; + NonLocalDepMapType NonLocalDeps; // A reverse mapping from dependencies to the dependees. This is @@ -158,7 +161,7 @@ namespace llvm { LocalDeps.clear(); for (NonLocalDepMapType::iterator I = NonLocalDeps.begin(), E = NonLocalDeps.end(); I != E; ++I) - delete I->second; + delete I->second.getPointer(); NonLocalDeps.clear(); ReverseLocalDeps.clear(); ReverseNonLocalDeps.clear(); |