From: Jakub Staszak Date: Wed, 14 Nov 2012 22:42:17 +0000 (+0000) Subject: Use reserve() to avoid vector reallocation. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8762a6bc2b83dfc11e784772311ad0b8fa5211e2;p=oota-llvm.git Use reserve() to avoid vector reallocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167991 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp index 7e662e5385b..df679752860 100644 --- a/lib/CodeGen/RegisterCoalescer.cpp +++ b/lib/CodeGen/RegisterCoalescer.cpp @@ -2068,6 +2068,7 @@ void RegisterCoalescer::joinAllIntervals() { assert(WorkList.empty() && LocalWorkList.empty() && "Old data still around."); std::vector MBBs; + MBBs.reserve(MF->size()); for (MachineFunction::iterator I = MF->begin(), E = MF->end();I != E;++I){ MachineBasicBlock *MBB = I; MBBs.push_back(MBBPriorityInfo(MBB, Loops->getLoopDepth(MBB),