LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::RegAllocEvictionAdvisor Class Referenceabstract

#include "CodeGen/RegAllocEvictionAdvisor.h"

Inheritance diagram for llvm::RegAllocEvictionAdvisor:
Inheritance graph
[legend]

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< unsignedgetOrderLimit (const LiveInterval &VirtReg, const AllocationOrder &Order, unsigned CostPerUseLimit) const
 
bool canAllocatePhysReg (unsigned CostPerUseLimit, MCRegister PhysReg) const
 

Protected Attributes

const MachineFunctionMF
 
const RAGreedyRA
 
LiveRegMatrix *const Matrix
 
LiveIntervals *const LIS
 
VirtRegMap *const VRM
 
MachineRegisterInfo *const MRI
 
const TargetRegisterInfo *const TRI
 
const RegisterClassInfoRegClassInfo
 
const ArrayRef< uint8_t > RegCosts
 
const bool EnableLocalReassign
 Run or not the local reassignment heuristic.
 

Detailed Description

Definition at line 98 of file RegAllocEvictionAdvisor.h.

Constructor & Destructor Documentation

◆ RegAllocEvictionAdvisor() [1/3]

llvm::RegAllocEvictionAdvisor::RegAllocEvictionAdvisor ( const RegAllocEvictionAdvisor )
delete

◆ RegAllocEvictionAdvisor() [2/3]

llvm::RegAllocEvictionAdvisor::RegAllocEvictionAdvisor ( RegAllocEvictionAdvisor &&  )
delete

◆ ~RegAllocEvictionAdvisor()

virtual llvm::RegAllocEvictionAdvisor::~RegAllocEvictionAdvisor ( )
virtualdefault

◆ RegAllocEvictionAdvisor() [3/3]

RegAllocEvictionAdvisor::RegAllocEvictionAdvisor ( const MachineFunction MF,
const RAGreedy RA 
)
protected

Definition at line 126 of file RegAllocEvictionAdvisor.cpp.

Member Function Documentation

◆ canAllocatePhysReg()

bool RegAllocEvictionAdvisor::canAllocatePhysReg ( unsigned  CostPerUseLimit,
MCRegister  PhysReg 
) const
protected

◆ canEvictHintInterference()

virtual bool llvm::RegAllocEvictionAdvisor::canEvictHintInterference ( const LiveInterval VirtReg,
MCRegister  PhysReg,
const SmallVirtRegSet FixedRegisters 
) const
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().

◆ canReassign()

bool RegAllocEvictionAdvisor::canReassign ( const LiveInterval VirtReg,
MCRegister  FromReg 
) const
protected

◆ getOrderLimit()

std::optional< unsigned > RegAllocEvictionAdvisor::getOrderLimit ( const LiveInterval VirtReg,
const AllocationOrder Order,
unsigned  CostPerUseLimit 
) const
protected

◆ isUnusedCalleeSavedReg()

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 522 of file RegAllocGreedy.cpp.

References llvm::RegisterClassInfo::getLastCalleeSavedAlias(), llvm::LiveRegMatrix::isPhysRegUsed(), llvm::RegAllocBase::Matrix, and llvm::RegAllocBase::RegClassInfo.

◆ tryFindEvictionCandidate()

virtual MCRegister llvm::RegAllocEvictionAdvisor::tryFindEvictionCandidate ( const LiveInterval VirtReg,
const AllocationOrder Order,
uint8_t  CostPerUseLimit,
const SmallVirtRegSet FixedRegisters 
) const
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().

Member Data Documentation

◆ EnableLocalReassign

const bool llvm::RegAllocEvictionAdvisor::EnableLocalReassign
protected

Run or not the local reassignment heuristic.

This information is obtained from the TargetSubtargetInfo.

Definition at line 149 of file RegAllocEvictionAdvisor.h.

◆ LIS

LiveIntervals* const llvm::RegAllocEvictionAdvisor::LIS
protected

Definition at line 140 of file RegAllocEvictionAdvisor.h.

◆ Matrix

LiveRegMatrix* const llvm::RegAllocEvictionAdvisor::Matrix
protected

Definition at line 139 of file RegAllocEvictionAdvisor.h.

◆ MF

const MachineFunction& llvm::RegAllocEvictionAdvisor::MF
protected

Definition at line 137 of file RegAllocEvictionAdvisor.h.

◆ MRI

MachineRegisterInfo* const llvm::RegAllocEvictionAdvisor::MRI
protected

Definition at line 142 of file RegAllocEvictionAdvisor.h.

◆ RA

const RAGreedy& llvm::RegAllocEvictionAdvisor::RA
protected

Definition at line 138 of file RegAllocEvictionAdvisor.h.

◆ RegClassInfo

const RegisterClassInfo& llvm::RegAllocEvictionAdvisor::RegClassInfo
protected

Definition at line 144 of file RegAllocEvictionAdvisor.h.

◆ RegCosts

const ArrayRef<uint8_t> llvm::RegAllocEvictionAdvisor::RegCosts
protected

Definition at line 145 of file RegAllocEvictionAdvisor.h.

◆ TRI

const TargetRegisterInfo* const llvm::RegAllocEvictionAdvisor::TRI
protected

Definition at line 143 of file RegAllocEvictionAdvisor.h.

◆ VRM

VirtRegMap* const llvm::RegAllocEvictionAdvisor::VRM
protected

Definition at line 141 of file RegAllocEvictionAdvisor.h.


The documentation for this class was generated from the following files: