Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
llvm::LiveIntervals Class Reference

#include "llvm/CodeGen/LiveIntervals.h"

Classes

class  HMEditor
 Toolkit used by handleMove to trim or extend live intervals. More...

Public Member Functions

 LiveIntervals (LiveIntervals &&)=default
LLVM_ABI ~LiveIntervals ()
LLVM_ABI bool invalidate (MachineFunction &MF, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &Inv)
LiveIntervalgetInterval (Register Reg)
const LiveIntervalgetInterval (Register Reg) const
bool hasInterval (Register Reg) const
LiveIntervalcreateEmptyInterval (Register Reg)
 Interval creation.
LiveIntervalcreateAndComputeVirtRegInterval (Register Reg)
LiveIntervalgetOrCreateEmptyInterval (Register Reg)
 Return an existing interval for Reg.
void removeInterval (Register Reg)
 Interval removal.
LLVM_ABI LiveInterval::Segment addSegmentToEndOfBlock (Register Reg, MachineInstr &startInst)
 Given a register and an instruction, adds a live segment from that instruction to the end of its MBB.
LLVM_ABI bool shrinkToUses (LiveInterval *li, SmallVectorImpl< MachineInstr * > *dead=nullptr)
 After removing some uses of a register, shrink its live range to just the remaining uses.
LLVM_ABI void shrinkToUses (LiveInterval::SubRange &SR, Register Reg)
 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.
LLVM_ABI void extendToIndices (LiveRange &LR, ArrayRef< SlotIndex > Indices, ArrayRef< SlotIndex > Undefs)
 Extend the live range LR to reach all points in Indices.
void extendToIndices (LiveRange &LR, ArrayRef< SlotIndex > Indices)
LLVM_ABI void pruneValue (LiveRange &LR, SlotIndex Kill, SmallVectorImpl< SlotIndex > *EndPoints)
 If LR has a live value at Kill, prune its live range by removing any liveness reachable from Kill.
LLVM_ATTRIBUTE_UNUSED void pruneValue (LiveInterval &, SlotIndex, SmallVectorImpl< SlotIndex > *)
 This function should not be used.
SlotIndexesgetSlotIndexes () const
bool isNotInMIMap (const MachineInstr &Instr) const
 Returns true if the specified machine instr has been removed or was never entered in the map.
SlotIndex getInstructionIndex (const MachineInstr &Instr) const
 Returns the base index of the given instruction.
MachineInstrgetInstructionFromIndex (SlotIndex index) const
 Returns the instruction associated with the given index.
SlotIndex getMBBStartIdx (const MachineBasicBlock *mbb) const
 Return the first index in the given basic block.
SlotIndex getMBBEndIdx (const MachineBasicBlock *mbb) const
 Return the last index in the given basic block.
bool isLiveInToMBB (const LiveRange &LR, const MachineBasicBlock *mbb) const
bool isLiveOutOfMBB (const LiveRange &LR, const MachineBasicBlock *mbb) const
MachineBasicBlockgetMBBFromIndex (SlotIndex index) const
void insertMBBInMaps (MachineBasicBlock *MBB)
SlotIndex InsertMachineInstrInMaps (MachineInstr &MI)
void InsertMachineInstrRangeInMaps (MachineBasicBlock::iterator B, MachineBasicBlock::iterator E)
void RemoveMachineInstrFromMaps (MachineInstr &MI)
SlotIndex ReplaceMachineInstrInMaps (MachineInstr &MI, MachineInstr &NewMI)
VNInfo::AllocatorgetVNInfoAllocator ()
LLVM_ABI void print (raw_ostream &O) const
 Implement the dump method.
LLVM_ABI void dump () const
void reanalyze (MachineFunction &MF)
MachineDominatorTreegetDomTree ()
LLVM_ABI MachineBasicBlockintervalIsInOneMBB (const LiveInterval &LI) const
 If LI is confined to a single basic block, return a pointer to that block.
LLVM_ABI bool hasPHIKill (const LiveInterval &LI, const VNInfo *VNI) const
 Returns true if VNI is killed by any PHI-def values in LI.
LLVM_ABI void addKillFlags (const VirtRegMap *)
 Add kill flags to any instruction that kills a virtual register.
LLVM_ABI void handleMove (MachineInstr &MI, bool UpdateFlags=false)
 Call this method to notify LiveIntervals that instruction MI has been moved within a basic block.
LLVM_ABI void handleMoveIntoNewBundle (MachineInstr &BundleStart, bool UpdateFlags=false)
 Update intervals of operands of all instructions in the newly created bundle specified by BundleStart.
LLVM_ABI void repairIntervalsInRange (MachineBasicBlock *MBB, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, ArrayRef< Register > OrigRegs)
 Update live intervals for instructions in a range of iterators.
ArrayRef< SlotIndexgetRegMaskSlots () const
 Returns a sorted array of slot indices of all instructions with register mask operands.
ArrayRef< SlotIndexgetRegMaskSlotsInBlock (unsigned MBBNum) const
 Returns a sorted array of slot indices of all instructions with register mask operands in the basic block numbered MBBNum.
ArrayRef< const uint32_t * > getRegMaskBits () const
 Returns an array of register mask pointers corresponding to getRegMaskSlots().
ArrayRef< const uint32_t * > getRegMaskBitsInBlock (unsigned MBBNum) const
 Returns an array of mask pointers corresponding to getRegMaskSlotsInBlock(MBBNum).
LLVM_ABI bool checkRegMaskInterference (const LiveInterval &LI, BitVector &UsableRegs)
 Test if LI is live across any register mask instructions, and compute a bit mask of physical registers that are not clobbered by any of them.
LiveRangegetRegUnit (unsigned Unit)
 Return the live range for register unit Unit.
LiveRangegetCachedRegUnit (unsigned Unit)
 Return the live range for register unit Unit if it has already been computed, or nullptr if it hasn't been computed yet.
const LiveRangegetCachedRegUnit (unsigned Unit) const
void removeRegUnit (unsigned Unit)
 Remove computed live range for register unit Unit.
void removeAllRegUnitsForPhysReg (MCRegister Reg)
 Remove associated live ranges for the register units associated with Reg.
LLVM_ABI void removePhysRegDefAt (MCRegister Reg, SlotIndex Pos)
 Remove value numbers and related live segments starting at position Pos that are part of any liverange of physical register Reg or one of its subregisters.
LLVM_ABI void removeVRegDefAt (LiveInterval &LI, SlotIndex Pos)
 Remove value number and related live segments of LI and its subranges that start at position Pos.
LLVM_ABI void splitSeparateComponents (LiveInterval &LI, SmallVectorImpl< LiveInterval * > &SplitLIs)
 Split separate components in LiveInterval LI into separate intervals.
LLVM_ABI void constructMainRangeFromSubranges (LiveInterval &LI)
 For live interval LI with correct SubRanges construct matching information for the main live range.

Static Public Member Functions

static LLVM_ABI float getSpillWeight (bool isDef, bool isUse, const MachineBlockFrequencyInfo *MBFI, const MachineInstr &MI, ProfileSummaryInfo *PSI=nullptr)
 Calculate the spill weight to assign to a single instruction.
static LLVM_ABI float getSpillWeight (bool isDef, bool isUse, const MachineBlockFrequencyInfo *MBFI, const MachineBasicBlock *MBB, ProfileSummaryInfo *PSI=nullptr)
 Calculate the spill weight to assign to a single instruction.

Friends

class LiveIntervalsAnalysis
class LiveIntervalsWrapperPass

Detailed Description

Definition at line 55 of file LiveIntervals.h.

Constructor & Destructor Documentation

◆ LiveIntervals()

llvm::LiveIntervals::LiveIntervals ( LiveIntervals && )
default

References LLVM_ABI, MBB, and MI.

◆ ~LiveIntervals()

LiveIntervals::~LiveIntervals ( )

Definition at line 128 of file LiveIntervals.cpp.

Member Function Documentation

◆ addKillFlags()

◆ addSegmentToEndOfBlock()

LiveRange::Segment LiveIntervals::addSegmentToEndOfBlock ( Register Reg,
MachineInstr & startInst )

Given a register and an instruction, adds a live segment from that instruction to the end of its MBB.

Definition at line 922 of file LiveIntervals.cpp.

References getInstructionIndex(), getMBBEndIdx(), getOrCreateEmptyInterval(), llvm::MachineInstr::getParent(), and getVNInfoAllocator().

◆ checkRegMaskInterference()

bool LiveIntervals::checkRegMaskInterference ( const LiveInterval & LI,
BitVector & UsableRegs )

Test if 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 LI doesn't cross any register mask instructions. In that case, the bit vector is not filled in.

Definition at line 955 of file LiveIntervals.cpp.

References assert(), llvm::ArrayRef< T >::begin(), llvm::LiveRange::begin(), llvm::BitVector::clear(), llvm::BitVector::clearBitsNotInMask(), llvm::LiveRange::empty(), llvm::ArrayRef< T >::end(), llvm::LiveRange::end(), llvm::LiveRange::endIndex(), getInstructionFromIndex(), getRegMaskBits(), getRegMaskBitsInBlock(), getRegMaskSlots(), getRegMaskSlotsInBlock(), hasLiveThroughUse(), intervalIsInOneMBB(), llvm::lower_bound(), MBB, MI, llvm::LiveInterval::reg(), and llvm::BitVector::resize().

◆ constructMainRangeFromSubranges()

void LiveIntervals::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 1818 of file LiveIntervals.cpp.

References assert(), getSlotIndexes(), and getVNInfoAllocator().

◆ createAndComputeVirtRegInterval()

LiveInterval & llvm::LiveIntervals::createAndComputeVirtRegInterval ( Register Reg)
inline

◆ createEmptyInterval()

LiveInterval & llvm::LiveIntervals::createEmptyInterval ( Register Reg)
inline

◆ dump()

LLVM_DUMP_METHOD void LiveIntervals::dump ( ) const

Definition at line 220 of file LiveIntervals.cpp.

References llvm::dbgs(), LLVM_DUMP_METHOD, and print().

◆ extendToIndices() [1/2]

void llvm::LiveIntervals::extendToIndices ( LiveRange & LR,
ArrayRef< SlotIndex > Indices )
inline

Definition at line 214 of file LiveIntervals.h.

References extendToIndices().

◆ extendToIndices() [2/2]

void LiveIntervals::extendToIndices ( LiveRange & LR,
ArrayRef< SlotIndex > Indices,
ArrayRef< SlotIndex > Undefs )

Extend the live range LR to reach all points in Indices.

The points in the Indices array must be jointly dominated by the union of the existing defs in LR and points in Undefs.

PHI-defs are added as needed to maintain SSA form.

If a SlotIndex in Indices is the end index of a basic block, LR will be extended to be live out of the basic block. If a SlotIndex in Indices is jointy dominated only by points in Undefs, the live range will not be extended to that point.

See also LiveRangeCalc::extend().

Definition at line 656 of file LiveIntervals.cpp.

References assert(), getSlotIndexes(), and getVNInfoAllocator().

Referenced by extendToIndices(), and replaceDominatedUses().

◆ getCachedRegUnit() [1/2]

LiveRange * llvm::LiveIntervals::getCachedRegUnit ( unsigned Unit)
inline

Return the live range for register unit Unit if it has already been computed, or nullptr if it hasn't been computed yet.

Definition at line 428 of file LiveIntervals.h.

Referenced by getLanesWithProperty(), getLanesWithProperty(), getLiveRange(), and removePhysRegDefAt().

◆ getCachedRegUnit() [2/2]

const LiveRange * llvm::LiveIntervals::getCachedRegUnit ( unsigned Unit) const
inline

Definition at line 430 of file LiveIntervals.h.

◆ getDomTree()

MachineDominatorTree & llvm::LiveIntervals::getDomTree ( )
inline

Definition at line 315 of file LiveIntervals.h.

Referenced by llvm::SIRegisterInfo::findReachingDef().

◆ getInstructionFromIndex()

MachineInstr * llvm::LiveIntervals::getInstructionFromIndex ( SlotIndex index) const
inline

Returns the instruction associated with the given index.

Definition at line 252 of file LiveIntervals.h.

Referenced by addKillFlags(), checkRegMaskInterference(), findInsertLocation(), llvm::SIRegisterInfo::findReachingDef(), getVRegDef(), and llvm::SystemZRegisterInfo::shouldCoalesce().

◆ getInstructionIndex()

◆ getInterval() [1/2]

◆ getInterval() [2/2]

const LiveInterval & llvm::LiveIntervals::getInterval ( Register Reg) const
inline

Definition at line 140 of file LiveIntervals.h.

References getInterval(), and Reg.

◆ getMBBEndIdx()

SlotIndex llvm::LiveIntervals::getMBBEndIdx ( const MachineBasicBlock * mbb) const
inline

Return the last index in the given basic block.

Definition at line 262 of file LiveIntervals.h.

Referenced by addSegmentToEndOfBlock(), handleMove(), isLiveOutOfMBB(), and repairIntervalsInRange().

◆ getMBBFromIndex()

MachineBasicBlock * llvm::LiveIntervals::getMBBFromIndex ( SlotIndex index) const
inline

Definition at line 274 of file LiveIntervals.h.

Referenced by hasPHIKill().

◆ getMBBStartIdx()

SlotIndex llvm::LiveIntervals::getMBBStartIdx ( const MachineBasicBlock * mbb) const
inline

Return the first index in the given basic block.

Definition at line 257 of file LiveIntervals.h.

Referenced by findInsertLocation(), handleMove(), and isLiveInToMBB().

◆ getOrCreateEmptyInterval()

LiveInterval & llvm::LiveIntervals::getOrCreateEmptyInterval ( Register Reg)
inline

Return an existing interval for Reg.

If Reg has no interval then this creates a new empty one instead. Note: does not trigger interval computation.

Definition at line 166 of file LiveIntervals.h.

References createEmptyInterval(), getInterval(), hasInterval(), and Reg.

Referenced by addSegmentToEndOfBlock().

◆ getRegMaskBits()

ArrayRef< const uint32_t * > llvm::LiveIntervals::getRegMaskBits ( ) const
inline

Returns an array of register mask pointers corresponding to getRegMaskSlots().

Definition at line 384 of file LiveIntervals.h.

Referenced by checkRegMaskInterference(), and getRegMaskBitsInBlock().

◆ getRegMaskBitsInBlock()

ArrayRef< const uint32_t * > llvm::LiveIntervals::getRegMaskBitsInBlock ( unsigned MBBNum) const
inline

Returns an array of mask pointers corresponding to getRegMaskSlotsInBlock(MBBNum).

Definition at line 388 of file LiveIntervals.h.

References getRegMaskBits(), and P.

Referenced by checkRegMaskInterference().

◆ getRegMaskSlots()

ArrayRef< SlotIndex > llvm::LiveIntervals::getRegMaskSlots ( ) const
inline

Returns a sorted array of slot indices of all instructions with register mask operands.

Definition at line 373 of file LiveIntervals.h.

Referenced by checkRegMaskInterference(), and getRegMaskSlotsInBlock().

◆ getRegMaskSlotsInBlock()

ArrayRef< SlotIndex > llvm::LiveIntervals::getRegMaskSlotsInBlock ( unsigned MBBNum) const
inline

Returns a sorted array of slot indices of all instructions with register mask operands in the basic block numbered MBBNum.

Definition at line 377 of file LiveIntervals.h.

References getRegMaskSlots(), and P.

Referenced by checkRegMaskInterference().

◆ getRegUnit()

LiveRange & llvm::LiveIntervals::getRegUnit ( unsigned Unit)
inline

Return the live range for register unit Unit.

It will be computed if it doesn't exist.

Definition at line 415 of file LiveIntervals.h.

References LiveRange, and llvm::UseSegmentSetForPhysRegs.

Referenced by addKillFlags(), llvm::SIRegisterInfo::findReachingDef(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), and isDefBetween().

◆ getSlotIndexes()

◆ getSpillWeight() [1/2]

float LiveIntervals::getSpillWeight ( bool isDef,
bool isUse,
const MachineBlockFrequencyInfo * MBFI,
const MachineBasicBlock * MBB,
ProfileSummaryInfo * PSI = nullptr )
static

Calculate the spill weight to assign to a single instruction.

If PSI is provided the calculation is altered for optsize functions.

Definition at line 908 of file LiveIntervals.cpp.

References llvm::MachineBlockFrequencyInfo::getBlockFreqRelativeToEntryBlock(), MBB, and llvm::shouldOptimizeForSize().

◆ getSpillWeight() [2/2]

float LiveIntervals::getSpillWeight ( bool isDef,
bool isUse,
const MachineBlockFrequencyInfo * MBFI,
const MachineInstr & MI,
ProfileSummaryInfo * PSI = nullptr )
static

Calculate the spill weight to assign to a single instruction.

If PSI is provided the calculation is altered for optsize functions.

Definition at line 901 of file LiveIntervals.cpp.

References getSpillWeight(), and MI.

Referenced by computeWeight(), getSpillWeight(), and llvm::VirtRegAuxInfo::weightCalcHelper().

◆ getVNInfoAllocator()

VNInfo::Allocator & llvm::LiveIntervals::getVNInfoAllocator ( )
inline

◆ handleMove()

void LiveIntervals::handleMove ( MachineInstr & MI,
bool UpdateFlags = false )

Call this method to notify LiveIntervals that instruction MI has been moved within a basic block.

This will update the live intervals for all operands of MI. Moves between basic blocks are not supported.

Parameters
UpdateFlagsUpdate live intervals for nonallocatable physregs.

Definition at line 1559 of file LiveIntervals.cpp.

References assert(), getMBBEndIdx(), getMBBStartIdx(), MI, and llvm::LiveIntervals::HMEditor::updateAllRanges().

Referenced by moveAndTeeForMultiUse(), and moveForSingleUse().

◆ handleMoveIntoNewBundle()

void LiveIntervals::handleMoveIntoNewBundle ( MachineInstr & BundleStart,
bool UpdateFlags = false )

Update intervals of operands of all instructions in the newly created bundle specified by BundleStart.

Parameters
UpdateFlagsUpdate live intervals for nonallocatable physregs.

Assumes existing liveness is accurate.

Precondition
BundleStart should be the first instruction in the Bundle.
BundleStart should not have a have SlotIndex as one will be assigned.

Definition at line 1575 of file LiveIntervals.cpp.

References assert(), llvm::getBundleEnd(), getInstructionIndex(), getInterval(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getOpcode(), hasInterval(), I, llvm::LiveQueryResult::isDeadDef(), llvm::MachineInstr::operands(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveRange::Query(), and llvm::LiveIntervals::HMEditor::updateAllRanges().

◆ hasInterval()

◆ hasPHIKill()

bool LiveIntervals::hasPHIKill ( const LiveInterval & LI,
const VNInfo * VNI ) const

Returns true if VNI is killed by any PHI-def values in LI.

This may conservatively return true to avoid expensive computations.

Definition at line 886 of file LiveIntervals.cpp.

References getMBBFromIndex(), llvm::LiveRange::getVNInfoBefore(), PHI, llvm::MachineBasicBlock::pred_size(), llvm::MachineBasicBlock::predecessors(), and llvm::LiveRange::valnos.

◆ InsertMachineInstrInMaps()

SlotIndex llvm::LiveIntervals::InsertMachineInstrInMaps ( MachineInstr & MI)
inline

Definition at line 285 of file LiveIntervals.h.

References MI.

Referenced by llvm::X86InstrInfo::classifyLEAReg(), moveAndTeeForMultiUse(), and rematerializeCheapDef().

◆ InsertMachineInstrRangeInMaps()

void llvm::LiveIntervals::InsertMachineInstrRangeInMaps ( MachineBasicBlock::iterator B,
MachineBasicBlock::iterator E )
inline

Definition at line 289 of file LiveIntervals.h.

References B(), E(), and I.

◆ insertMBBInMaps()

void llvm::LiveIntervals::insertMBBInMaps ( MachineBasicBlock * MBB)
inline

◆ intervalIsInOneMBB()

MachineBasicBlock * LiveIntervals::intervalIsInOneMBB ( const LiveInterval & LI) const

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.

Definition at line 860 of file LiveIntervals.cpp.

References assert(), llvm::LiveRange::beginIndex(), llvm::LiveRange::empty(), llvm::LiveRange::endIndex(), and llvm::SlotIndex::isBlock().

Referenced by checkRegMaskInterference(), and isLocalCopy().

◆ invalidate()

bool LiveIntervals::invalidate ( MachineFunction & MF,
const PreservedAnalyses & PA,
MachineFunctionAnalysisManager::Invalidator & Inv )

◆ isLiveInToMBB()

bool llvm::LiveIntervals::isLiveInToMBB ( const LiveRange & LR,
const MachineBasicBlock * mbb ) const
inline

Definition at line 266 of file LiveIntervals.h.

References getMBBStartIdx(), and llvm::LiveRange::liveAt().

◆ isLiveOutOfMBB()

bool llvm::LiveIntervals::isLiveOutOfMBB ( const LiveRange & LR,
const MachineBasicBlock * mbb ) const
inline

Definition at line 270 of file LiveIntervals.h.

References getMBBEndIdx(), and llvm::LiveRange::liveAt().

◆ isNotInMIMap()

bool llvm::LiveIntervals::isNotInMIMap ( const MachineInstr & Instr) const
inline

Returns true if the specified machine instr has been removed or was never entered in the map.

Definition at line 242 of file LiveIntervals.h.

Referenced by findNextInsertLocation().

◆ print()

void LiveIntervals::print ( raw_ostream & O) const

Implement the dump method.

Definition at line 185 of file LiveIntervals.cpp.

References getInterval(), hasInterval(), llvm::Register::index2VirtReg(), and llvm::printRegUnit().

Referenced by dump().

◆ pruneValue() [1/2]

LLVM_ATTRIBUTE_UNUSED void llvm::LiveIntervals::pruneValue ( LiveInterval & ,
SlotIndex ,
SmallVectorImpl< SlotIndex > *  )
inline

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.

Definition at line 232 of file LiveIntervals.h.

References LLVM_ATTRIBUTE_UNUSED, and llvm_unreachable.

◆ pruneValue() [2/2]

void LiveIntervals::pruneValue ( LiveRange & LR,
SlotIndex Kill,
SmallVectorImpl< SlotIndex > * EndPoints )

If LR has a live value at 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.

Definition at line 665 of file LiveIntervals.cpp.

References llvm::df_ext_begin(), llvm::df_ext_end(), llvm::LiveQueryResult::endPoint(), I, MBB, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveRange::Query(), llvm::LiveRange::removeSegment(), llvm::MachineBasicBlock::successors(), llvm::LiveQueryResult::valueIn(), and llvm::LiveQueryResult::valueOutOrDead().

◆ reanalyze()

void llvm::LiveIntervals::reanalyze ( MachineFunction & MF)
inline

Definition at line 310 of file LiveIntervals.h.

◆ removeAllRegUnitsForPhysReg()

void llvm::LiveIntervals::removeAllRegUnitsForPhysReg ( MCRegister Reg)
inline

Remove associated live ranges for the register units associated with Reg.

Subsequent uses should rely on on-demand recomputation.

Note
This method can result in inconsistent liveness tracking if multiple phyical registers share a regunit, and should be used cautiously.

Definition at line 445 of file LiveIntervals.h.

References Reg, and removeRegUnit().

Referenced by insertCSRRestores(), insertCSRSaves(), llvm::SIRegisterInfo::restoreSGPR(), and llvm::SIRegisterInfo::spillSGPR().

◆ removeInterval()

void llvm::LiveIntervals::removeInterval ( Register Reg)
inline

Interval removal.

Definition at line 171 of file LiveIntervals.h.

References Reg.

Referenced by rematerializeCheapDef(), and repairIntervalsInRange().

◆ RemoveMachineInstrFromMaps()

void llvm::LiveIntervals::RemoveMachineInstrFromMaps ( MachineInstr & MI)
inline

Definition at line 295 of file LiveIntervals.h.

References MI.

Referenced by rematerializeCheapDef().

◆ removePhysRegDefAt()

void LiveIntervals::removePhysRegDefAt ( MCRegister Reg,
SlotIndex Pos )

Remove value numbers and related live segments starting at position Pos that are part of any liverange of physical register Reg or one of its subregisters.

Definition at line 1776 of file LiveIntervals.cpp.

References getCachedRegUnit(), llvm::LiveRange::getVNInfoAt(), and llvm::LiveRange::removeValNo().

Referenced by rematerializeCheapDef().

◆ removeRegUnit()

void llvm::LiveIntervals::removeRegUnit ( unsigned Unit)
inline

Remove computed live range for register unit Unit.

Subsequent uses should rely on on-demand recomputation.

Definition at line 436 of file LiveIntervals.h.

Referenced by removeAllRegUnitsForPhysReg().

◆ removeVRegDefAt()

void LiveIntervals::removeVRegDefAt ( LiveInterval & LI,
SlotIndex Pos )

Remove value number and related live segments of LI and its subranges that start at position Pos.

Definition at line 1784 of file LiveIntervals.cpp.

References assert(), llvm::VNInfo::def, llvm::SlotIndex::getBaseIndex(), llvm::LiveRange::getVNInfoAt(), llvm::LiveInterval::removeEmptySubRanges(), llvm::LiveRange::removeValNo(), and llvm::LiveInterval::subranges().

◆ repairIntervalsInRange()

void LiveIntervals::repairIntervalsInRange ( MachineBasicBlock * MBB,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
ArrayRef< Register > OrigRegs )

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 changes that are supported are simple removal and addition of uses.

Definition at line 1700 of file LiveIntervals.cpp.

References createAndComputeVirtRegInterval(), llvm::erase(), getInstructionIndex(), getInterval(), getMBBEndIdx(), llvm::SlotIndex::getPrevSlot(), llvm::LiveRange::hasAtLeastOneValue(), hasInterval(), llvm::LiveInterval::hasSubRanges(), I, MBB, MI, llvm::none_of(), llvm::LiveInterval::removeEmptySubRanges(), removeInterval(), llvm::LiveInterval::subranges(), and SubReg.

◆ ReplaceMachineInstrInMaps()

◆ shrinkToUses() [1/2]

bool LiveIntervals::shrinkToUses ( LiveInterval * li,
SmallVectorImpl< MachineInstr * > * dead = nullptr )

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.

Definition at line 485 of file LiveIntervals.cpp.

References assert(), createSegmentsForValues(), llvm::dbgs(), getInstructionIndex(), llvm::LaneBitmask::getNone(), llvm::SlotIndex::getRegSlot(), llvm::Register::isVirtual(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveRange::Query(), llvm::LiveInterval::reg(), llvm::LiveInterval::removeEmptySubRanges(), llvm::LiveRange::segments, shrinkToUses(), llvm::LiveInterval::subranges(), llvm::SmallVectorImpl< T >::swap(), UseMI, llvm::LiveQueryResult::valueDefined(), llvm::LiveQueryResult::valueIn(), and llvm::LiveRange::vnis().

Referenced by llvm::SIInstrInfo::convertToThreeAddress(), replaceDominatedUses(), shrinkToUses(), and shrinkToUses().

◆ shrinkToUses() [2/2]

◆ splitSeparateComponents()

◆ LiveIntervalsAnalysis

friend class LiveIntervalsAnalysis
friend

Definition at line 56 of file LiveIntervals.h.

References LiveIntervalsAnalysis.

Referenced by invalidate(), and LiveIntervalsAnalysis.

◆ LiveIntervalsWrapperPass

friend class LiveIntervalsWrapperPass
friend

Definition at line 57 of file LiveIntervals.h.

References LiveIntervalsWrapperPass.

Referenced by LiveIntervalsWrapperPass.


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