From b1bf2009a41046e554b2ed90a73956e82c23e97d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 15 Aug 2009 01:39:28 +0000 Subject: [PATCH] switch DominanceFrontier::splitBlock to use a smallvector for the pred list instead of a vector, saving a boat load of malloc/free's. llvm-svn: 79062 --- llvm/lib/VMCore/Dominators.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp index 735a70c50927..9b6f5c2c946e 100644 --- a/llvm/lib/VMCore/Dominators.cpp +++ b/llvm/lib/VMCore/Dominators.cpp @@ -76,7 +76,7 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) { && "NewBB should have a single successor!"); BasicBlock *NewBBSucc = NewBB->getTerminator()->getSuccessor(0); - std::vector PredBlocks; + SmallVector PredBlocks; for (pred_iterator PI = pred_begin(NewBB), PE = pred_end(NewBB); PI != PE; ++PI) PredBlocks.push_back(*PI); @@ -153,7 +153,7 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) { // Verify whether this block dominates a block in predblocks. If not, do // not update it. bool BlockDominatesAny = false; - for (std::vector::const_iterator BI = PredBlocks.begin(), + for (SmallVectorImpl::const_iterator BI = PredBlocks.begin(), BE = PredBlocks.end(); BI != BE; ++BI) { if (DT.dominates(FI, *BI)) { BlockDominatesAny = true;