[LLVMdev] Bug in LiveIntervals? Please Examine

David Greene dag at cray.com
Fri Jul 17 13:35:00 PDT 2009


On Friday 17 July 2009 14:00, Evan Cheng wrote:
> On Jul 17, 2009, at 7:57 AM, David Greene wrote:
> > 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?

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



More information about the llvm-dev mailing list