15 #define DEBUG_TYPE "regalloc"
38 STATISTIC(NumNewQueued ,
"Number of new live ranges queued");
44 cl::desc(
"Verify during register allocation"));
54 void RegAllocBase::anchor() {}
71 void RegAllocBase::seedLiveRegs() {
88 assert(!
VRM->
hasPhys(VirtReg->reg) &&
"Register already assigned");
92 DEBUG(
dbgs() <<
"Dropping unused " << *VirtReg <<
'\n');
105 <<
':' << *VirtReg <<
'\n');
107 VirtRegVec SplitVRegs;
108 unsigned AvailablePhysReg =
selectOrSplit(*VirtReg, SplitVRegs);
110 if (AvailablePhysReg == ~0u) {
115 (MI =
I.skipInstruction());)
119 MI->
emitError(
"inline assembly requires more registers than available");
128 if (AvailablePhysReg)
131 for (VirtRegVec::iterator
I = SplitVRegs.begin(), E = SplitVRegs.end();
134 assert(!
VRM->
hasPhys(SplitVirtReg->
reg) &&
"Register already assigned");
136 DEBUG(
dbgs() <<
"not queueing unused " << *SplitVirtReg <<
'\n');
140 DEBUG(
dbgs() <<
"queuing new interval: " << *SplitVirtReg <<
"\n");
142 "expect split value in virtual register");
bool hasPhys(unsigned virtReg) const
returns true if the specified virtual register is mapped to a physical register
MachineFunction & getMachineFunction() const
static unsigned index2VirtReg(unsigned Index)
static bool isVirtualRegister(unsigned Reg)
virtual unsigned selectOrSplit(LiveInterval &VirtReg, SmallVectorImpl< unsigned > &splitLVRs)=0
void assignVirt2Phys(unsigned virtReg, unsigned physReg)
creates a mapping for the specified virtual register to the specified physical register ...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
unsigned getNumVirtRegs() const
STATISTIC(NumNewQueued,"Number of new live ranges queued")
const char * getName() const
const TargetRegisterClass * getRegClass(unsigned Reg) const
void freezeReservedRegs(const MachineFunction &)
ArrayRef< MCPhysReg > getOrder(const TargetRegisterClass *RC) const
void assign(LiveInterval &VirtReg, unsigned PhysReg)
void invalidateVirtRegs()
void removeInterval(unsigned Reg)
const TargetRegisterInfo & getTargetRegInfo() const
void runOnMachineFunction(const MachineFunction &MF)
void init(VirtRegMap &vrm, LiveIntervals &lis, LiveRegMatrix &mat)
static const char TimerGroupName[]
void emitError(StringRef Msg) const
virtual void enqueue(LiveInterval *LI)=0
enqueue - Add VirtReg to the priority queue of unassigned registers.
LiveInterval & getInterval(unsigned Reg)
static cl::opt< bool, true > VerifyRegAlloc("verify-regalloc", cl::location(RegAllocBase::VerifyEnabled), cl::desc("Verify during register allocation"))
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
static bool VerifyEnabled
VerifyEnabled - True when -verify-regalloc is given.
const TargetRegisterInfo * TRI
MachineRegisterInfo & getRegInfo() const
RegisterClassInfo RegClassInfo
reg_iterator reg_begin(unsigned RegNo) const
bool TimePassesIsEnabled
This is the storage for the -time-passes option.
MachineRegisterInfo * MRI
LocationClass< Ty > location(Ty &L)
bool reg_nodbg_empty(unsigned RegNo) const
virtual LiveInterval * dequeue()=0
dequeue - Return the next unassigned register, or NULL.