class LiveIntervals
Declaration
class LiveIntervals : public MachineFunctionPass { /* full declaration omitted */ };
Description
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. Instead of overriding runOnFunction, subclasses override runOnMachineFunction.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:53
Inherits from: MachineFunctionPass
Member Variables
- private llvm::MachineFunction* MF
- private llvm::MachineRegisterInfo* MRI
- private const llvm::TargetRegisterInfo* TRI
- private const llvm::TargetInstrInfo* TII
- private llvm::SlotIndexes* Indexes
- private llvm::MachineDominatorTree* DomTree = nullptr
- private llvm::LiveIntervalCalc* LICalc = nullptr
- private VNInfo::Allocator VNInfoAllocator
- Special pool allocator for VNInfo's (LiveInterval val#).
- private IndexedMap<llvm::LiveInterval*, llvm::VirtReg2IndexFunctor> VirtRegIntervals
- Live interval pointers for all the virtual registers.
- private SmallVector<llvm::SlotIndex, 8> RegMaskSlots
- Sorted list of instructions with register mask operands. Always use the 'r' slot, RegMasks are normal clobbers, not early clobbers.
- private SmallVector<const uint32_t*, 8> RegMaskBits
- This is kept in a separate vector partly because some standard libraries don't support lower_bound() with mixed objects, partly to improve locality when searching in RegMaskSlots. Also see the comment in LiveInterval::find().
- private SmallVector<std::pair<unsigned int, unsigned int>, 8> RegMaskBlocks
- For each basic block number, keep (begin, size) pairs indexing into the RegMaskSlots and RegMaskBits arrays. Note that basic block numbers may not be layout contiguous, that's why we can't just keep track of the first register mask in each basic block.
- private SmallVector<llvm::LiveRange*, 0> RegUnitRanges
- Keeps a live range set for each register unit to track fixed physreg interference.
- public static char ID
Method Overview
- public llvm::SlotIndex InsertMachineInstrInMaps(llvm::MachineInstr & MI)
- public void InsertMachineInstrRangeInMaps(MachineBasicBlock::iterator B, MachineBasicBlock::iterator E)
- public LiveIntervals()
- public void RemoveMachineInstrFromMaps(llvm::MachineInstr & MI)
- public llvm::SlotIndex ReplaceMachineInstrInMaps(llvm::MachineInstr & MI, llvm::MachineInstr & NewMI)
- public void addKillFlags(const llvm::VirtRegMap *)
- public LiveInterval::Segment addSegmentToEndOfBlock(llvm::Register Reg, llvm::MachineInstr & startInst)
- public bool checkRegMaskInterference(const llvm::LiveInterval & LI, llvm::BitVector & UsableRegs)
- private bool computeDeadValues(llvm::LiveInterval & LI, SmallVectorImpl<llvm::MachineInstr *> * dead)
- private void computeLiveInRegUnits()
- private void computeRegMasks()
- private void computeRegUnitRange(llvm::LiveRange &, unsigned int Unit)
- private bool computeVirtRegInterval(llvm::LiveInterval &)
- private void computeVirtRegs()
- public void constructMainRangeFromSubranges(llvm::LiveInterval & LI)
- public llvm::LiveInterval & createAndComputeVirtRegInterval(llvm::Register Reg)
- public llvm::LiveInterval & createEmptyInterval(llvm::Register Reg)
- private static llvm::LiveInterval * createInterval(llvm::Register Reg)
- private void dumpInstrs() const
- private void extendSegmentsToUses(llvm::LiveRange & Segments, llvm::LiveIntervals::ShrinkToUsesWorkList & WorkList, llvm::Register Reg, llvm::LaneBitmask LaneMask)
- public void extendToIndices(llvm::LiveRange & LR, ArrayRef<llvm::SlotIndex> Indices, ArrayRef<llvm::SlotIndex> Undefs)
- public void extendToIndices(llvm::LiveRange & LR, ArrayRef<llvm::SlotIndex> Indices)
- public void getAnalysisUsage(llvm::AnalysisUsage & AU) const
- public const llvm::LiveRange * getCachedRegUnit(unsigned int Unit) const
- public llvm::LiveRange * getCachedRegUnit(unsigned int Unit)
- public llvm::MachineInstr * getInstructionFromIndex(llvm::SlotIndex index) const
- public llvm::SlotIndex getInstructionIndex(const llvm::MachineInstr & Instr) const
- public llvm::LiveInterval & getInterval(llvm::Register Reg)
- public const llvm::LiveInterval & getInterval(llvm::Register Reg) const
- public llvm::SlotIndex getMBBEndIdx(const llvm::MachineBasicBlock * mbb) const
- public llvm::MachineBasicBlock * getMBBFromIndex(llvm::SlotIndex index) const
- public llvm::SlotIndex getMBBStartIdx(const llvm::MachineBasicBlock * mbb) const
- public ArrayRef<const uint32_t *> getRegMaskBits() const
- public ArrayRef<const uint32_t *> getRegMaskBitsInBlock(unsigned int MBBNum) const
- public ArrayRef<llvm::SlotIndex> getRegMaskSlots() const
- public ArrayRef<llvm::SlotIndex> getRegMaskSlotsInBlock(unsigned int MBBNum) const
- public llvm::LiveRange & getRegUnit(unsigned int Unit)
- public llvm::SlotIndexes * getSlotIndexes() const
- public static float getSpillWeight(bool isDef, bool isUse, const llvm::MachineBlockFrequencyInfo * MBFI, const llvm::MachineBasicBlock * MBB)
- public static float getSpillWeight(bool isDef, bool isUse, const llvm::MachineBlockFrequencyInfo * MBFI, const llvm::MachineInstr & MI)
- public VNInfo::Allocator & getVNInfoAllocator()
- public void handleMove(llvm::MachineInstr & MI, bool UpdateFlags = false)
- public void handleMoveIntoNewBundle(llvm::MachineInstr & BundleStart, bool UpdateFlags = false)
- public bool hasInterval(llvm::Register Reg) const
- public bool hasPHIKill(const llvm::LiveInterval & LI, const llvm::VNInfo * VNI) const
- public void insertMBBInMaps(llvm::MachineBasicBlock * MBB)
- public llvm::MachineBasicBlock * intervalIsInOneMBB(const llvm::LiveInterval & LI) const
- public bool isLiveInToMBB(const llvm::LiveRange & LR, const llvm::MachineBasicBlock * mbb) const
- public bool isLiveOutOfMBB(const llvm::LiveRange & LR, const llvm::MachineBasicBlock * mbb) const
- public bool isNotInMIMap(const llvm::MachineInstr & Instr) const
- public void print(llvm::raw_ostream & O, const llvm::Module * = nullptr) const
- private void printInstrs(llvm::raw_ostream & O) const
- public void pruneValue(llvm::LiveRange & LR, llvm::SlotIndex Kill, SmallVectorImpl<llvm::SlotIndex> * EndPoints)
- public void pruneValue(llvm::LiveInterval &, llvm::SlotIndex, SmallVectorImpl<llvm::SlotIndex> *)
- public void releaseMemory()
- public void removeAllRegUnitsForPhysReg(llvm::MCRegister Reg)
- public void removeInterval(llvm::Register Reg)
- public void removePhysRegDefAt(llvm::MCRegister Reg, llvm::SlotIndex Pos)
- public void removeRegUnit(unsigned int Unit)
- public void removeVRegDefAt(llvm::LiveInterval & LI, llvm::SlotIndex Pos)
- public void repairIntervalsInRange(llvm::MachineBasicBlock * MBB, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, ArrayRef<llvm::Register> OrigRegs)
- private void repairOldRegInRange(MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, const llvm::SlotIndex endIdx, llvm::LiveRange & LR, llvm::Register Reg, llvm::LaneBitmask LaneMask = LaneBitmask::getAll())
- public bool runOnMachineFunction(llvm::MachineFunction &)
- public void shrinkToUses(LiveInterval::SubRange & SR, llvm::Register Reg)
- public bool shrinkToUses(llvm::LiveInterval * li, SmallVectorImpl<llvm::MachineInstr *> * dead = nullptr)
- public void splitSeparateComponents(llvm::LiveInterval & LI, SmallVectorImpl<llvm::LiveInterval *> & SplitLIs)
- public ~LiveIntervals()
Inherited from MachineFunctionPass:
- public doInitialization
- protected getAnalysisUsage
- protected getClearedProperties
- protected getRequiredProperties
- protected getSetProperties
- protected runOnMachineFunction
Inherited from FunctionPass:
- public assignPassManager
- public createPrinterPass
- public getPotentialPassManagerType
- public runOnFunction
- protected skipFunction
Inherited from Pass:
- public assignPassManager
- public createPass
- public createPrinterPass
- public doFinalization
- public doInitialization
- public dump
- public dumpPassStructure
- public getAdjustedAnalysisPointer
- public getAnalysis
- public getAnalysis
- public getAnalysisID
- public getAnalysisID
- public getAnalysisIfAvailable
- public getAnalysisUsage
- public getAsImmutablePass
- public getAsPMDataManager
- public getPassID
- public getPassKind
- public getPassName
- public getPotentialPassManagerType
- public getResolver
- public lookupPassInfo
- public lookupPassInfo
- public mustPreserveAnalysisID
- public preparePassManager
- public print
- public releaseMemory
- public setResolver
- public verifyAnalysis
Methods
¶llvm::SlotIndex InsertMachineInstrInMaps(
llvm::MachineInstr& MI)
llvm::SlotIndex InsertMachineInstrInMaps(
llvm::MachineInstr& MI)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:260
Parameters
¶void InsertMachineInstrRangeInMaps(
MachineBasicBlock::iterator B,
MachineBasicBlock::iterator E)
void InsertMachineInstrRangeInMaps(
MachineBasicBlock::iterator B,
MachineBasicBlock::iterator E)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:264
Parameters
¶LiveIntervals()
LiveIntervals()
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:99
¶void RemoveMachineInstrFromMaps(
llvm::MachineInstr& MI)
void RemoveMachineInstrFromMaps(
llvm::MachineInstr& MI)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:270
Parameters
¶llvm::SlotIndex ReplaceMachineInstrInMaps(
llvm::MachineInstr& MI,
llvm::MachineInstr& NewMI)
llvm::SlotIndex ReplaceMachineInstrInMaps(
llvm::MachineInstr& MI,
llvm::MachineInstr& NewMI)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:274
Parameters
- llvm::MachineInstr& MI
- llvm::MachineInstr& NewMI
¶void addKillFlags(const llvm::VirtRegMap*)
void addKillFlags(const llvm::VirtRegMap*)
Description
Add kill flags to any instruction that kills a virtual register.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:298
Parameters
- const llvm::VirtRegMap*
¶LiveInterval::Segment addSegmentToEndOfBlock(
llvm::Register Reg,
llvm::MachineInstr& startInst)
LiveInterval::Segment addSegmentToEndOfBlock(
llvm::Register Reg,
llvm::MachineInstr& startInst)
Description
Given a register and an instruction, adds a live segment from that instruction to the end of its MBB.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:150
Parameters
- llvm::Register Reg
- llvm::MachineInstr& startInst
¶bool checkRegMaskInterference(
const llvm::LiveInterval& LI,
llvm::BitVector& UsableRegs)
bool checkRegMaskInterference(
const llvm::LiveInterval& LI,
llvm::BitVector& UsableRegs)
Description
Test if \p LI is live across any register mask instructions, and compute a bit mask of physical registers that are not clobbered by any of them. Returns false if \p LI doesn't cross any register mask instructions. In that case, the bit vector is not filled in.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:371
Parameters
- const llvm::LiveInterval& LI
- llvm::BitVector& UsableRegs
¶bool computeDeadValues(
llvm::LiveInterval& LI,
SmallVectorImpl<llvm::MachineInstr*>* dead)
bool computeDeadValues(
llvm::LiveInterval& LI,
SmallVectorImpl<llvm::MachineInstr*>* dead)
Description
Walk the values in \p LI and check for dead values: - Dead PHIDef values are marked as unused. - Dead operands are marked as such. - Completely dead machine instructions are added to the \p dead vector if it is not nullptr. Returns true if any PHI value numbers have been removed which may have separated the interval into multiple connected components.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:456
Parameters
- llvm::LiveInterval& LI
- SmallVectorImpl<llvm::MachineInstr*>* dead
¶void computeLiveInRegUnits()
void computeLiveInRegUnits()
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:464
¶void computeRegMasks()
void computeRegMasks()
Description
Compute RegMaskSlots and RegMaskBits.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:447
¶void computeRegUnitRange(llvm::LiveRange&,
unsigned int Unit)
void computeRegUnitRange(llvm::LiveRange&,
unsigned int Unit)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:465
Parameters
- llvm::LiveRange&
- unsigned int Unit
¶bool computeVirtRegInterval(llvm::LiveInterval&)
bool computeVirtRegInterval(llvm::LiveInterval&)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:466
Parameters
¶void computeVirtRegs()
void computeVirtRegs()
Description
Compute live intervals for all virtual registers.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:444
¶void constructMainRangeFromSubranges(
llvm::LiveInterval& LI)
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/LiveIntervals.h:440
Parameters
¶llvm::LiveInterval&
createAndComputeVirtRegInterval(
llvm::Register Reg)
llvm::LiveInterval&
createAndComputeVirtRegInterval(
llvm::Register Reg)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:136
Parameters
- llvm::Register Reg
¶llvm::LiveInterval& createEmptyInterval(
llvm::Register Reg)
llvm::LiveInterval& createEmptyInterval(
llvm::Register Reg)
Description
Interval creation.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:129
Parameters
- llvm::Register Reg
¶static llvm::LiveInterval* createInterval(
llvm::Register Reg)
static llvm::LiveInterval* createInterval(
llvm::Register Reg)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:459
Parameters
- llvm::Register Reg
¶void dumpInstrs() const
void dumpInstrs() const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:462
¶void extendSegmentsToUses(
llvm::LiveRange& Segments,
llvm::LiveIntervals::ShrinkToUsesWorkList&
WorkList,
llvm::Register Reg,
llvm::LaneBitmask LaneMask)
void extendSegmentsToUses(
llvm::LiveRange& Segments,
llvm::LiveIntervals::ShrinkToUsesWorkList&
WorkList,
llvm::Register Reg,
llvm::LaneBitmask LaneMask)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:469
Parameters
- llvm::LiveRange& Segments
- llvm::LiveIntervals::ShrinkToUsesWorkList& WorkList
- llvm::Register Reg
- llvm::LaneBitmask LaneMask
¶void extendToIndices(
llvm::LiveRange& LR,
ArrayRef<llvm::SlotIndex> Indices,
ArrayRef<llvm::SlotIndex> Undefs)
void extendToIndices(
llvm::LiveRange& LR,
ArrayRef<llvm::SlotIndex> Indices,
ArrayRef<llvm::SlotIndex> Undefs)
Description
Extend the live range \p LR to reach all points in \p Indices. The points in the \p Indices array must be jointly dominated by the union of the existing defs in \p LR and points in \p Undefs. PHI-defs are added as needed to maintain SSA form. If a SlotIndex in \p Indices is the end index of a basic block, \p LR will be extended to be live out of the basic block. If a SlotIndex in \p Indices is jointy dominated only by points in\p Undefs, the live range will not be extended to that point. See also LiveRangeCalc::extend().
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:182
Parameters
- llvm::LiveRange& LR
- ArrayRef<llvm::SlotIndex> Indices
- ArrayRef<llvm::SlotIndex> Undefs
¶void extendToIndices(
llvm::LiveRange& LR,
ArrayRef<llvm::SlotIndex> Indices)
void extendToIndices(
llvm::LiveRange& LR,
ArrayRef<llvm::SlotIndex> Indices)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:185
Parameters
- llvm::LiveRange& LR
- ArrayRef<llvm::SlotIndex> Indices
¶void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
Description
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:280
Parameters
¶const llvm::LiveRange* getCachedRegUnit(
unsigned int Unit) const
const llvm::LiveRange* getCachedRegUnit(
unsigned int Unit) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:404
Parameters
- unsigned int Unit
¶llvm::LiveRange* getCachedRegUnit(
unsigned int Unit)
llvm::LiveRange* getCachedRegUnit(
unsigned int Unit)
Description
Return the live range for register unit \p Unit if it has already been computed, or nullptr if it hasn't been computed yet.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:400
Parameters
- unsigned int Unit
¶llvm::MachineInstr* getInstructionFromIndex(
llvm::SlotIndex index) const
llvm::MachineInstr* getInstructionFromIndex(
llvm::SlotIndex index) const
Description
Returns the instruction associated with the given index.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:225
Parameters
- llvm::SlotIndex index
¶llvm::SlotIndex getInstructionIndex(
const llvm::MachineInstr& Instr) const
llvm::SlotIndex getInstructionIndex(
const llvm::MachineInstr& Instr) const
Description
Returns the base index of the given instruction.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:220
Parameters
- const llvm::MachineInstr& Instr
¶llvm::LiveInterval& getInterval(
llvm::Register Reg)
llvm::LiveInterval& getInterval(
llvm::Register Reg)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:112
Parameters
- llvm::Register Reg
¶const llvm::LiveInterval& getInterval(
llvm::Register Reg) const
const llvm::LiveInterval& getInterval(
llvm::Register Reg) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:119
Parameters
- llvm::Register Reg
¶llvm::SlotIndex getMBBEndIdx(
const llvm::MachineBasicBlock* mbb) const
llvm::SlotIndex getMBBEndIdx(
const llvm::MachineBasicBlock* mbb) const
Description
Return the last index in the given basic block.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:235
Parameters
- const llvm::MachineBasicBlock* mbb
¶llvm::MachineBasicBlock* getMBBFromIndex(
llvm::SlotIndex index) const
llvm::MachineBasicBlock* getMBBFromIndex(
llvm::SlotIndex index) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:249
Parameters
- llvm::SlotIndex index
¶llvm::SlotIndex getMBBStartIdx(
const llvm::MachineBasicBlock* mbb) const
llvm::SlotIndex getMBBStartIdx(
const llvm::MachineBasicBlock* mbb) const
Description
Return the first index in the given basic block.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:230
Parameters
- const llvm::MachineBasicBlock* mbb
¶ArrayRef<const uint32_t*> getRegMaskBits() const
ArrayRef<const uint32_t*> getRegMaskBits() const
Description
Returns an array of register mask pointers corresponding to getRegMaskSlots().
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:356
¶ArrayRef<const uint32_t*> getRegMaskBitsInBlock(
unsigned int MBBNum) const
ArrayRef<const uint32_t*> getRegMaskBitsInBlock(
unsigned int MBBNum) const
Description
Returns an array of mask pointers corresponding to getRegMaskSlotsInBlock(MBBNum).
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:360
Parameters
- unsigned int MBBNum
¶ArrayRef<llvm::SlotIndex> getRegMaskSlots() const
ArrayRef<llvm::SlotIndex> getRegMaskSlots() const
Description
Returns a sorted array of slot indices of all instructions with register mask operands.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:345
¶ArrayRef<llvm::SlotIndex> getRegMaskSlotsInBlock(
unsigned int MBBNum) const
ArrayRef<llvm::SlotIndex> getRegMaskSlotsInBlock(
unsigned int MBBNum) const
Description
Returns a sorted array of slot indices of all instructions with register mask operands in the basic block numbered \p MBBNum.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:349
Parameters
- unsigned int MBBNum
¶llvm::LiveRange& getRegUnit(unsigned int Unit)
llvm::LiveRange& getRegUnit(unsigned int Unit)
Description
Return the live range for register unit \p Unit. It will be computed if it doesn't exist.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:387
Parameters
- unsigned int Unit
¶llvm::SlotIndexes* getSlotIndexes() const
llvm::SlotIndexes* getSlotIndexes() const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:209
¶static float getSpillWeight(
bool isDef,
bool isUse,
const llvm::MachineBlockFrequencyInfo* MBFI,
const llvm::MachineBasicBlock* MBB)
static float getSpillWeight(
bool isDef,
bool isUse,
const llvm::MachineBlockFrequencyInfo* MBFI,
const llvm::MachineBasicBlock* MBB)
Description
Calculate the spill weight to assign to a single instruction.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:108
Parameters
- bool isDef
- bool isUse
- const llvm::MachineBlockFrequencyInfo* MBFI
- const llvm::MachineBasicBlock* MBB
¶static float getSpillWeight(
bool isDef,
bool isUse,
const llvm::MachineBlockFrequencyInfo* MBFI,
const llvm::MachineInstr& MI)
static float getSpillWeight(
bool isDef,
bool isUse,
const llvm::MachineBlockFrequencyInfo* MBFI,
const llvm::MachineInstr& MI)
Description
Calculate the spill weight to assign to a single instruction.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:103
Parameters
- bool isDef
- bool isUse
- const llvm::MachineBlockFrequencyInfo* MBFI
- const llvm::MachineInstr& MI
¶VNInfo::Allocator& getVNInfoAllocator()
VNInfo::Allocator& getVNInfoAllocator()
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:278
¶void handleMove(llvm::MachineInstr& MI,
bool UpdateFlags = false)
void handleMove(llvm::MachineInstr& MI,
bool UpdateFlags = false)
Description
Call this method to notify LiveIntervals that instruction \p MI has been moved within a basic block. This will update the live intervals for all operands of \p MI. Moves between basic blocks are not supported.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:305
Parameters
- llvm::MachineInstr& MI
- bool UpdateFlags = false
- Update live intervals for nonallocatable physregs.
¶void handleMoveIntoNewBundle(
llvm::MachineInstr& BundleStart,
bool UpdateFlags = false)
void handleMoveIntoNewBundle(
llvm::MachineInstr& BundleStart,
bool UpdateFlags = false)
Description
Update intervals of operands of all instructions in the newly created bundle specified by \p BundleStart. Assumes existing liveness is accurate.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:315
Parameters
- llvm::MachineInstr& BundleStart
- bool UpdateFlags = false
- Update live intervals for nonallocatable physregs.
¶bool hasInterval(llvm::Register Reg) const
bool hasInterval(llvm::Register Reg) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:123
Parameters
- llvm::Register Reg
¶bool hasPHIKill(const llvm::LiveInterval& LI,
const llvm::VNInfo* VNI) const
bool hasPHIKill(const llvm::LiveInterval& LI,
const llvm::VNInfo* VNI) const
Description
Returns true if VNI is killed by any PHI-def values in LI. This may conservatively return true to avoid expensive computations.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:295
Parameters
- const llvm::LiveInterval& LI
- const llvm::VNInfo* VNI
¶void insertMBBInMaps(llvm::MachineBasicBlock* MBB)
void insertMBBInMaps(llvm::MachineBasicBlock* MBB)
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:253
Parameters
¶llvm::MachineBasicBlock* intervalIsInOneMBB(
const llvm::LiveInterval& LI) const
llvm::MachineBasicBlock* intervalIsInOneMBB(
const llvm::LiveInterval& LI) const
Description
If LI is confined to a single basic block, return a pointer to that block. If LI is live in to or out of any block, return NULL.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:291
Parameters
- const llvm::LiveInterval& LI
¶bool isLiveInToMBB(
const llvm::LiveRange& LR,
const llvm::MachineBasicBlock* mbb) const
bool isLiveInToMBB(
const llvm::LiveRange& LR,
const llvm::MachineBasicBlock* mbb) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:239
Parameters
- const llvm::LiveRange& LR
- const llvm::MachineBasicBlock* mbb
¶bool isLiveOutOfMBB(
const llvm::LiveRange& LR,
const llvm::MachineBasicBlock* mbb) const
bool isLiveOutOfMBB(
const llvm::LiveRange& LR,
const llvm::MachineBasicBlock* mbb) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:244
Parameters
- const llvm::LiveRange& LR
- const llvm::MachineBasicBlock* mbb
¶bool isNotInMIMap(
const llvm::MachineInstr& Instr) const
bool isNotInMIMap(
const llvm::MachineInstr& Instr) const
Description
Returns true if the specified machine instr has been removed or was never entered in the map.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:215
Parameters
- const llvm::MachineInstr& Instr
¶void print(llvm::raw_ostream& O,
const llvm::Module* = nullptr) const
void print(llvm::raw_ostream& O,
const llvm::Module* = nullptr) const
Description
Implement the dump method.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:287
Parameters
- llvm::raw_ostream& O
- const llvm::Module* = nullptr
¶void printInstrs(llvm::raw_ostream& O) const
void printInstrs(llvm::raw_ostream& O) const
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:461
Parameters
¶void pruneValue(
llvm::LiveRange& LR,
llvm::SlotIndex Kill,
SmallVectorImpl<llvm::SlotIndex>* EndPoints)
void pruneValue(
llvm::LiveRange& LR,
llvm::SlotIndex Kill,
SmallVectorImpl<llvm::SlotIndex>* EndPoints)
Description
If \p LR has a live value at \p Kill, prune its live range by removing any liveness reachable from Kill. Add live range end points to EndPoints such that extendToIndices(LI, EndPoints) will reconstruct the value's live range. Calling pruneValue() and extendToIndices() can be used to reconstruct SSA form after adding defs to a virtual register.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:196
Parameters
- llvm::LiveRange& LR
- llvm::SlotIndex Kill
- SmallVectorImpl<llvm::SlotIndex>* EndPoints
¶void pruneValue(llvm::LiveInterval&,
llvm::SlotIndex,
SmallVectorImpl<llvm::SlotIndex>*)
void pruneValue(llvm::LiveInterval&,
llvm::SlotIndex,
SmallVectorImpl<llvm::SlotIndex>*)
Description
This function should not be used. Its intent is to tell you that you are doing something wrong if you call pruneValue directly on a LiveInterval. Indeed, you are supposed to call pruneValue on the main LiveRange and all the LiveRanges of the subranges if any.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:203
Parameters
- llvm::LiveInterval&
- llvm::SlotIndex
- SmallVectorImpl<llvm::SlotIndex>*
¶void releaseMemory()
void releaseMemory()
Description
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused. Optionally implement this function to release pass memory when it is no longer used.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:281
¶void removeAllRegUnitsForPhysReg(
llvm::MCRegister Reg)
void removeAllRegUnitsForPhysReg(
llvm::MCRegister Reg)
Description
Remove associated live ranges for the register units associated with \p Reg. Subsequent uses should rely on on-demand recomputation.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:419
Parameters
- llvm::MCRegister Reg
¶void removeInterval(llvm::Register Reg)
void removeInterval(llvm::Register Reg)
Description
Interval removal.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:143
Parameters
- llvm::Register Reg
¶void removePhysRegDefAt(llvm::MCRegister Reg,
llvm::SlotIndex Pos)
void removePhysRegDefAt(llvm::MCRegister Reg,
llvm::SlotIndex Pos)
Description
Remove value numbers and related live segments starting at position\p Pos that are part of any liverange of physical register \p Reg or one of its subregisters.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:427
Parameters
- llvm::MCRegister Reg
- llvm::SlotIndex Pos
¶void removeRegUnit(unsigned int Unit)
void removeRegUnit(unsigned int Unit)
Description
Remove computed live range for register unit \p Unit. Subsequent uses should rely on on-demand recomputation.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:410
Parameters
- unsigned int Unit
¶void removeVRegDefAt(llvm::LiveInterval& LI,
llvm::SlotIndex Pos)
void removeVRegDefAt(llvm::LiveInterval& LI,
llvm::SlotIndex Pos)
Description
Remove value number and related live segments of \p LI and its subranges that start at position \p Pos.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:431
Parameters
¶void repairIntervalsInRange(
llvm::MachineBasicBlock* MBB,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
ArrayRef<llvm::Register> OrigRegs)
void repairIntervalsInRange(
llvm::MachineBasicBlock* MBB,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
ArrayRef<llvm::Register> OrigRegs)
Description
Update live intervals for instructions in a range of iterators. It is intended for use after target hooks that may insert or remove instructions, and is only efficient for a small number of instructions. OrigRegs is a vector of registers that were originally used by the instructions in the range between the two iterators. Currently, the only only changes that are supported are simple removal and addition of uses.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:327
Parameters
- llvm::MachineBasicBlock* MBB
- MachineBasicBlock::iterator Begin
- MachineBasicBlock::iterator End
- ArrayRef<llvm::Register> OrigRegs
¶void repairOldRegInRange(
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
const llvm::SlotIndex endIdx,
llvm::LiveRange& LR,
llvm::Register Reg,
llvm::LaneBitmask LaneMask =
LaneBitmask::getAll())
void repairOldRegInRange(
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
const llvm::SlotIndex endIdx,
llvm::LiveRange& LR,
llvm::Register Reg,
llvm::LaneBitmask LaneMask =
LaneBitmask::getAll())
Description
Helper function for repairIntervalsInRange(), walks backwards and creates/modifies live segments in \p LR to match the operands found. Only full operands or operands with subregisters matching \p LaneMask are considered.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:477
Parameters
- MachineBasicBlock::iterator Begin
- MachineBasicBlock::iterator End
- const llvm::SlotIndex endIdx
- llvm::LiveRange& LR
- llvm::Register Reg
- llvm::LaneBitmask LaneMask = LaneBitmask::getAll()
¶bool runOnMachineFunction(llvm::MachineFunction&)
bool runOnMachineFunction(llvm::MachineFunction&)
Description
Pass entry point; Calculates LiveIntervals.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:284
Parameters
¶void shrinkToUses(LiveInterval::SubRange& SR,
llvm::Register Reg)
void shrinkToUses(LiveInterval::SubRange& SR,
llvm::Register Reg)
Description
Specialized version of shrinkToUses(LiveInterval *li, SmallVectorImpl <MachineInstr *> *dead) that works on a subregister live range and only looks at uses matching the lane mask of the subregister range. This may leave the subrange empty which needs to be cleaned up with LiveInterval::removeEmptySubranges() afterwards.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:168
Parameters
¶bool shrinkToUses(
llvm::LiveInterval* li,
SmallVectorImpl<llvm::MachineInstr*>* dead =
nullptr)
bool shrinkToUses(
llvm::LiveInterval* li,
SmallVectorImpl<llvm::MachineInstr*>* dead =
nullptr)
Description
After removing some uses of a register, shrink its live range to just the remaining uses. This method does not compute reaching defs for new uses, and it doesn't remove dead defs. Dead PHIDef values are marked as unused. New dead machine instructions are added to the dead vector. Returns true if the interval may have been separated into multiple connected components.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:159
Parameters
- llvm::LiveInterval* li
- SmallVectorImpl<llvm::MachineInstr*>* dead = nullptr
¶void splitSeparateComponents(
llvm::LiveInterval& LI,
SmallVectorImpl<llvm::LiveInterval*>&
SplitLIs)
void splitSeparateComponents(
llvm::LiveInterval& LI,
SmallVectorImpl<llvm::LiveInterval*>&
SplitLIs)
Description
Split separate components in LiveInterval \p LI into separate intervals.
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:434
Parameters
- llvm::LiveInterval& LI
- SmallVectorImpl<llvm::LiveInterval*>& SplitLIs
¶~LiveIntervals()
~LiveIntervals()
Declared at: llvm/include/llvm/CodeGen/LiveIntervals.h:100