[llvm-commits] [llvm] r48660 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Chris Lattner
sabre at nondot.org
Fri Mar 21 14:33:23 PDT 2008
Author: lattner
Date: Fri Mar 21 16:33:23 2008
New Revision: 48660
URL: http://llvm.org/viewvc/llvm-project?rev=48660&view=rev
Log:
make gvn marginally faster by reallocating the lastSeenLoad map for
each basic block.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=48660&r1=48659&r2=48660&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Mar 21 16:33:23 2008
@@ -1287,15 +1287,16 @@
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
More information about the llvm-commits
mailing list