class RegScavenger

Declaration

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

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:34

Method Overview

Methods

llvm::Register FindUnusedReg(
    const llvm::TargetRegisterClass* RC) const

Description

Find an unused register of the specified register class. Return 0 if none is found.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:129

Parameters

const llvm::TargetRegisterClass* RC

RegScavenger()

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:71

void addScavengingFrameIndex(int FI)

Description

Add a scavenging frame index.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:132

Parameters

int FI

void backward()

Description

Update internal register state and move MBB iterator backwards. Contrary to unprocess() this method gives precise results even in the absence of kill flags.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:104

void backward(MachineBasicBlock::iterator I)

Description

Call backward() as long as the internal iterator does not point to \p I.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:107

Parameters

MachineBasicBlock::iterator I

void enterBasicBlock(llvm::MachineBasicBlock& MBB)

Description

Start tracking liveness from the begin of basic block \p MBB.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:74

Parameters

llvm::MachineBasicBlock& MBB

void enterBasicBlockEnd(
    llvm::MachineBasicBlock& MBB)

Description

Start tracking liveness from the end of basic block \p MBB. Use backward() to move towards the beginning of the block. This is preferred to enterBasicBlock() and forward() because it does not depend on the presence of kill flags.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:80

Parameters

llvm::MachineBasicBlock& MBB

void forward()

Description

Move the internal MBB iterator and update register states.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:83

void forward(MachineBasicBlock::iterator I)

Description

Move the internal MBB iterator and update register states until it has processed the specific iterator.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:87

Parameters

MachineBasicBlock::iterator I

MachineBasicBlock::iterator getCurrentPosition()
    const

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:119

llvm::BitVector getRegsAvailable(
    const llvm::TargetRegisterClass* RC)

Description

Return all available registers in the register class in Mask.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:125

Parameters

const llvm::TargetRegisterClass* RC

void getScavengingFrameIndices(
    SmallVectorImpl<int>& A) const

Description

Get an array of scavenging frame indices.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:147

Parameters

SmallVectorImpl<int>& A

bool isRegUsed(llvm::Register Reg,
               bool includeReserved = true) const

Description

Return if a specific register is currently used.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:122

Parameters

llvm::Register Reg
bool includeReserved = true

bool isScavengingFrameIndex(int FI) const

Description

Query whether a frame index is a scavenging frame index.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:137

Parameters

int FI

llvm::Register scavengeRegister(
    const llvm::TargetRegisterClass* RC,
    MachineBasicBlock::iterator I,
    int SPAdj,
    bool AllowSpill = true)

Description

Make a register of the specific register class available and do the appropriate bookkeeping. SPAdj is the stack adjustment due to call frame, it's passed along to eliminateFrameIndex(). Returns the scavenged register. This is deprecated as it depends on the quality of the kill flags being present; Use scavengeRegisterBackwards() instead! If \p AllowSpill is false, fail if a spill is required to make the register available, and return NoRegister.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:163

Parameters

const llvm::TargetRegisterClass* RC
MachineBasicBlock::iterator I
int SPAdj
bool AllowSpill = true

llvm::Register scavengeRegister(
    const llvm::TargetRegisterClass* RegClass,
    int SPAdj,
    bool AllowSpill = true)

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:166

Parameters

const llvm::TargetRegisterClass* RegClass
int SPAdj
bool AllowSpill = true

llvm::Register scavengeRegisterBackwards(
    const llvm::TargetRegisterClass& RC,
    MachineBasicBlock::iterator To,
    bool RestoreAfter,
    int SPAdj,
    bool AllowSpill = true)

Description

Make a register of the specific register class available from the current position backwards to the place before \p To. If \p RestoreAfter is true this includes the instruction following the current position. SPAdj is the stack adjustment due to call frame, it's passed along to eliminateFrameIndex(). Returns the scavenged register. If \p AllowSpill is false, fail if a spill is required to make the register available, and return NoRegister.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:180

Parameters

const llvm::TargetRegisterClass& RC
MachineBasicBlock::iterator To
bool RestoreAfter
int SPAdj
bool AllowSpill = true

void setRegUsed(llvm::Register Reg,
                llvm::LaneBitmask LaneMask =
                    LaneBitmask::getAll())

Description

Tell the scavenger a register is used.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:186

Parameters

llvm::Register Reg
llvm::LaneBitmask LaneMask = LaneBitmask::getAll()

void skipTo(MachineBasicBlock::iterator I)

Description

Move the internal MBB iterator but do not update register states.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:113

Parameters

MachineBasicBlock::iterator I

void unprocess(MachineBasicBlock::iterator I)

Description

Unprocess instructions until you reach the provided iterator.

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:97

Parameters

MachineBasicBlock::iterator I

void unprocess()

Description

Invert the behavior of forward() on the current instruction (undo the changes to the available registers made by forward()).

Declared at: llvm/include/llvm/CodeGen/RegisterScavenging.h:94