OSDN Git Service

Reserve a goodly amount of room for the vectors.
authorBill Wendling <isanbard@gmail.com>
Thu, 15 Jul 2010 19:41:20 +0000 (19:41 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 15 Jul 2010 19:41:20 +0000 (19:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108448 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AggressiveAntiDepBreaker.cpp

index 50e5ace..8482774 100644 (file)
@@ -42,6 +42,9 @@ DebugMod("agg-antidep-debugmod",
 AggressiveAntiDepState::AggressiveAntiDepState(const unsigned TargetRegs,
                                                MachineBasicBlock *BB) :
   NumTargetRegs(TargetRegs), GroupNodes(TargetRegs, 0) {
+  GroupNodeIndices.reserve(TargetRegs);
+  KillIndices.reserve(TargetRegs);
+  DefIndices.reserve(TargetRegs);
 
   const unsigned BBSize = BB->size();
   for (unsigned i = 0; i < NumTargetRegs; ++i) {
@@ -54,8 +57,7 @@ AggressiveAntiDepState::AggressiveAntiDepState(const unsigned TargetRegs,
   }
 }
 
-unsigned AggressiveAntiDepState::GetGroup(unsigned Reg)
-{
+unsigned AggressiveAntiDepState::GetGroup(unsigned Reg) {
   unsigned Node = GroupNodeIndices[Reg];
   while (GroupNodes[Node] != Node)
     Node = GroupNodes[Node];