Lines Matching refs:Reg
178 void LiveVariables::HandleVirtRegDef(unsigned Reg, MachineInstr *MI) { in HandleVirtRegDef() argument
179 VarInfo &VRInfo = getVarInfo(Reg); in HandleVirtRegDef()
188 MachineInstr *LiveVariables::FindLastPartialDef(unsigned Reg, in FindLastPartialDef() argument
193 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in FindLastPartialDef()
215 if (TRI->isSubRegister(Reg, DefReg)) { in FindLastPartialDef()
228 void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) { in HandlePhysRegUse() argument
229 MachineInstr *LastDef = PhysRegDef[Reg]; in HandlePhysRegUse()
231 if (!LastDef && !PhysRegUse[Reg]) { in HandlePhysRegUse()
241 MachineInstr *LastPartialDef = FindLastPartialDef(Reg, PartDefRegs); in HandlePhysRegUse()
244 LastPartialDef->addOperand(MachineOperand::CreateReg(Reg, true/*IsDef*/, in HandlePhysRegUse()
246 PhysRegDef[Reg] = LastPartialDef; in HandlePhysRegUse()
248 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in HandlePhysRegUse()
265 else if (LastDef && !PhysRegUse[Reg] && in HandlePhysRegUse()
266 !LastDef->findRegisterDefOperand(Reg)) in HandlePhysRegUse()
268 LastDef->addOperand(MachineOperand::CreateReg(Reg, in HandlePhysRegUse()
272 PhysRegUse[Reg] = MI; in HandlePhysRegUse()
273 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in HandlePhysRegUse()
280 MachineInstr *LiveVariables::FindLastRefOrPartRef(unsigned Reg) { in FindLastRefOrPartRef() argument
281 MachineInstr *LastDef = PhysRegDef[Reg]; in FindLastRefOrPartRef()
282 MachineInstr *LastUse = PhysRegUse[Reg]; in FindLastRefOrPartRef()
289 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in FindLastRefOrPartRef()
310 bool LiveVariables::HandlePhysRegKill(unsigned Reg, MachineInstr *MI) { in HandlePhysRegKill() argument
311 MachineInstr *LastDef = PhysRegDef[Reg]; in HandlePhysRegKill()
312 MachineInstr *LastUse = PhysRegUse[Reg]; in HandlePhysRegKill()
338 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in HandlePhysRegKill()
363 if (!PhysRegUse[Reg]) { in HandlePhysRegKill()
368 PhysRegDef[Reg]->addRegisterDead(Reg, TRI, true); in HandlePhysRegKill()
369 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in HandlePhysRegKill()
374 if (PhysRegDef[Reg] == PhysRegDef[SubReg]) { in HandlePhysRegKill()
375 MachineOperand *MO = PhysRegDef[Reg]->findRegisterDefOperand(SubReg); in HandlePhysRegKill()
382 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()
422 void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI, in HandlePhysRegDef() argument
426 if (PhysRegDef[Reg] || PhysRegUse[Reg]) { in HandlePhysRegDef()
427 Live.insert(Reg); in HandlePhysRegDef()
428 for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS) in HandlePhysRegDef()
431 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in HandlePhysRegDef()
451 HandlePhysRegKill(Reg, MI); in HandlePhysRegDef()
453 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in HandlePhysRegDef()
462 Defs.push_back(Reg); // Remember this def. in HandlePhysRegDef()
468 unsigned Reg = Defs.back(); in UpdatePhysRegDefs() local
470 PhysRegDef[Reg] = MI; in UpdatePhysRegDefs()
471 PhysRegUse[Reg] = NULL; in UpdatePhysRegDefs()
472 for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); in UpdatePhysRegDefs()
623 const unsigned Reg = TargetRegisterInfo::index2VirtReg(i); in runOnMachineFunction() local
624 for (unsigned j = 0, e2 = VirtRegInfo[Reg].Kills.size(); j != e2; ++j) in runOnMachineFunction()
625 if (VirtRegInfo[Reg].Kills[j] == MRI->getVRegDef(Reg)) in runOnMachineFunction()
626 VirtRegInfo[Reg].Kills[j]->addRegisterDead(Reg, TRI); in runOnMachineFunction()
628 VirtRegInfo[Reg].Kills[j]->addRegisterKilled(Reg, TRI); in runOnMachineFunction()
648 void LiveVariables::replaceKillInstruction(unsigned Reg, MachineInstr *OldMI, in replaceKillInstruction() argument
650 VarInfo &VI = getVarInfo(Reg); in replaceKillInstruction()
661 unsigned Reg = MO.getReg(); in removeVirtualRegistersKilled() local
662 if (TargetRegisterInfo::isVirtualRegister(Reg)) { in removeVirtualRegistersKilled()
663 bool removed = getVarInfo(Reg).removeKill(MI); in removeVirtualRegistersKilled()
686 unsigned Reg, in isLiveIn() argument
695 const MachineInstr *Def = MRI.getVRegDef(Reg); in isLiveIn()
703 bool LiveVariables::isLiveOut(unsigned Reg, const MachineBasicBlock &MBB) { in isLiveOut() argument
704 LiveVariables::VarInfo &VI = getVarInfo(Reg); in isLiveOut()
765 unsigned Reg = TargetRegisterInfo::index2VirtReg(i); in addNewBlock() local
766 VarInfo &VI = getVarInfo(Reg); in addNewBlock()
767 if (!VI.AliveBlocks.test(NumNew) && VI.isLiveIn(*SuccBB, Reg, *MRI)) in addNewBlock()