class LivePhysRegs

Declaration

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

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:48

Method Overview

  • public LivePhysRegs(const llvm::TargetRegisterInfo & TRI)
  • public LivePhysRegs(const llvm::LivePhysRegs &)
  • public LivePhysRegs()
  • public void addLiveIns(const llvm::MachineBasicBlock & MBB)
  • public void addLiveOuts(const llvm::MachineBasicBlock & MBB)
  • public void addLiveOutsNoPristines(const llvm::MachineBasicBlock & MBB)
  • public void addReg(llvm::MCPhysReg Reg)
  • public void addUses(const llvm::MachineInstr & MI)
  • public bool available(const llvm::MachineRegisterInfo & MRI, llvm::MCPhysReg Reg) const
  • public int begin() const
  • public void clear()
  • public bool contains(llvm::MCPhysReg Reg) const
  • public void dump() const
  • public bool empty() const
  • public int end() const
  • public void init(const llvm::TargetRegisterInfo & TRI)
  • public void print(llvm::raw_ostream & OS) const
  • public void removeDefs(const llvm::MachineInstr & MI)
  • public void removeReg(llvm::MCPhysReg Reg)
  • public void removeRegsInMask(const llvm::MachineOperand & MO, SmallVectorImpl<std::pair<MCPhysReg, const MachineOperand *>> * Clobbers = nullptr)
  • public void stepBackward(const llvm::MachineInstr & MI)
  • public void stepForward(const llvm::MachineInstr & MI, SmallVectorImpl<std::pair<MCPhysReg, const MachineOperand *>> & Clobbers)

Methods

LivePhysRegs(const llvm::TargetRegisterInfo& TRI)

Description

Constructs and initializes an empty set.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:58

Parameters

const llvm::TargetRegisterInfo& TRI

LivePhysRegs(const llvm::LivePhysRegs&)

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:62

Parameters

const llvm::LivePhysRegs&

LivePhysRegs()

Description

Constructs an unitialized set. init() needs to be called to initialize it.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:55

void addLiveIns(
    const llvm::MachineBasicBlock& MBB)

Description

Adds all live-in registers of basic block \p MBB. Live in registers are the registers in the blocks live-in list and the pristine registers.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:134

Parameters

const llvm::MachineBasicBlock& MBB

void addLiveOuts(
    const llvm::MachineBasicBlock& MBB)

Description

Adds all live-out registers of basic 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. If a register is not added by this method, it is guaranteed to not be live out from MBB, although a sub-register may be. This is true both before and after regalloc.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:143

Parameters

const llvm::MachineBasicBlock& MBB

void addLiveOutsNoPristines(
    const llvm::MachineBasicBlock& MBB)

Description

Adds all live-out registers of basic block \p MBB but skips pristine registers.

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

Parameters

const llvm::MachineBasicBlock& MBB

void addReg(llvm::MCPhysReg Reg)

Description

Adds a physical register and all its sub-registers to the set.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:79

Parameters

llvm::MCPhysReg Reg

void addUses(const llvm::MachineInstr& MI)

Description

Add uses to the set.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:115

Parameters

const llvm::MachineInstr& MI

bool available(
    const llvm::MachineRegisterInfo& MRI,
    llvm::MCPhysReg Reg) const

Description

Returns true if register \p Reg and no aliasing register is in the set.

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

Parameters

const llvm::MachineRegisterInfo& MRI
llvm::MCPhysReg Reg

int begin() const

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:151

void clear()

Description

Clears the set.

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

bool contains(llvm::MCPhysReg Reg) const

Description

Returns true if register \p Reg is contained in the set. This also works if only the super register of \p Reg has been defined, because addReg() always adds all sub-registers to the set as well. Note: Returns false if just some sub registers are live, use available() when searching a free register.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:106

Parameters

llvm::MCPhysReg Reg

void dump() const

Description

Dumps the currently live registers to the debug output.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:158

bool empty() const

Description

Returns true if the set is empty.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:76

int end() const

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

void init(const llvm::TargetRegisterInfo& TRI)

Description

(re-)initializes and clears the set.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:66

Parameters

const llvm::TargetRegisterInfo& TRI

void print(llvm::raw_ostream& OS) const

Description

Prints the currently live registers to \p OS.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:155

Parameters

llvm::raw_ostream& OS

void removeDefs(const llvm::MachineInstr& MI)

Description

Remove defined registers and regmask kills from the set.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:112

Parameters

const llvm::MachineInstr& MI

void removeReg(llvm::MCPhysReg Reg)

Description

Removes a physical register, all its sub-registers, and all its super-registers from the set.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:89

Parameters

llvm::MCPhysReg Reg

void removeRegsInMask(
    const llvm::MachineOperand& MO,
    SmallVectorImpl<
        std::pair<MCPhysReg,
                  const MachineOperand*>>*
        Clobbers = nullptr)

Description

Removes physical registers clobbered by the regmask operand \p MO.

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

Parameters

const llvm::MachineOperand& MO
SmallVectorImpl< std::pair<MCPhysReg, const MachineOperand*>>* Clobbers = nullptr

void stepBackward(const llvm::MachineInstr& MI)

Description

Simulates liveness when stepping backwards over an instruction(bundle). Remove Defs, add uses. This is the recommended way of calculating liveness.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:120

Parameters

const llvm::MachineInstr& MI

void stepForward(
    const llvm::MachineInstr& MI,
    SmallVectorImpl<
        std::pair<MCPhysReg,
                  const MachineOperand*>>&
        Clobbers)

Description

Simulates liveness when stepping forward over an instruction(bundle). Remove killed-uses, add defs. This is the not recommended way, because it depends on accurate kill flags. If possible use stepBackward() instead of this function. The clobbers set will be the list of registers either defined or clobbered by a regmask. The operand will identify whether this is a regmask or register operand.

Declared at: llvm/include/llvm/CodeGen/LivePhysRegs.h:128

Parameters

const llvm::MachineInstr& MI
SmallVectorImpl< std::pair<MCPhysReg, const MachineOperand*>>& Clobbers