diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-30 02:28:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-30 02:28:25 +0000 |
commit | f68f310386c8e1772a3e6eba01f09590678a8f96 (patch) | |
tree | 067cad80ba33ff63a5874909f75a46ef22df92ce /include/llvm/Analysis/MemoryDependenceAnalysis.h | |
parent | cfbb634225007b2eddfbfcbf2adff2291b9c03bd (diff) | |
download | external_llvm-f68f310386c8e1772a3e6eba01f09590678a8f96.zip external_llvm-f68f310386c8e1772a3e6eba01f09590678a8f96.tar.gz external_llvm-f68f310386c8e1772a3e6eba01f09590678a8f96.tar.bz2 |
Change NonLocalDeps to be a densemap of pointers to densemap
instead of containing them by value. This increases the density
(!) of NonLocalDeps as well as making the reallocation case
faster. This speeds up gvn on 403.gcc by 2% and makes room for
future improvements.
I'm not super thrilled with having to explicitly manage the new/delete
of the map, but it is necesary for the next change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h')
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index fa45718..01a7317 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -111,9 +111,9 @@ namespace llvm { Normal, /// None - This dependence type indicates that the query does not depend - /// on any instructions, either because it scanned to the start of the - /// function or it scanned to the definition of the memory - /// (alloca/malloc). + /// on any instructions, either because it is not a memory instruction or + /// because it scanned to the definition of the memory (alloca/malloc) + /// being accessed. None, /// NonLocal - This marker indicates that the query has no dependency in @@ -128,9 +128,9 @@ namespace llvm { LocalDepMapType LocalDeps; // A map from instructions to their non-local dependencies. - // FIXME: DENSEMAP of DENSEMAP not a great idea. typedef DenseMap<Instruction*, - DenseMap<BasicBlock*, DepResultTy> > NonLocalDepMapType; + // This is an owning pointer. + DenseMap<BasicBlock*, DepResultTy>*> NonLocalDepMapType; NonLocalDepMapType NonLocalDeps; // A reverse mapping from dependencies to the dependees. This is @@ -153,6 +153,9 @@ namespace llvm { /// Clean up memory in between runs void releaseMemory() { LocalDeps.clear(); + for (NonLocalDepMapType::iterator I = NonLocalDeps.begin(), + E = NonLocalDeps.end(); I != E; ++I) + delete I->second; NonLocalDeps.clear(); ReverseLocalDeps.clear(); ReverseNonLocalDeps.clear(); |