Get preferred physical registers to try first for VirtReg.
Declared in <llvm/CodeGen/TargetRegisterInfo.h>
virtual
bool
getRegAllocationHints(
Register VirtReg,
ArrayRef<MCPhysReg> Order,
SmallVectorImpl<MCPhysReg>& Hints,
MachineFunction const& MF,
VirtRegMap const* VRM = nullptr,
LiveRegMatrix const* Matrix = nullptr) const;
Get a list of 'hint' registers that the register allocator should try first when allocating a physical register for the virtual register VirtReg. These registers are effectively moved to the front of the allocation order. If true is returned, regalloc will try to only use hints to the greatest extent possible even if it means spilling.
The Order argument is the allocation order for VirtReg's register class as returned from RegisterClassInfo::getOrder(). The hint registers must come from Order, and they must not be reserved.
The default implementation of this function will only add target independent register allocation hints. Targets that override this function should typically call this default implementation as well and expect to see generic copy hints added.
True if allocation should prefer the hint registers exclusively when possible.
| Name | Description |
|---|---|
| VirtReg | Virtual register needing allocation hints. |
| Order | Allocation order for VirtReg's register class. |
| Hints | Output list of preferred physical registers. |
| MF | Function that owns VirtReg. |
| VRM | Optional virtual-to-physical register map. |
| Matrix | Optional live register matrix. |