LLVM 22.0.0git
|
#include "llvm/CodeGen/RegAllocEvictionAdvisor.h"
Public Member Functions | |
RegAllocEvictionAdvisor (const RegAllocEvictionAdvisor &)=delete | |
RegAllocEvictionAdvisor (RegAllocEvictionAdvisor &&)=delete | |
virtual | ~RegAllocEvictionAdvisor ()=default |
virtual MCRegister | tryFindEvictionCandidate (const LiveInterval &VirtReg, const AllocationOrder &Order, uint8_t CostPerUseLimit, const SmallVirtRegSet &FixedRegisters) const =0 |
Find a physical register that can be freed by evicting the FixedRegisters, or return NoRegister. | |
virtual bool | canEvictHintInterference (const LiveInterval &VirtReg, MCRegister PhysReg, const SmallVirtRegSet &FixedRegisters) const =0 |
Find out if we can evict the live ranges occupying the given PhysReg, which is a hint (preferred register) for VirtReg. | |
bool | isUnusedCalleeSavedReg (MCRegister PhysReg) const |
Returns true if the given PhysReg is a callee saved register and has not been used for allocation yet. |
Protected Member Functions | |
RegAllocEvictionAdvisor (const MachineFunction &MF, const RAGreedy &RA) | |
bool | canReassign (const LiveInterval &VirtReg, MCRegister FromReg) const |
std::optional< unsigned > | getOrderLimit (const LiveInterval &VirtReg, const AllocationOrder &Order, unsigned CostPerUseLimit) const |
bool | canAllocatePhysReg (unsigned CostPerUseLimit, MCRegister PhysReg) const |
Protected Attributes | |
const MachineFunction & | MF |
const RAGreedy & | RA |
LiveRegMatrix *const | Matrix |
LiveIntervals *const | LIS |
VirtRegMap *const | VRM |
MachineRegisterInfo *const | MRI |
const TargetRegisterInfo *const | TRI |
const RegisterClassInfo & | RegClassInfo |
const ArrayRef< uint8_t > | RegCosts |
const bool | EnableLocalReassign |
Run or not the local reassignment heuristic. |
Definition at line 101 of file RegAllocEvictionAdvisor.h.
|
delete |
References RegAllocEvictionAdvisor().
Referenced by llvm::DefaultEvictionAdvisor::DefaultEvictionAdvisor(), RegAllocEvictionAdvisor(), and RegAllocEvictionAdvisor().
|
delete |
References RegAllocEvictionAdvisor().
|
virtualdefault |
|
protected |
Definition at line 181 of file RegAllocEvictionAdvisor.cpp.
References EnableLocalReassign, EnableLocalReassignment, LIS, Matrix, MF, MRI, RA, RegClassInfo, RegCosts, TRI, and VRM.
|
protected |
Definition at line 691 of file RegAllocGreedy.cpp.
References llvm::dbgs(), llvm::MCRegister::id(), isUnusedCalleeSavedReg(), LLVM_DEBUG, llvm::printReg(), RegClassInfo, RegCosts, and TRI.
|
pure virtual |
Find out if we can evict the live ranges occupying the given PhysReg, which is a hint (preferred register) for VirtReg.
Referenced by INITIALIZE_PASS().
|
protected |
Definition at line 589 of file RegAllocGreedy.cpp.
References llvm::LiveIntervalUnion::Query::checkInterference(), llvm::AllocationOrder::create(), llvm::dbgs(), LLVM_DEBUG, Matrix, llvm::none_of(), llvm::printReg(), llvm::LiveInterval::reg(), RegClassInfo, TRI, and VRM.
|
protected |
Definition at line 665 of file RegAllocGreedy.cpp.
References llvm::dbgs(), llvm::AllocationOrder::getOrder(), LLVM_DEBUG, MRI, llvm::LiveInterval::reg(), RegClassInfo, RegCosts, and TRI.
bool RegAllocEvictionAdvisor::isUnusedCalleeSavedReg | ( | MCRegister | PhysReg | ) | const |
Returns true if the given PhysReg
is a callee saved register and has not been used for allocation yet.
Definition at line 656 of file RegAllocGreedy.cpp.
References Matrix, and RegClassInfo.
Referenced by canAllocatePhysReg().
|
pure virtual |
Find a physical register that can be freed by evicting the FixedRegisters, or return NoRegister.
The eviction decision is assumed to be correct (i.e. no fixed live ranges are evicted) and profitable.
Referenced by INITIALIZE_PASS().
Run or not the local reassignment heuristic.
This information is obtained from the TargetSubtargetInfo.
Definition at line 152 of file RegAllocEvictionAdvisor.h.
Referenced by RegAllocEvictionAdvisor().
|
protected |
Definition at line 143 of file RegAllocEvictionAdvisor.h.
Referenced by RegAllocEvictionAdvisor().
|
protected |
Definition at line 142 of file RegAllocEvictionAdvisor.h.
Referenced by canReassign(), isUnusedCalleeSavedReg(), and RegAllocEvictionAdvisor().
|
protected |
Definition at line 140 of file RegAllocEvictionAdvisor.h.
Referenced by canEvictHintInterference(), llvm::DefaultEvictionAdvisor::DefaultEvictionAdvisor(), and RegAllocEvictionAdvisor().
|
protected |
Definition at line 145 of file RegAllocEvictionAdvisor.h.
Referenced by getOrderLimit(), and RegAllocEvictionAdvisor().
Definition at line 141 of file RegAllocEvictionAdvisor.h.
Referenced by canEvictHintInterference(), llvm::DefaultEvictionAdvisor::DefaultEvictionAdvisor(), and RegAllocEvictionAdvisor().
|
protected |
Definition at line 147 of file RegAllocEvictionAdvisor.h.
Referenced by canAllocatePhysReg(), canReassign(), getOrderLimit(), isUnusedCalleeSavedReg(), and RegAllocEvictionAdvisor().
Definition at line 148 of file RegAllocEvictionAdvisor.h.
Referenced by canAllocatePhysReg(), getOrderLimit(), and RegAllocEvictionAdvisor().
|
protected |
Definition at line 146 of file RegAllocEvictionAdvisor.h.
Referenced by canAllocatePhysReg(), canReassign(), getOrderLimit(), and RegAllocEvictionAdvisor().
|
protected |
Definition at line 144 of file RegAllocEvictionAdvisor.h.
Referenced by canReassign(), and RegAllocEvictionAdvisor().