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
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? Evan> > -Dave > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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
Seemingly Similar Threads
- [LLVMdev] Bug in LiveIntervals? Please Examine
- Ok with mismatch between dead-markings in BUNDLE and bundled instructions?
- [LLVMdev] Multi-class register allocatable only in one class
- [LLVMdev] [PATCH] Re: Pluggable Register Coalescers
- [LLVMdev] Pluggable Register Coalescers