Lines Matching refs:PhysReg

74       unsigned PhysReg;         // Currently held here.  member
78 LiveReg(unsigned p=0) : LastUse(0), PhysReg(p), LastOpNum(0), in LiveReg()
160 void definePhysReg(MachineInstr *MI, unsigned PhysReg, RegState NewState);
161 unsigned calcSpillCost(unsigned PhysReg) const;
162 void assignVirtToPhysReg(LiveRegEntry &LRE, unsigned PhysReg);
169 bool setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg);
216 if (MO.getReg() == LR.PhysReg) in addKillFlag()
219 LR.LastUse->addRegisterKilled(LR.PhysReg, TRI, true); in addKillFlag()
227 assert(PhysRegState[LR.PhysReg] == LRI->first && "Broken RegState mapping"); in killVirtReg()
228 PhysRegState[LR.PhysReg] = regFree; in killVirtReg()
257 assert(PhysRegState[LR.PhysReg] == LRI->first && "Broken RegState mapping"); in spillVirtReg()
265 << " in " << PrintReg(LR.PhysReg, TRI)); in spillVirtReg()
269 TII->storeRegToStackSlot(*MBB, MI, LR.PhysReg, SpillKill, FI, RC, TRI); in spillVirtReg()
325 unsigned PhysReg = MO.getReg(); in usePhysReg() local
326 assert(TargetRegisterInfo::isPhysicalRegister(PhysReg) && in usePhysReg()
329 switch (PhysRegState[PhysReg]) { in usePhysReg()
333 PhysRegState[PhysReg] = regFree; in usePhysReg()
336 UsedInInstr.set(PhysReg); in usePhysReg()
346 for (const unsigned *AS = TRI->getAliasSet(PhysReg); in usePhysReg()
352 assert(TRI->isSuperRegister(PhysReg, Alias) && in usePhysReg()
360 if (TRI->isSuperRegister(PhysReg, Alias)) { in usePhysReg()
375 PhysRegState[PhysReg] = regFree; in usePhysReg()
376 UsedInInstr.set(PhysReg); in usePhysReg()
383 void RAFast::definePhysReg(MachineInstr *MI, unsigned PhysReg, in definePhysReg() argument
385 UsedInInstr.set(PhysReg); in definePhysReg()
386 switch (unsigned VirtReg = PhysRegState[PhysReg]) { in definePhysReg()
394 PhysRegState[PhysReg] = NewState; in definePhysReg()
399 PhysRegState[PhysReg] = NewState; in definePhysReg()
400 for (const unsigned *AS = TRI->getAliasSet(PhysReg); in definePhysReg()
411 if (TRI->isSuperRegister(PhysReg, Alias)) in definePhysReg()
424 unsigned RAFast::calcSpillCost(unsigned PhysReg) const { in calcSpillCost()
425 if (UsedInInstr.test(PhysReg)) { in calcSpillCost()
426 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << " is already used in instr.\n"); in calcSpillCost()
429 switch (unsigned VirtReg = PhysRegState[PhysReg]) { in calcSpillCost()
436 << PrintReg(PhysReg, TRI) << " is reserved already.\n"); in calcSpillCost()
443 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << " is disabled.\n"); in calcSpillCost()
445 for (const unsigned *AS = TRI->getAliasSet(PhysReg); in calcSpillCost()
470 void RAFast::assignVirtToPhysReg(LiveRegEntry &LRE, unsigned PhysReg) { in assignVirtToPhysReg() argument
472 << PrintReg(PhysReg, TRI) << "\n"); in assignVirtToPhysReg()
473 PhysRegState[PhysReg] = LRE.first; in assignVirtToPhysReg()
474 assert(!LRE.second.PhysReg && "Already assigned a physreg"); in assignVirtToPhysReg()
475 LRE.second.PhysReg = PhysReg; in assignVirtToPhysReg()
507 unsigned PhysReg = *I; in allocVirtReg() local
508 if (PhysRegState[PhysReg] == regFree && !UsedInInstr.test(PhysReg)) in allocVirtReg()
509 return assignVirtToPhysReg(LRE, PhysReg); in allocVirtReg()
565 assert(LR.PhysReg && "Register not assigned"); in defineVirtReg()
569 UsedInInstr.set(LR.PhysReg); in defineVirtReg()
589 << PrintReg(LR.PhysReg, TRI) << "\n"); in reloadVirtReg()
590 TII->loadRegFromStackSlot(*MBB, MI, LR.PhysReg, FrameIndex, RC, TRI); in reloadVirtReg()
617 assert(LR.PhysReg && "Register not assigned"); in reloadVirtReg()
620 UsedInInstr.set(LR.PhysReg); in reloadVirtReg()
627 bool RAFast::setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg) { in setPhysReg() argument
630 MO.setReg(PhysReg); in setPhysReg()
635 MO.setReg(PhysReg ? TRI->getSubReg(PhysReg, MO.getSubReg()) : 0); in setPhysReg()
641 MI->addRegisterKilled(PhysReg, TRI, true); in setPhysReg()
697 unsigned PhysReg = LRI->second.PhysReg; in handleThroughOperands() local
698 setPhysReg(MI, i, PhysReg); in handleThroughOperands()
706 PartialDefs.push_back(LRI->second.PhysReg); in handleThroughOperands()
710 unsigned PhysReg = LRI->second.PhysReg; in handleThroughOperands() local
711 if (setPhysReg(MI, i, PhysReg)) in handleThroughOperands()
790 assert(LiveVirtRegs[PhysRegState[Reg]].PhysReg == Reg && in AllocateBasicBlock()
801 assert(TargetRegisterInfo::isPhysicalRegister(i->second.PhysReg) && in AllocateBasicBlock()
803 assert(PhysRegState[i->second.PhysReg] == i->first && in AllocateBasicBlock()
821 setPhysReg(MI, i, LRI->second.PhysReg); in AllocateBasicBlock()
935 unsigned PhysReg = LRI->second.PhysReg; in AllocateBasicBlock() local
936 CopySrc = (CopySrc == Reg || CopySrc == PhysReg) ? PhysReg : 0; in AllocateBasicBlock()
937 if (setPhysReg(MI, i, PhysReg)) in AllocateBasicBlock()
991 unsigned PhysReg = LRI->second.PhysReg; in AllocateBasicBlock() local
992 if (setPhysReg(MI, i, PhysReg)) { in AllocateBasicBlock()
996 CopyDst = (CopyDst == Reg || CopyDst == PhysReg) ? PhysReg : 0; in AllocateBasicBlock()