LLVM  5.0.0
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:
[legend]

Static Public Attributes

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

Protected Member Functions

 RegAllocBase ()
 
virtual ~RegAllocBase ()
 
void init (VirtRegMap &vrm, LiveIntervals &lis, LiveRegMatrix &mat)
 
void allocatePhysRegs ()
 
virtual void postOptimization ()
 
virtual Spiller & spiller ()=0
 
virtual void enqueue (LiveInterval *LI)=0
 enqueue - Add VirtReg to the priority queue of unassigned registers. More...
 
virtual LiveInterval * dequeue ()=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 TargetRegisterInfo * TRI
 
MachineRegisterInfo * MRI
 
VirtRegMap * VRM
 
LiveIntervals * LIS
 
LiveRegMatrix * Matrix
 
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 58 of file RegAllocBase.h.

Constructor & Destructor Documentation

llvm::RegAllocBase::RegAllocBase ( )
inlineprotected

Definition at line 74 of file RegAllocBase.h.

virtual llvm::RegAllocBase::~RegAllocBase ( )
inlineprotectedvirtual

Definition at line 77 of file RegAllocBase.h.

Member Function Documentation

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

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

Definition at line 111 of file RegAllocBase.h.

Referenced by allocatePhysRegs().

void RegAllocBase::allocatePhysRegs ( )
protected
virtual LiveInterval* llvm::RegAllocBase::dequeue ( )
protectedpure virtual

dequeue - Return the next unassigned register, or NULL.

Referenced by allocatePhysRegs().

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

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

Referenced by allocatePhysRegs().

void RegAllocBase::init ( VirtRegMap &  vrm,
LiveIntervals &  lis,
LiveRegMatrix &  mat 
)
protected
void RegAllocBase::postOptimization ( )
protectedvirtual
virtual unsigned llvm::RegAllocBase::selectOrSplit ( LiveInterval &  VirtReg,
SmallVectorImpl< unsigned > &  splitLVRs 
)
protectedpure virtual

Referenced by allocatePhysRegs().

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

Referenced by postOptimization().

Member Data Documentation

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 72 of file RegAllocBase.h.

Referenced by postOptimization().

LiveIntervals* llvm::RegAllocBase::LIS
protected

Definition at line 64 of file RegAllocBase.h.

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

LiveRegMatrix* llvm::RegAllocBase::Matrix
protected

Definition at line 65 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

MachineRegisterInfo* llvm::RegAllocBase::MRI
protected

Definition at line 62 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

RegisterClassInfo llvm::RegAllocBase::RegClassInfo
protected

Definition at line 66 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

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

Definition at line 108 of file RegAllocBase.h.

const char RegAllocBase::TimerGroupName = "regalloc"
staticprotected

Definition at line 107 of file RegAllocBase.h.

const TargetRegisterInfo* llvm::RegAllocBase::TRI
protected

Definition at line 61 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().

bool RegAllocBase::VerifyEnabled = false
static

VerifyEnabled - True when -verify-regalloc is given.

Definition at line 115 of file RegAllocBase.h.

VirtRegMap* llvm::RegAllocBase::VRM
protected

Definition at line 63 of file RegAllocBase.h.

Referenced by allocatePhysRegs(), and init().


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