LLVM 19.0.0git
Public Member Functions | List of all members
llvm::LiveIntervalCalc Class Reference

#include "llvm/CodeGen/LiveIntervalCalc.h"

Inheritance diagram for llvm::LiveIntervalCalc:
Inheritance graph
[legend]

Public Member Functions

 LiveIntervalCalc ()=default
 
void createDeadDefs (LiveRange &LR, Register Reg)
 createDeadDefs - Create a dead def in LI for every def operand of Reg.
 
void extendToUses (LiveRange &LR, MCRegister PhysReg)
 Extend the live range of LR to reach all uses of Reg.
 
void calculate (LiveInterval &LI, bool TrackSubRegs)
 Calculates liveness for the register specified in live interval LI.
 
void constructMainRangeFromSubranges (LiveInterval &LI)
 For live interval LI with correct SubRanges construct matching information for the main live range.
 
- Public Member Functions inherited from llvm::LiveRangeCalc
 LiveRangeCalc ()=default
 
void reset (const MachineFunction *mf, SlotIndexes *SI, MachineDominatorTree *MDT, VNInfo::Allocator *VNIA)
 reset - Prepare caches for a new set of non-overlapping live ranges.
 
void extend (LiveRange &LR, SlotIndex Use, unsigned PhysReg, ArrayRef< SlotIndex > Undefs)
 Extend the live range of LR to reach Use.
 
void setLiveOutValue (MachineBasicBlock *MBB, VNInfo *VNI)
 setLiveOutValue - Indicate that VNI is live out from MBB.
 
void addLiveInBlock (LiveRange &LR, MachineDomTreeNode *DomNode, SlotIndex Kill=SlotIndex())
 addLiveInBlock - Add a block with an unknown live-in value.
 
void calculateValues ()
 calculateValues - Calculate the value that will be live-in to each block added with addLiveInBlock.
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::LiveRangeCalc
static LLVM_ATTRIBUTE_UNUSED bool isJointlyDominated (const MachineBasicBlock *MBB, ArrayRef< SlotIndex > Defs, const SlotIndexes &Indexes)
 A diagnostic function to check if the end of the block MBB is jointly dominated by the blocks corresponding to the slot indices in Defs.
 
- Protected Member Functions inherited from llvm::LiveRangeCalc
const MachineFunctiongetMachineFunction ()
 Some getters to expose in a read-only way some private fields to subclasses.
 
const MachineRegisterInfogetRegInfo () const
 
SlotIndexesgetIndexes ()
 
MachineDominatorTreegetDomTree ()
 
VNInfo::AllocatorgetVNAlloc ()
 
void resetLiveOutMap ()
 Reset Map and Seen fields.
 

Detailed Description

Definition at line 28 of file LiveIntervalCalc.h.

Constructor & Destructor Documentation

◆ LiveIntervalCalc()

llvm::LiveIntervalCalc::LiveIntervalCalc ( )
default

Member Function Documentation

◆ calculate()

void LiveIntervalCalc::calculate ( LiveInterval LI,
bool  TrackSubRegs 
)

◆ constructMainRangeFromSubranges()

void LiveIntervalCalc::constructMainRangeFromSubranges ( LiveInterval LI)

For live interval 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.

Definition at line 106 of file LiveIntervalCalc.cpp.

References assert(), llvm::LiveRange::createDeadDef(), llvm::VNInfo::def, llvm::SmallVectorBase< Size_T >::empty(), llvm::LaneBitmask::getAll(), llvm::LiveRangeCalc::getVNAlloc(), llvm::VNInfo::isPHIDef(), llvm::VNInfo::isUnused(), llvm::LiveInterval::reg(), llvm::LiveRangeCalc::resetLiveOutMap(), llvm::LiveRange::segments, llvm::LiveInterval::subranges(), and llvm::LiveRange::valnos.

Referenced by calculate().

◆ createDeadDefs()

void LiveIntervalCalc::createDeadDefs ( LiveRange LR,
Register  Reg 
)

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.

Definition at line 123 of file LiveIntervalCalc.cpp.

References assert(), createDeadDef(), llvm::LiveRangeCalc::getIndexes(), llvm::LiveRangeCalc::getRegInfo(), llvm::LiveRangeCalc::getVNAlloc(), and MRI.

◆ extendToUses()

void llvm::LiveIntervalCalc::extendToUses ( LiveRange LR,
MCRegister  PhysReg 
)
inline

Extend the live range of 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.

Definition at line 54 of file LiveIntervalCalc.h.

References llvm::LaneBitmask::getAll().


The documentation for this class was generated from the following files: