[llvm-commits] [llvm] r167991 - /llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
Jakub Staszak
kubastaszak at gmail.com
Wed Nov 14 14:42:17 PST 2012
Author: kuba
Date: Wed Nov 14 16:42:17 2012
New Revision: 167991
URL: http://llvm.org/viewvc/llvm-project?rev=167991&view=rev
Log:
Use reserve() to avoid vector reallocation.
Modified:
llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=167991&r1=167990&r2=167991&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Wed Nov 14 16:42:17 2012
@@ -2068,6 +2068,7 @@
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),
More information about the llvm-commits
mailing list