class LiveRegUnits

Declaration

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

Description

A set of register units used to track register liveness.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:30

Member Variables

private const llvm::TargetRegisterInfo* TRI = nullptr
private llvm::BitVector Units

Method Overview

  • public LiveRegUnits(const llvm::TargetRegisterInfo & TRI)
  • public LiveRegUnits()
  • public void accumulate(const llvm::MachineInstr & MI)
  • public static void accumulateUsedDefed(const llvm::MachineInstr & MI, llvm::LiveRegUnits & ModifiedRegUnits, llvm::LiveRegUnits & UsedRegUnits, const llvm::TargetRegisterInfo * TRI)
  • public void addLiveIns(const llvm::MachineBasicBlock & MBB)
  • public void addLiveOuts(const llvm::MachineBasicBlock & MBB)
  • private void addPristines(const llvm::MachineFunction & MF)
  • public void addReg(llvm::MCPhysReg Reg)
  • public void addRegMasked(llvm::MCPhysReg Reg, llvm::LaneBitmask Mask)
  • public void addRegsInMask(const uint32_t * RegMask)
  • public void addUnits(const llvm::BitVector & RegUnits)
  • public bool available(llvm::MCPhysReg Reg) const
  • public void clear()
  • public bool empty() const
  • public const llvm::BitVector & getBitVector() const
  • public void init(const llvm::TargetRegisterInfo & TRI)
  • public void removeReg(llvm::MCPhysReg Reg)
  • public void removeRegsNotPreserved(const uint32_t * RegMask)
  • public void removeUnits(const llvm::BitVector & RegUnits)
  • public void stepBackward(const llvm::MachineInstr & MI)

Methods

LiveRegUnits(const llvm::TargetRegisterInfo& TRI)

Description

Constructs and initialize an empty LiveRegUnits set.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:39

Parameters

const llvm::TargetRegisterInfo& TRI

LiveRegUnits()

Description

Constructs a new empty LiveRegUnits set.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:36

void accumulate(const llvm::MachineInstr& MI)

Description

Adds all register units used, defined or clobbered in \p MI. This is useful when walking over a range of instruction to find registers unused over the whole range.

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

Parameters

const llvm::MachineInstr& MI

static void accumulateUsedDefed(
    const llvm::MachineInstr& MI,
    llvm::LiveRegUnits& ModifiedRegUnits,
    llvm::LiveRegUnits& UsedRegUnits,
    const llvm::TargetRegisterInfo* TRI)

Description

For a machine instruction \p MI, adds all register units used in\p UsedRegUnits and defined or clobbered in \p ModifiedRegUnits. This is useful when walking over a range of instructions to track registers used or defined seperately.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:47

Parameters

const llvm::MachineInstr& MI
llvm::LiveRegUnits& ModifiedRegUnits
llvm::LiveRegUnits& UsedRegUnits
const llvm::TargetRegisterInfo* TRI

void addLiveIns(
    const llvm::MachineBasicBlock& MBB)

Description

Adds registers living into block \p MBB.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:141

Parameters

const llvm::MachineBasicBlock& MBB

void addLiveOuts(
    const llvm::MachineBasicBlock& MBB)

Description

Adds registers living out of block \p MBB. Live out registers are the union of the live-in registers of the successor blocks and pristine registers. Live out registers of the end block are the callee saved registers.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:138

Parameters

const llvm::MachineBasicBlock& MBB

void addPristines(const llvm::MachineFunction& MF)

Description

Adds pristine registers. Pristine registers are callee saved registers that are unused in the function.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:159

Parameters

const llvm::MachineFunction& MF

void addReg(llvm::MCPhysReg Reg)

Description

Adds register units covered by physical register \p Reg.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:86

Parameters

llvm::MCPhysReg Reg

void addRegMasked(llvm::MCPhysReg Reg,
                  llvm::LaneBitmask Mask)

Description

Adds register units covered by physical register \p Reg that are part of the lanemask \p Mask.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:93

Parameters

llvm::MCPhysReg Reg
llvm::LaneBitmask Mask

void addRegsInMask(const uint32_t* RegMask)

Description

Adds register units not preserved by the regmask \p RegMask. The regmask has the same format as the one in the RegMask machine operand.

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

Parameters

const uint32_t* RegMask

void addUnits(const llvm::BitVector& RegUnits)

Description

Adds all register units marked in the bitvector \p RegUnits.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:144

Parameters

const llvm::BitVector& RegUnits

bool available(llvm::MCPhysReg Reg) const

Description

Returns true if no part of physical register \p Reg is live.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:116

Parameters

llvm::MCPhysReg Reg

void clear()

Description

Clears the set.

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

bool empty() const

Description

Returns true if the set is empty.

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

const llvm::BitVector& getBitVector() const

Description

Return the internal bitvector representation of the set.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:152

void init(const llvm::TargetRegisterInfo& TRI)

Description

Initialize and clear the set.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:73

Parameters

const llvm::TargetRegisterInfo& TRI

void removeReg(llvm::MCPhysReg Reg)

Description

Removes all register units covered by physical register \p Reg.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:102

Parameters

llvm::MCPhysReg Reg

void removeRegsNotPreserved(
    const uint32_t* RegMask)

Description

Removes register units not preserved by the regmask \p RegMask. The regmask has the same format as the one in the RegMask machine operand.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:109

Parameters

const uint32_t* RegMask

void removeUnits(const llvm::BitVector& RegUnits)

Description

Removes all register units marked in the bitvector \p RegUnits.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:148

Parameters

const llvm::BitVector& RegUnits

void stepBackward(const llvm::MachineInstr& MI)

Description

Updates liveness when stepping backwards over the instruction \p MI. This removes all register units defined or clobbered in \p MI and then adds the units used (as in use operands) in \p MI.

Declared at: llvm/include/llvm/CodeGen/LiveRegUnits.h:127

Parameters

const llvm::MachineInstr& MI