LLVM
8.0.1
|
RegAllocBase provides the register allocation driver and interface that can be extended to add interesting heuristics. More...
#include "CodeGen/RegAllocBase.h"
Static Public Attributes | |
static bool | VerifyEnabled = false |
VerifyEnabled - True when -verify-regalloc is given. More... | |
Protected Member Functions | |
RegAllocBase ()=default | |
virtual | ~RegAllocBase ()=default |
void | init (VirtRegMap &vrm, LiveIntervals &lis, LiveRegMatrix &mat) |
void | allocatePhysRegs () |
virtual void | postOptimization () |
virtual Spiller & | spiller ()=0 |
virtual void | enqueue (LiveInterval *LI)=0 |
enqueue - Add VirtReg to the priority queue of unassigned registers. More... | |
virtual LiveInterval * | dequeue ()=0 |
dequeue - Return the next unassigned register, or NULL. More... | |
virtual unsigned | selectOrSplit (LiveInterval &VirtReg, SmallVectorImpl< unsigned > &splitLVRs)=0 |
virtual void | aboutToRemoveInterval (LiveInterval &LI) |
Method called when the allocator is about to remove a LiveInterval. More... | |
Protected Attributes | |
const TargetRegisterInfo * | TRI = nullptr |
MachineRegisterInfo * | MRI = nullptr |
VirtRegMap * | VRM = nullptr |
LiveIntervals * | LIS = nullptr |
LiveRegMatrix * | Matrix = nullptr |
RegisterClassInfo | RegClassInfo |
SmallPtrSet< MachineInstr *, 32 > | DeadRemats |
Inst which is a def of an original reg and whose defs are already all dead after remat is saved in DeadRemats. More... | |
Static Protected Attributes | |
static const char | TimerGroupName [] = "regalloc" |
static const char | TimerGroupDescription [] = "Register Allocation" |
RegAllocBase provides the register allocation driver and interface that can be extended to add interesting heuristics.
Register allocators must override the selectOrSplit() method to implement live range splitting. They must also override enqueue/dequeue to provide an assignment order.
Definition at line 61 of file RegAllocBase.h.
|
protecteddefault |
|
protectedvirtualdefault |
|
inlineprotectedvirtual |
Method called when the allocator is about to remove a LiveInterval.
Definition at line 113 of file RegAllocBase.h.
Referenced by allocatePhysRegs().
|
protected |
Definition at line 85 of file RegAllocBase.cpp.
References aboutToRemoveInterval(), assert(), llvm::LiveRegMatrix::assign(), llvm::VirtRegMap::assignVirt2Phys(), llvm::dbgs(), dequeue(), E, llvm::MachineInstr::emitError(), enqueue(), llvm::LiveIntervals::getInterval(), llvm::RegisterClassInfo::getOrder(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegClassName(), llvm::LiveIntervals::hasInterval(), llvm::VirtRegMap::hasPhys(), I, llvm::LiveRegMatrix::invalidateVirtRegs(), llvm::MachineInstr::isInlineAsm(), llvm::TargetRegisterInfo::isVirtualRegister(), LIS, LLVM_DEBUG, Matrix, MI, MRI, Reg, llvm::MachineRegisterInfo::reg_instr_begin(), llvm::MachineRegisterInfo::reg_instr_end(), llvm::MachineRegisterInfo::reg_nodbg_empty(), RegClassInfo, llvm::LiveIntervals::removeInterval(), llvm::report_fatal_error(), selectOrSplit(), TRI, and VRM.
|
protectedpure virtual |
dequeue - Return the next unassigned register, or NULL.
Referenced by allocatePhysRegs().
|
protectedpure virtual |
enqueue - Add VirtReg to the priority queue of unassigned registers.
Referenced by allocatePhysRegs(), and init().
|
protected |
Definition at line 57 of file RegAllocBase.cpp.
References enqueue(), llvm::MachineRegisterInfo::freezeReservedRegs(), llvm::LiveIntervals::getInterval(), llvm::VirtRegMap::getMachineFunction(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::VirtRegMap::getRegInfo(), llvm::VirtRegMap::getTargetRegInfo(), llvm::TargetRegisterInfo::index2VirtReg(), LIS, Matrix, MRI, Reg, llvm::MachineRegisterInfo::reg_nodbg_empty(), RegClassInfo, llvm::RegisterClassInfo::runOnMachineFunction(), T, llvm::TimePassesIsEnabled, TimerGroupDescription, TimerGroupName, TRI, and VRM.
|
protectedvirtual |
Definition at line 162 of file RegAllocBase.cpp.
References DeadRemats, LIS, llvm::Spiller::postOptimization(), llvm::LiveIntervals::RemoveMachineInstrFromMaps(), and spiller().
|
protectedpure virtual |
Referenced by allocatePhysRegs().
|
protectedpure virtual |
Referenced by postOptimization().
|
protected |
Inst which is a def of an original reg and whose defs are already all dead after remat is saved in DeadRemats.
The deletion of such inst is postponed till all the allocations are done, so its remat expr is always available for the remat of all the siblings of the original reg.
Definition at line 76 of file RegAllocBase.h.
Referenced by postOptimization().
|
protected |
Definition at line 68 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), init(), and postOptimization().
|
protected |
Definition at line 69 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), and init().
|
protected |
Definition at line 66 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), and init().
|
protected |
Definition at line 70 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), and init().
Definition at line 110 of file RegAllocBase.h.
Referenced by init().
Definition at line 109 of file RegAllocBase.h.
Referenced by init().
|
protected |
Definition at line 65 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), and init().
VerifyEnabled - True when -verify-regalloc is given.
Definition at line 117 of file RegAllocBase.h.
|
protected |
Definition at line 67 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), and init().