LLVM: llvm::RegAllocBase Class Reference (original) (raw)
RegAllocBase provides the register allocation driver and interface that can be extended to add interesting heuristics. More...
#include "[CodeGen/RegAllocBase.h](RegAllocBase%5F8h%5Fsource.html)"
| Static Public Attributes | |
|---|---|
| static bool | VerifyEnabled = false |
| VerifyEnabled - True when -verify-regalloc is given. |
| Protected Member Functions | |
|---|---|
| RegAllocBase (const RegAllocFilterFunc F=nullptr) | |
| virtual | ~RegAllocBase ()=default |
| void | init (VirtRegMap &vrm, LiveIntervals &lis, LiveRegMatrix &mat) |
| bool | shouldAllocateRegister (Register Reg) |
| Get whether a given register should be allocated. | |
| void | allocatePhysRegs () |
| virtual void | postOptimization () |
| void | cleanupFailedVReg (Register FailedVReg, MCRegister PhysReg, SmallVectorImpl< Register > &SplitRegs) |
| Perform cleanups on registers that failed to allocate. | |
| virtual Spiller & | spiller ()=0 |
| virtual void | enqueueImpl (const LiveInterval *LI)=0 |
| enqueue - Add VirtReg to the priority queue of unassigned registers. | |
| void | enqueue (const LiveInterval *LI) |
| enqueue - Add VirtReg to the priority queue of unassigned registers. | |
| virtual const LiveInterval * | dequeue ()=0 |
| dequeue - Return the next unassigned register, or NULL. | |
| virtual MCRegister | selectOrSplit (const LiveInterval &VirtReg, SmallVectorImpl< Register > &splitLVRs)=0 |
| MCPhysReg | getErrorAssignment (const TargetRegisterClass &RC, const MachineInstr *CtxMI=nullptr) |
| Query a physical register to use as a filler in contexts where the allocation has failed. | |
| virtual void | aboutToRemoveInterval (const LiveInterval &LI) |
| Method called when the allocator is about to remove a LiveInterval. |
| 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. | |
| SmallSet< Register, 2 > | FailedVRegs |
| 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 63 of file RegAllocBase.h.
◆ ~RegAllocBase()
| virtual llvm::RegAllocBase::~RegAllocBase ( ) | protectedvirtualdefault |
|---|
◆ aboutToRemoveInterval()
| virtual void llvm::RegAllocBase::aboutToRemoveInterval ( const LiveInterval & LI) | inlineprotectedvirtual |
|---|
◆ allocatePhysRegs()
| void RegAllocBase::allocatePhysRegs ( ) | protected |
|---|
Definition at line 87 of file RegAllocBase.cpp.
References aboutToRemoveInterval(), assert(), cleanupFailedVReg(), llvm::dbgs(), dequeue(), llvm::LiveRange::empty(), enqueue(), getErrorAssignment(), llvm::Register::isVirtual(), LIS, LLVM_DEBUG, Matrix, MI, MRI, llvm::LiveInterval::reg(), selectOrSplit(), TRI, and VRM.
Referenced by llvm::RAGreedy::run(), and llvm::RABasic::runOnMachineFunction().
◆ cleanupFailedVReg()
◆ dequeue()
◆ enqueue()
◆ enqueueImpl()
| virtual void llvm::RegAllocBase::enqueueImpl ( const LiveInterval * LI) | protectedpure virtual |
|---|
◆ getErrorAssignment()
Query a physical register to use as a filler in contexts where the allocation has failed.
This will raise an error, but not abort the compilation.
Definition at line 211 of file RegAllocBase.cpp.
References assert(), llvm::MachineInstr::emitInlineAsmError(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::front(), llvm::Function::getContext(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getProperties(), llvm::TargetRegisterClass::getRegisters(), llvm::MachineInstr::isInlineAsm(), RegClassInfo, and VRM.
Referenced by allocatePhysRegs().
◆ init()
Definition at line 59 of file RegAllocBase.cpp.
References FailedVRegs, llvm::VirtRegMap::getMachineFunction(), llvm::VirtRegMap::getRegInfo(), llvm::VirtRegMap::getTargetRegInfo(), LIS, Matrix, MRI, RegClassInfo, TRI, and VRM.
Referenced by llvm::RAGreedy::run(), and llvm::RABasic::runOnMachineFunction().
◆ postOptimization()
| void RegAllocBase::postOptimization ( ) | protectedvirtual |
|---|
◆ selectOrSplit()
◆ shouldAllocateRegister()
| bool llvm::RegAllocBase::shouldAllocateRegister ( Register Reg) | inlineprotected |
|---|
◆ spiller()
| virtual Spiller & llvm::RegAllocBase::spiller ( ) | protectedpure virtual |
|---|
◆ DeadRemats
◆ FailedVRegs
◆ LIS
◆ Matrix
◆ MRI
◆ RegClassInfo
◆ TimerGroupDescription
| const char RegAllocBase::TimerGroupDescription = "Register Allocation" | staticprotected |
|---|
◆ TimerGroupName
| const char RegAllocBase::TimerGroupName = "regalloc" | staticprotected |
|---|
◆ TRI
◆ VerifyEnabled
| bool RegAllocBase::VerifyEnabled = false | static |
|---|
◆ VRM
Definition at line 69 of file RegAllocBase.h.
Referenced by allocatePhysRegs(), assignedRegPartiallyOverlaps(), enqueue(), getErrorAssignment(), llvm::RAGreedy::getVirtRegMap(), init(), llvm::RAGreedy::RAGreedy(), llvm::RAGreedy::run(), llvm::RABasic::runOnMachineFunction(), llvm::RABasic::selectOrSplit(), and llvm::RABasic::spillInterferences().
The documentation for this class was generated from the following files:
- lib/CodeGen/RegAllocBase.h
- lib/CodeGen/RegAllocBase.cpp