LLVM 20.0.0git
|
#include "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 98 of file RegAllocEvictionAdvisor.h.
|
delete |
|
delete |
|
virtualdefault |
|
protected |
Definition at line 126 of file RegAllocEvictionAdvisor.cpp.
|
protected |
Definition at line 554 of file RegAllocGreedy.cpp.
References llvm::dbgs(), llvm::RegisterClassInfo::getLastCalleeSavedAlias(), LLVM_DEBUG, llvm::printReg(), llvm::RegAllocBase::RegClassInfo, and llvm::RegAllocBase::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 452 of file RegAllocGreedy.cpp.
References llvm::LiveIntervalUnion::Query::checkInterference(), llvm::AllocationOrder::create(), llvm::dbgs(), llvm::LiveRegMatrix::getLiveUnions(), LLVM_DEBUG, llvm::RegAllocBase::Matrix, llvm::none_of(), llvm::printReg(), llvm::LiveInterval::reg(), llvm::RegAllocBase::RegClassInfo, llvm::MCRegisterInfo::regunits(), llvm::RegAllocBase::TRI, and llvm::RegAllocBase::VRM.
|
protected |
Definition at line 528 of file RegAllocGreedy.cpp.
References llvm::dbgs(), llvm::RegisterClassInfo::getLastCostChange(), llvm::RegisterClassInfo::getMinCost(), llvm::AllocationOrder::getOrder(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegClassName(), LLVM_DEBUG, llvm::RegAllocBase::MRI, llvm::LiveInterval::reg(), llvm::RegAllocBase::RegClassInfo, and llvm::RegAllocBase::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 519 of file RegAllocGreedy.cpp.
References llvm::RegisterClassInfo::getLastCalleeSavedAlias(), llvm::LiveRegMatrix::isPhysRegUsed(), llvm::RegAllocBase::Matrix, and llvm::RegAllocBase::RegClassInfo.
|
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 149 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 140 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 139 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 137 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 142 of file RegAllocEvictionAdvisor.h.
Definition at line 138 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 144 of file RegAllocEvictionAdvisor.h.
Definition at line 145 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 143 of file RegAllocEvictionAdvisor.h.
|
protected |
Definition at line 141 of file RegAllocEvictionAdvisor.h.