Bug in LiveIntervals? Please Examine

In LiveIntervals::processImplicitDefs() we have this:

      for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(Reg),
             UE = mri_->use_end(); UI != UE; ) {
        MachineOperand &RMO = UI.getOperand();
        MachineInstr *RMI = &*UI;
        ++UI;
        MachineBasicBlock *RMBB = RMI->getParent();
        if (RMBB == MBB)
          continue;
        const TargetRegisterClass* RC = mri_->getRegClass(Reg);
        unsigned NewVReg = mri_->createVirtualRegister(RC);
        MachineInstrBuilder MIB =
          BuildMI(*RMBB, RMI, RMI->getDebugLoc(),
                  tii_->get(TargetInstrInfo::IMPLICIT_DEF), NewVReg);
        (*MIB).getOperand(0).setIsUndef();
        RMO.setReg(NewVReg);
        RMO.setIsUndef();
        RMO.setIsKill();
      }

Souldn't there be a call to vrm.grow() after each call to
mri->createVirtualRegister()?

                            -Dave

In LiveIntervals::processImplicitDefs() we have this:

     for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(Reg),
            UE = mri_->use_end(); UI != UE; ) {
       MachineOperand &RMO = UI.getOperand();
       MachineInstr *RMI = &*UI;
       ++UI;
       MachineBasicBlock *RMBB = RMI->getParent();
       if (RMBB == MBB)
         continue;
       const TargetRegisterClass* RC = mri_->getRegClass(Reg);
       unsigned NewVReg = mri_->createVirtualRegister(RC);
       MachineInstrBuilder MIB =
         BuildMI(*RMBB, RMI, RMI->getDebugLoc(),
                 tii_->get(TargetInstrInfo::IMPLICIT_DEF), NewVReg);
       (*MIB).getOperand(0).setIsUndef();
       RMO.setReg(NewVReg);
       RMO.setIsUndef();
       RMO.setIsKill();
     }

Souldn't there be a call to vrm.grow() after each call to
mri->createVirtualRegister()?

No. This function is run during the analysis stage. vrm is actually owned by the register allocator which then passed it into liveintervals. Is there an actual problem that you run into?

Evan

No, I was just examining some bugfixes we've made here. Looks like
all the places we found missing vrm.grow() have them now. I just
diodn't know about this one. Thanks.

                              -Dave