Use reserve() to avoid vector reallocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167991 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakub Staszak 2012-11-14 22:42:17 +00:00
parent 0e52f46e48
commit 8762a6bc2b

View File

@ -2068,6 +2068,7 @@ void RegisterCoalescer::joinAllIntervals() {
assert(WorkList.empty() && LocalWorkList.empty() && "Old data still around.");
std::vector<MBBPriorityInfo> 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),