LLVM  6.0.0svn
Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
llvm::RegAllocBase Class Referenceabstract

RegAllocBase provides the register allocation driver and interface that can be extended to add interesting heuristics. More...

#include "CodeGen/RegAllocBase.h"

Collaboration diagram for llvm::RegAllocBase:
Collaboration graph
[legend]

Static Public Attributes

static bool VerifyEnabled = false
 VerifyEnabled - True when -verify-regalloc is given. More...
 

Protected Member Functions

 RegAllocBase ()=default
 
virtual ~RegAllocBase ()=default
 
void init (VirtRegMap &vrm, LiveIntervals &lis, LiveRegMatrix &mat)
 
void allocatePhysRegs ()
 
virtual void postOptimization ()
 
virtual Spillerspiller ()=0
 
virtual void enqueue (LiveInterval *LI)=0
 enqueue - Add VirtReg to the priority queue of unassigned registers. More...
 
virtual LiveIntervaldequeue ()=0
 dequeue - Return the next unassigned register, or NULL. More...
 
virtual unsigned selectOrSplit (LiveInterval &VirtReg, SmallVectorImpl< unsigned > &splitLVRs)=0
 
virtual void aboutToRemoveInterval (LiveInterval &LI)
 Method called when the allocator is about to remove a LiveInterval. More...
 

Protected Attributes

const TargetRegisterInfoTRI = nullptr
 
MachineRegisterInfoMRI = nullptr
 
VirtRegMapVRM = nullptr
 
LiveIntervalsLIS = nullptr
 
LiveRegMatrixMatrix = nullptr
 
RegisterClassInfo RegClassInfo
 
SmallPtrSet< MachineInstr *, 32 > DeadRemats
 Inst which is a def of an original reg and whose defs are already all dead after remat is saved in DeadRemats. More...
 

Static Protected Attributes

static const char TimerGroupName [] = "regalloc"
 
static const char TimerGroupDescription [] = "Register Allocation"
 

Detailed Description

RegAllocBase provides the register allocation driver and interface that can be extended to add interesting heuristics.

Register allocators must override the selectOrSplit() method to implement live range splitting. They must also override enqueue/dequeue to provide an assignment order.

Definition at line 61 of file RegAllocBase.h.

Constructor & Destructor Documentation

◆ RegAllocBase()

llvm::RegAllocBase::RegAllocBase ( )
protecteddefault

◆ ~RegAllocBase()

virtual llvm::RegAllocBase::~RegAllocBase ( )
protectedvirtualdefault

Member Function Documentation

◆ aboutToRemoveInterval()

virtual void llvm::RegAllocBase::aboutToRemoveInterval ( LiveInterval LI)
inlineprotectedvirtual

Method called when the allocator is about to remove a LiveInterval.

Definition at line 113 of file RegAllocBase.h.

Referenced by allocatePhysRegs().

◆ allocatePhysRegs()

void RegAllocBase::allocatePhysRegs ( )
protected

◆ dequeue()

virtual LiveInterval* llvm::RegAllocBase::dequeue ( )
protectedpure virtual

dequeue - Return the next unassigned register, or NULL.

Referenced by allocatePhysRegs().

◆ enqueue()

virtual void llvm::RegAllocBase::enqueue ( LiveInterval LI)
protectedpure virtual

enqueue - Add VirtReg to the priority queue of unassigned registers.

Referenced by allocatePhysRegs(), and init().

◆ init()

void RegAllocBase::init ( VirtRegMap vrm,
LiveIntervals lis,
LiveRegMatrix mat 
)
protected

◆ postOptimization()

void RegAllocBase::postOptimization ( )
protectedvirtual

◆ selectOrSplit()

virtual unsigned llvm::RegAllocBase::selectOrSplit ( LiveInterval VirtReg,
SmallVectorImpl< unsigned > &  splitLVRs 
)
protectedpure virtual

Referenced by allocatePhysRegs().

◆ spiller()

virtual Spiller& llvm::RegAllocBase::spiller ( )
protectedpure virtual

Referenced by postOptimization().

Member Data Documentation

◆ DeadRemats

SmallPtrSet<MachineInstr *, 32> llvm::RegAllocBase::DeadRemats
protected

Inst which is a def of an original reg and whose defs are already all dead after remat is saved in DeadRemats.

The deletion of such inst is postponed till all the allocations are done, so its remat expr is always available for the remat of all the siblings of the original reg.

Definition at line 76 of file RegAllocBase.h.

Referenced by postOptimization().

◆ LIS

LiveIntervals* llvm::RegAllocBase::LIS = nullptr
protected

Definition at line 68 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), init(), and postOptimization().

◆ Matrix

LiveRegMatrix* llvm::RegAllocBase::Matrix = nullptr
protected

Definition at line 69 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

◆ MRI

MachineRegisterInfo* llvm::RegAllocBase::MRI = nullptr
protected

Definition at line 66 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

◆ RegClassInfo

RegisterClassInfo llvm::RegAllocBase::RegClassInfo
protected

Definition at line 70 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

◆ TimerGroupDescription

const char RegAllocBase::TimerGroupDescription = "Register Allocation"
staticprotected

Definition at line 110 of file RegAllocBase.h.

Referenced by init().

◆ TimerGroupName

const char RegAllocBase::TimerGroupName = "regalloc"
staticprotected

Definition at line 109 of file RegAllocBase.h.

Referenced by init().

◆ TRI

const TargetRegisterInfo* llvm::RegAllocBase::TRI = nullptr
protected

Definition at line 65 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

◆ VerifyEnabled

bool RegAllocBase::VerifyEnabled = false
static

VerifyEnabled - True when -verify-regalloc is given.

Definition at line 117 of file RegAllocBase.h.

◆ VRM

VirtRegMap* llvm::RegAllocBase::VRM = nullptr
protected

Definition at line 67 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().


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