From ab0139cb907423ef6d7928ab293451bf60d6117a Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Wed, 14 Nov 2012 22:42:17 +0000 Subject: [PATCH] Use reserve() to avoid vector reallocation. llvm-svn: 167991 --- llvm/lib/CodeGen/RegisterCoalescer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index 7e662e5..df67975 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/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), -- 2.7.4