Lines Matching refs:Reg
182 void LiveVariables::HandleVirtRegDef(unsigned Reg, MachineInstr &MI) { in HandleVirtRegDef() argument
183 VarInfo &VRInfo = getVarInfo(Reg); in HandleVirtRegDef()
192 MachineInstr *LiveVariables::FindLastPartialDef(unsigned Reg, in FindLastPartialDef() argument
197 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in FindLastPartialDef()
219 if (TRI->isSubRegister(Reg, DefReg)) { in FindLastPartialDef()
231 void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr &MI) { in HandlePhysRegUse() argument
232 MachineInstr *LastDef = PhysRegDef[Reg]; in HandlePhysRegUse()
234 if (!LastDef && !PhysRegUse[Reg]) { in HandlePhysRegUse()
244 MachineInstr *LastPartialDef = FindLastPartialDef(Reg, PartDefRegs); in HandlePhysRegUse()
247 LastPartialDef->addOperand(MachineOperand::CreateReg(Reg, true/*IsDef*/, in HandlePhysRegUse()
249 PhysRegDef[Reg] = LastPartialDef; in HandlePhysRegUse()
251 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in HandlePhysRegUse()
267 } else if (LastDef && !PhysRegUse[Reg] && in HandlePhysRegUse()
268 !LastDef->findRegisterDefOperand(Reg)) in HandlePhysRegUse()
270 LastDef->addOperand(MachineOperand::CreateReg(Reg, true/*IsDef*/, in HandlePhysRegUse()
274 for (MCSubRegIterator SubRegs(Reg, TRI, /*IncludeSelf=*/true); in HandlePhysRegUse()
281 MachineInstr *LiveVariables::FindLastRefOrPartRef(unsigned Reg) { in FindLastRefOrPartRef() argument
282 MachineInstr *LastDef = PhysRegDef[Reg]; in FindLastRefOrPartRef()
283 MachineInstr *LastUse = PhysRegUse[Reg]; in FindLastRefOrPartRef()
290 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in FindLastRefOrPartRef()
311 bool LiveVariables::HandlePhysRegKill(unsigned Reg, MachineInstr *MI) { in HandlePhysRegKill() argument
312 MachineInstr *LastDef = PhysRegDef[Reg]; in HandlePhysRegKill()
313 MachineInstr *LastUse = PhysRegUse[Reg]; in HandlePhysRegKill()
339 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in HandlePhysRegKill()
364 if (!PhysRegUse[Reg]) { in HandlePhysRegKill()
369 PhysRegDef[Reg]->addRegisterDead(Reg, TRI, true); in HandlePhysRegKill()
370 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in HandlePhysRegKill()
375 if (PhysRegDef[Reg] == PhysRegDef[SubReg]) { in HandlePhysRegKill()
376 MachineOperand *MO = PhysRegDef[Reg]->findRegisterDefOperand(SubReg); in HandlePhysRegKill()
383 PhysRegDef[Reg]->addOperand(MachineOperand::CreateReg(SubReg, in HandlePhysRegKill()
397 } else if (LastRefOrPartRef == PhysRegDef[Reg] && LastRefOrPartRef != MI) { in HandlePhysRegKill()
400 LastPartDef->addOperand(MachineOperand::CreateReg(Reg, false/*IsDef*/, in HandlePhysRegKill()
404 LastRefOrPartRef->findRegisterDefOperand(Reg, false, TRI); in HandlePhysRegKill()
405 bool NeedEC = MO->isEarlyClobber() && MO->getReg() != Reg; in HandlePhysRegKill()
408 LastRefOrPartRef->addRegisterDead(Reg, TRI, true); in HandlePhysRegKill()
412 MO = LastRefOrPartRef->findRegisterDefOperand(Reg); in HandlePhysRegKill()
418 LastRefOrPartRef->addRegisterKilled(Reg, TRI, true); in HandlePhysRegKill()
426 for (unsigned Reg = 1, NumRegs = TRI->getNumRegs(); Reg != NumRegs; ++Reg) { in HandleRegMask() local
428 if (!PhysRegDef[Reg] && !PhysRegUse[Reg]) in HandleRegMask()
431 if (!MO.clobbersPhysReg(Reg)) in HandleRegMask()
435 unsigned Super = Reg; in HandleRegMask()
436 for (MCSuperRegIterator SR(Reg, TRI); SR.isValid(); ++SR) in HandleRegMask()
443 void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI, in HandlePhysRegDef() argument
447 if (PhysRegDef[Reg] || PhysRegUse[Reg]) { in HandlePhysRegDef()
448 for (MCSubRegIterator SubRegs(Reg, TRI, /*IncludeSelf=*/true); in HandlePhysRegDef()
452 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in HandlePhysRegDef()
472 HandlePhysRegKill(Reg, MI); in HandlePhysRegDef()
474 for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { in HandlePhysRegDef()
483 Defs.push_back(Reg); // Remember this def. in HandlePhysRegDef()
489 unsigned Reg = Defs.back(); in UpdatePhysRegDefs() local
491 for (MCSubRegIterator SubRegs(Reg, TRI, /*IncludeSelf=*/true); in UpdatePhysRegDefs()
658 const unsigned Reg = TargetRegisterInfo::index2VirtReg(i); in runOnMachineFunction() local
659 for (unsigned j = 0, e2 = VirtRegInfo[Reg].Kills.size(); j != e2; ++j) in runOnMachineFunction()
660 if (VirtRegInfo[Reg].Kills[j] == MRI->getVRegDef(Reg)) in runOnMachineFunction()
661 VirtRegInfo[Reg].Kills[j]->addRegisterDead(Reg, TRI); in runOnMachineFunction()
663 VirtRegInfo[Reg].Kills[j]->addRegisterKilled(Reg, TRI); in runOnMachineFunction()
683 void LiveVariables::replaceKillInstruction(unsigned Reg, MachineInstr &OldMI, in replaceKillInstruction() argument
685 VarInfo &VI = getVarInfo(Reg); in replaceKillInstruction()
696 unsigned Reg = MO.getReg(); in removeVirtualRegistersKilled() local
697 if (TargetRegisterInfo::isVirtualRegister(Reg)) { in removeVirtualRegistersKilled()
698 bool removed = getVarInfo(Reg).removeKill(MI); in removeVirtualRegistersKilled()
723 unsigned Reg, in isLiveIn() argument
732 const MachineInstr *Def = MRI.getVRegDef(Reg); in isLiveIn()
740 bool LiveVariables::isLiveOut(unsigned Reg, const MachineBasicBlock &MBB) { in isLiveOut() argument
741 LiveVariables::VarInfo &VI = getVarInfo(Reg); in isLiveOut()
798 unsigned Reg = TargetRegisterInfo::index2VirtReg(i); in addNewBlock() local
801 if (Defs.count(Reg)) in addNewBlock()
806 VarInfo &VI = getVarInfo(Reg); in addNewBlock()
807 if (Kills.count(Reg) || VI.AliveBlocks.test(SuccBB->getNumber())) in addNewBlock()