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
This commit is contained in:
Chris Lattner 2008-03-21 21:33:23 +00:00
parent 88365bb404
commit 2e60701b9d

View File

@ -1287,6 +1287,7 @@ 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()),
@ -1294,7 +1295,7 @@ bool GVN::iterateOnFunction(Function &F) {
// Get the set to update for this block
ValueNumberedSet& currAvail = availableOut[DI->getBlock()];
DenseMap<Value*, LoadInst*> lastSeenLoad;
lastSeenLoad.clear();
BasicBlock* BB = DI->getBlock();