LLVM 22.0.0git
llvm::RegAllocEvictionAdvisor Class Referenceabstract

#include "llvm/CodeGen/RegAllocEvictionAdvisor.h"

Inheritance diagram for llvm::RegAllocEvictionAdvisor:
[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_tRegCosts
const bool EnableLocalReassign
 Run or not the local reassignment heuristic.

Detailed Description

Definition at line 101 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

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.

References MF, and RA.

Referenced by INITIALIZE_PASS().

◆ canReassign()

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

References Matrix, and RegClassInfo.

Referenced by canAllocatePhysReg().

◆ 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 152 of file RegAllocEvictionAdvisor.h.

Referenced by RegAllocEvictionAdvisor().

◆ LIS

LiveIntervals* const llvm::RegAllocEvictionAdvisor::LIS
protected

Definition at line 143 of file RegAllocEvictionAdvisor.h.

Referenced by RegAllocEvictionAdvisor().

◆ Matrix

LiveRegMatrix* const llvm::RegAllocEvictionAdvisor::Matrix
protected

◆ MF

const MachineFunction& llvm::RegAllocEvictionAdvisor::MF
protected

◆ MRI

MachineRegisterInfo* const llvm::RegAllocEvictionAdvisor::MRI
protected

Definition at line 145 of file RegAllocEvictionAdvisor.h.

Referenced by getOrderLimit(), and RegAllocEvictionAdvisor().

◆ RA

const RAGreedy& llvm::RegAllocEvictionAdvisor::RA
protected

◆ RegClassInfo

const RegisterClassInfo& llvm::RegAllocEvictionAdvisor::RegClassInfo
protected

◆ RegCosts

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

◆ TRI

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

◆ VRM

VirtRegMap* const llvm::RegAllocEvictionAdvisor::VRM
protected

Definition at line 144 of file RegAllocEvictionAdvisor.h.

Referenced by canReassign(), and RegAllocEvictionAdvisor().


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