class RegAllocBase

Declaration

class RegAllocBase { /* full declaration omitted */ };

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.

Declared at: llvm/lib/CodeGen/RegAllocBase.h:61

Member Variables

protected const llvm::TargetRegisterInfo* TRI = nullptr
protected llvm::MachineRegisterInfo* MRI = nullptr
protected llvm::VirtRegMap* VRM = nullptr
protected llvm::LiveIntervals* LIS = nullptr
protected llvm::LiveRegMatrix* Matrix = nullptr
protected llvm::RegisterClassInfo RegClassInfo
protected const llvm::RegClassFilterFunc ShouldAllocateClass
protected SmallPtrSet<llvm::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. 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.
protected static const char[] TimerGroupName
protected static const char[] TimerGroupDescription
public static bool VerifyEnabled
VerifyEnabled - True when -verify-regalloc is given.

Method Overview

  • protected RegAllocBase(const llvm::RegClassFilterFunc F = allocateAllRegClasses)
  • protected virtual void aboutToRemoveInterval(const llvm::LiveInterval & LI)
  • protected void allocatePhysRegs()
  • private virtual void anchor()
  • protected virtual const llvm::LiveInterval * dequeue()
  • protected void enqueue(const llvm::LiveInterval * LI)
  • protected virtual void enqueueImpl(const llvm::LiveInterval * LI)
  • protected void init(llvm::VirtRegMap & vrm, llvm::LiveIntervals & lis, llvm::LiveRegMatrix & mat)
  • protected virtual void postOptimization()
  • private void seedLiveRegs()
  • protected virtual llvm::MCRegister selectOrSplit(const llvm::LiveInterval & VirtReg, SmallVectorImpl<llvm::Register> & splitLVRs)
  • protected virtual llvm::Spiller & spiller()
  • protected virtual ~RegAllocBase()

Methods

RegAllocBase(const llvm::RegClassFilterFunc F =
                 allocateAllRegClasses)

Declared at: llvm/lib/CodeGen/RegAllocBase.h:79

Parameters

const llvm::RegClassFilterFunc F = allocateAllRegClasses

virtual void aboutToRemoveInterval(
    const llvm::LiveInterval& LI)

Description

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

Declared at: llvm/lib/CodeGen/RegAllocBase.h:119

Parameters

const llvm::LiveInterval& LI

void allocatePhysRegs()

Declared at: llvm/lib/CodeGen/RegAllocBase.h:89

virtual void anchor()

Declared at: llvm/lib/CodeGen/RegAllocBase.h:62

virtual const llvm::LiveInterval* dequeue()

Description

dequeue - Return the next unassigned register, or NULL.

Declared at: llvm/lib/CodeGen/RegAllocBase.h:105

void enqueue(const llvm::LiveInterval* LI)

Description

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

Declared at: llvm/lib/CodeGen/RegAllocBase.h:102

Parameters

const llvm::LiveInterval* LI

virtual void enqueueImpl(
    const llvm::LiveInterval* LI)

Description

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

Declared at: llvm/lib/CodeGen/RegAllocBase.h:99

Parameters

const llvm::LiveInterval* LI

void init(llvm::VirtRegMap& vrm,
          llvm::LiveIntervals& lis,
          llvm::LiveRegMatrix& mat)

Declared at: llvm/lib/CodeGen/RegAllocBase.h:85

Parameters

llvm::VirtRegMap& vrm
llvm::LiveIntervals& lis
llvm::LiveRegMatrix& mat

virtual void postOptimization()

Declared at: llvm/lib/CodeGen/RegAllocBase.h:93

void seedLiveRegs()

Declared at: llvm/lib/CodeGen/RegAllocBase.h:126

virtual llvm::MCRegister selectOrSplit(
    const llvm::LiveInterval& VirtReg,
    SmallVectorImpl<llvm::Register>& splitLVRs)

Declared at: llvm/lib/CodeGen/RegAllocBase.h:111

Parameters

const llvm::LiveInterval& VirtReg
SmallVectorImpl<llvm::Register>& splitLVRs

virtual llvm::Spiller& spiller()

Declared at: llvm/lib/CodeGen/RegAllocBase.h:96

virtual ~RegAllocBase()

Declared at: llvm/lib/CodeGen/RegAllocBase.h:82