aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-21 21:33:23 +0000
committerChris Lattner <sabre@nondot.org>2008-03-21 21:33:23 +0000
commit2e60701b9d7ab5a0a8c68ed888665865554b6f4d (patch)
tree0e4c2e675131cd1d4a99141dd1aea40bcebc7b51 /lib
parent88365bb4047a91d42af2aa42839b21e701ea1b03 (diff)
make gvn marginally faster by reallocating the lastSeenLoad map for
each basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 077fa67e0b..eb91b5a043 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -1287,15 +1287,16 @@ bool GVN::iterateOnFunction(Function &F) {
DominatorTree &DT = getAnalysis<DominatorTree>();
SmallVector<Instruction*, 4> toErase;
-
+ DenseMap<Value*, LoadInst*> lastSeenLoad;
+
// Top-down walk of the dominator tree
for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
E = df_end(DT.getRootNode()); DI != E; ++DI) {
// Get the set to update for this block
ValueNumberedSet& currAvail = availableOut[DI->getBlock()];
- DenseMap<Value*, LoadInst*> lastSeenLoad;
-
+ lastSeenLoad.clear();
+
BasicBlock* BB = DI->getBlock();
// A block inherits AVAIL_OUT from its dominator