switch DominanceFrontier::splitBlock to use a smallvector for

the pred list instead of a vector, saving a boat load of malloc/free's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79062 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-08-15 01:39:28 +00:00
parent d6708eade0
commit 20e8d5a8cc

View File

@ -76,7 +76,7 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) {
&& "NewBB should have a single successor!");
BasicBlock *NewBBSucc = NewBB->getTerminator()->getSuccessor(0);
std::vector<BasicBlock*> PredBlocks;
SmallVector<BasicBlock*, 8> 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<BasicBlock*>::const_iterator BI = PredBlocks.begin(),
for (SmallVectorImpl<BasicBlock*>::const_iterator BI = PredBlocks.begin(),
BE = PredBlocks.end(); BI != BE; ++BI) {
if (DT.dominates(FI, *BI)) {
BlockDominatesAny = true;