class LiveRangeCalc

Declaration

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

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:44

Method Overview

  • public LiveRangeCalc()
  • public void addLiveInBlock(llvm::LiveRange & LR, llvm::MachineDomTreeNode * DomNode, llvm::SlotIndex Kill = llvm::SlotIndex())
  • public void calculate(llvm::LiveInterval & LI, bool TrackSubRegs)
  • public void calculateValues()
  • public void constructMainRangeFromSubranges(llvm::LiveInterval & LI)
  • public void createDeadDefs(llvm::LiveRange & LR, unsigned int Reg)
  • public void extend(llvm::LiveRange & LR, llvm::SlotIndex Use, unsigned int PhysReg, ArrayRef<llvm::SlotIndex> Undefs)
  • public void extendToUses(llvm::LiveRange & LR, unsigned int PhysReg)
  • public static bool isJointlyDominated(const llvm::MachineBasicBlock * MBB, ArrayRef<llvm::SlotIndex> Defs, const llvm::SlotIndexes & Indexes)
  • public void reset(const llvm::MachineFunction * mf, llvm::SlotIndexes * SI, llvm::MachineDominatorTree * MDT, VNInfo::Allocator * VNIA)
  • public void setLiveOutValue(llvm::MachineBasicBlock * MBB, llvm::VNInfo * VNI)

Methods

LiveRangeCalc()

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:179

void addLiveInBlock(
    llvm::LiveRange& LR,
    llvm::MachineDomTreeNode* DomNode,
    llvm::SlotIndex Kill = llvm::SlotIndex())

Description

addLiveInBlock - Add a block with an unknown live-in value. This function can only be called once per basic block. Once the live-in value has been determined, calculateValues() will add liveness to LI.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:269

Parameters

llvm::LiveRange& LR
The live range that is live-in to the block.
llvm::MachineDomTreeNode* DomNode
The domtree node for the block.
llvm::SlotIndex Kill = llvm::SlotIndex()
Index in block where LI is killed. If the value is live-through, set Kill = SLotIndex() and also call setLiveOutValue(MBB, 0).

void calculate(llvm::LiveInterval& LI,
               bool TrackSubRegs)

Description

Calculates liveness for the register specified in live interval @p LI. Creates subregister live ranges as needed if subreg liveness tracking is enabled.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:229

Parameters

llvm::LiveInterval& LI
bool TrackSubRegs

void calculateValues()

Description

calculateValues - Calculate the value that will be live-in to each block added with addLiveInBlock. Add PHI-def values as needed to preserve SSA form. Add liveness to all live-in blocks up to the Kill point, or the whole block for live-through blocks. Every predecessor of a live-in block must have been given a value with setLiveOutValue, the value may be null for live-trough blocks.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:281

void constructMainRangeFromSubranges(
    llvm::LiveInterval& LI)

Description

For live interval \p LI with correct SubRanges construct matching information for the main live range. Expects the main live range to not have any segments or value numbers.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:234

Parameters

llvm::LiveInterval& LI

void createDeadDefs(llvm::LiveRange& LR,
                    unsigned int Reg)

Description

createDeadDefs - Create a dead def in LI for every def operand of Reg. Each instruction defining Reg gets a new VNInfo with a corresponding minimal live range.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:216

Parameters

llvm::LiveRange& LR
unsigned int Reg

void extend(llvm::LiveRange& LR,
            llvm::SlotIndex Use,
            unsigned int PhysReg,
            ArrayRef<llvm::SlotIndex> Undefs)

Description

Extend the live range of @p LR to reach @p Use. The existing values in @p LR must be live so they jointly dominate @p Use. If @p Use is not dominated by a single existing value, PHI-defs are inserted as required to preserve SSA form. PhysReg, when set, is used to verify live-in lists on basic blocks.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:210

Parameters

llvm::LiveRange& LR
llvm::SlotIndex Use
unsigned int PhysReg
ArrayRef<llvm::SlotIndex> Undefs

void extendToUses(llvm::LiveRange& LR,
                  unsigned int PhysReg)

Description

Extend the live range of @p LR to reach all uses of Reg. All uses must be jointly dominated by existing liveness. PHI-defs are inserted as needed to preserve SSA form.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:222

Parameters

llvm::LiveRange& LR
unsigned int PhysReg

static bool isJointlyDominated(
    const llvm::MachineBasicBlock* MBB,
    ArrayRef<llvm::SlotIndex> Defs,
    const llvm::SlotIndexes& Indexes)

Description

A diagnostic function to check if the end of the block @p MBB is jointly dominated by the blocks corresponding to the slot indices in @p Defs. This function is mainly for use in self-verification checks.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:288

Parameters

const llvm::MachineBasicBlock* MBB
ArrayRef<llvm::SlotIndex> Defs
const llvm::SlotIndexes& Indexes

void reset(const llvm::MachineFunction* mf,
           llvm::SlotIndexes* SI,
           llvm::MachineDominatorTree* MDT,
           VNInfo::Allocator* VNIA)

Description

reset - Prepare caches for a new set of non-overlapping live ranges. The caches must be reset before attempting calculations with a live range that may overlap a previously computed live range, and before the first live range in a function. If live ranges are not known to be non-overlapping, call reset before each.

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:193

Parameters

const llvm::MachineFunction* mf
llvm::SlotIndexes* SI
llvm::MachineDominatorTree* MDT
VNInfo::Allocator* VNIA

void setLiveOutValue(llvm::MachineBasicBlock* MBB,
                     llvm::VNInfo* VNI)

Description

setLiveOutValue - Indicate that VNI is live out from MBB. The calculateValues() function will not add liveness for MBB, the caller should take care of that. VNI may be null only if MBB is a live-through block also passed to addLiveInBlock().

Declared at: llvm/include/llvm/CodeGen/LiveRangeCalc.h:255

Parameters

llvm::MachineBasicBlock* MBB
llvm::VNInfo* VNI