Change ScheduleDAGInstrs::Defs and ::Uses to be variable-size vectors
authorBob Wilson <bob.wilson@apple.com>
Sat, 24 Jul 2010 06:01:53 +0000 (06:01 +0000)
committerBob Wilson <bob.wilson@apple.com>
Sat, 24 Jul 2010 06:01:53 +0000 (06:01 +0000)
instead of fixed size arrays, so that increasing FirstVirtualRegister to 16K
won't cause a compile time performance regression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109330 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAGInstrs.cpp
lib/CodeGen/ScheduleDAGInstrs.h

index 40670da56e10e3b1aed61b7c93ac04c58361e791..ea93dd5c66633c135a224b592deada04ed3dfb0b 100644 (file)
@@ -32,7 +32,8 @@ using namespace llvm;
 ScheduleDAGInstrs::ScheduleDAGInstrs(MachineFunction &mf,
                                      const MachineLoopInfo &mli,
                                      const MachineDominatorTree &mdt)
-  : ScheduleDAG(mf), MLI(mli), MDT(mdt), LoopRegs(MLI, MDT) {
+  : ScheduleDAG(mf), MLI(mli), MDT(mdt), Defs(TRI->getNumRegs()),
+    Uses(TRI->getNumRegs()), LoopRegs(MLI, MDT) {
   MFI = mf.getFrameInfo();
   DbgValueVec.clear();
 }
index d90659bb163efd1e0f51449754e2e92c4b847b70..c8f543f7146dd97fe549b337277c6bf03e0d631d 100644 (file)
@@ -106,8 +106,8 @@ namespace llvm {
     /// are as we iterate upward through the instructions. This is allocated
     /// here instead of inside BuildSchedGraph to avoid the need for it to be
     /// initialized and destructed for each block.
-    std::vector<SUnit *> Defs[TargetRegisterInfo::FirstVirtualRegister];
-    std::vector<SUnit *> Uses[TargetRegisterInfo::FirstVirtualRegister];
+    std::vector<std::vector<SUnit *> > Defs;
+    std::vector<std::vector<SUnit *> > Uses;
  
     /// DbgValueVec - Remember DBG_VALUEs that refer to a particular
     /// register.