LLVM  8.0.1
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
llvm::LiveRange Class Reference

This class represents the liveness of a register, stack slot, etc. More...

#include "llvm/CodeGen/LiveInterval.h"

Inheritance diagram for llvm::LiveRange:
Inheritance graph
[legend]
Collaboration diagram for llvm::LiveRange:
Collaboration graph
[legend]

Classes

struct  Segment
 This represents a simple continuous liveness interval for a value. More...
 

Public Types

using Segments = SmallVector< Segment, 2 >
 
using VNInfoList = SmallVector< VNInfo *, 2 >
 
using SegmentSet = std::set< Segment >
 
using iterator = Segments::iterator
 
using const_iterator = Segments::const_iterator
 
using vni_iterator = VNInfoList::iterator
 
using const_vni_iterator = VNInfoList::const_iterator
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
vni_iterator vni_begin ()
 
vni_iterator vni_end ()
 
const_vni_iterator vni_begin () const
 
const_vni_iterator vni_end () const
 
 LiveRange (bool UseSegmentSet=false)
 Constructs a new LiveRange object. More...
 
 LiveRange (const LiveRange &Other, BumpPtrAllocator &Allocator)
 Constructs a new LiveRange object by copying segments and valnos from another LiveRange. More...
 
void assign (const LiveRange &Other, BumpPtrAllocator &Allocator)
 Copies values numbers and live segments from Other into this range. More...
 
iterator advanceTo (iterator I, SlotIndex Pos)
 advanceTo - Advance the specified iterator to point to the Segment containing the specified position, or end() if the position is past the end of the range. More...
 
const_iterator advanceTo (const_iterator I, SlotIndex Pos) const
 
iterator find (SlotIndex Pos)
 find - Return an iterator pointing to the first segment that ends after Pos, or end(). More...
 
const_iterator find (SlotIndex Pos) const
 
void clear ()
 
size_t size () const
 
bool hasAtLeastOneValue () const
 
bool containsOneValue () const
 
unsigned getNumValNums () const
 
VNInfogetValNumInfo (unsigned ValNo)
 getValNumInfo - Returns pointer to the specified val#. More...
 
const VNInfogetValNumInfo (unsigned ValNo) const
 
bool containsValue (const VNInfo *VNI) const
 containsValue - Returns true if VNI belongs to this range. More...
 
VNInfogetNextValue (SlotIndex def, VNInfo::Allocator &VNInfoAllocator)
 getNextValue - Create a new value number and return it. More...
 
VNInfocreateDeadDef (SlotIndex Def, VNInfo::Allocator &VNIAlloc)
 createDeadDef - Make sure the range has a value defined at Def. More...
 
VNInfocreateDeadDef (VNInfo *VNI)
 Create a def of value VNI. More...
 
VNInfocreateValueCopy (const VNInfo *orig, VNInfo::Allocator &VNInfoAllocator)
 Create a copy of the given value. More...
 
void RenumberValues ()
 RenumberValues - Renumber all values in order of appearance and remove unused values. More...
 
VNInfoMergeValueNumberInto (VNInfo *V1, VNInfo *V2)
 MergeValueNumberInto - This method is called when two value numbers are found to be equivalent. More...
 
void MergeSegmentsInAsValue (const LiveRange &RHS, VNInfo *LHSValNo)
 Merge all of the live segments of a specific val# in RHS into this live range as the specified value number. More...
 
void MergeValueInAsValue (const LiveRange &RHS, const VNInfo *RHSValNo, VNInfo *LHSValNo)
 MergeValueInAsValue - Merge all of the segments of a specific val# in RHS into this live range as the specified value number. More...
 
bool empty () const
 
SlotIndex beginIndex () const
 beginIndex - Return the lowest numbered slot covered. More...
 
SlotIndex endIndex () const
 endNumber - return the maximum point of the range of the whole, exclusive. More...
 
bool expiredAt (SlotIndex index) const
 
bool liveAt (SlotIndex index) const
 
const SegmentgetSegmentContaining (SlotIndex Idx) const
 Return the segment that contains the specified index, or null if there is none. More...
 
SegmentgetSegmentContaining (SlotIndex Idx)
 Return the live segment that contains the specified index, or null if there is none. More...
 
VNInfogetVNInfoAt (SlotIndex Idx) const
 getVNInfoAt - Return the VNInfo that is live at Idx, or NULL. More...
 
VNInfogetVNInfoBefore (SlotIndex Idx) const
 getVNInfoBefore - Return the VNInfo that is live up to but not necessarilly including Idx, or NULL. More...
 
iterator FindSegmentContaining (SlotIndex Idx)
 Return an iterator to the segment that contains the specified index, or end() if there is none. More...
 
const_iterator FindSegmentContaining (SlotIndex Idx) const
 
bool overlaps (const LiveRange &other) const
 overlaps - Return true if the intersection of the two live ranges is not empty. More...
 
bool overlaps (const LiveRange &Other, const CoalescerPair &CP, const SlotIndexes &) const
 overlaps - Return true if the two ranges have overlapping segments that are not coalescable according to CP. More...
 
bool overlaps (SlotIndex Start, SlotIndex End) const
 overlaps - Return true if the live range overlaps an interval specified by [Start, End). More...
 
bool overlapsFrom (const LiveRange &Other, const_iterator StartPos) const
 overlapsFrom - Return true if the intersection of the two live ranges is not empty. More...
 
bool covers (const LiveRange &Other) const
 Returns true if all segments of the Other live range are completely covered by this live range. More...
 
iterator addSegment (Segment S)
 Add the specified Segment to this range, merging segments as appropriate. More...
 
std::pair< VNInfo *, boolextendInBlock (ArrayRef< SlotIndex > Undefs, SlotIndex StartIdx, SlotIndex Kill)
 Attempt to extend a value defined after StartIdx to include Use. More...
 
VNInfoextendInBlock (SlotIndex StartIdx, SlotIndex Kill)
 Simplified version of the above "extendInBlock", which assumes that no register lanes are undefined by <def,read-undef> operands. More...
 
void join (LiveRange &Other, const int *ValNoAssignments, const int *RHSValNoAssignments, SmallVectorImpl< VNInfo *> &NewVNInfo)
 join - Join two live ranges (this, and other) together. More...
 
bool isLocal (SlotIndex Start, SlotIndex End) const
 True iff this segment is a single segment that lies between the specified boundaries, exclusively. More...
 
void removeSegment (SlotIndex Start, SlotIndex End, bool RemoveDeadValNo=false)
 Remove the specified segment from this range. More...
 
void removeSegment (Segment S, bool RemoveDeadValNo=false)
 
iterator removeSegment (iterator I)
 Remove segment pointed to by iterator I from this range. More...
 
LiveQueryResult Query (SlotIndex Idx) const
 Query Liveness at Idx. More...
 
void removeValNo (VNInfo *ValNo)
 removeValNo - Remove all the segments defined by the specified value#. More...
 
bool isZeroLength (SlotIndexes *Indexes) const
 Returns true if the live range is zero length, i.e. More...
 
bool isLiveAtIndexes (ArrayRef< SlotIndex > Slots) const
 
bool operator< (const LiveRange &other) const
 
bool isUndefIn (ArrayRef< SlotIndex > Undefs, SlotIndex Begin, SlotIndex End) const
 Returns true if there is an explicit "undef" between Begin End. More...
 
void flushSegmentSet ()
 Flush segment set into the regular segment vector. More...
 
void print (raw_ostream &OS) const
 
void dump () const
 
void verify () const
 Walk the range and assert if any invariants fail to hold. More...
 

Public Attributes

Segments segments
 
VNInfoList valnos
 
std::unique_ptr< SegmentSetsegmentSet
 

Protected Member Functions

void append (const LiveRange::Segment S)
 Append a segment to the list of segments. More...
 

Friends

class LiveRangeUpdater
 

Detailed Description

This class represents the liveness of a register, stack slot, etc.

It manages an ordered list of Segment objects. The Segments are organized in a static single assignment form: At places where a new value is defined or different values reach a CFG join a new segment with a new value number is used.

Definition at line 157 of file LiveInterval.h.

Member Typedef Documentation

◆ const_iterator

using llvm::LiveRange::const_iterator = Segments::const_iterator

Definition at line 209 of file LiveInterval.h.

◆ const_vni_iterator

Definition at line 218 of file LiveInterval.h.

◆ iterator

Definition at line 208 of file LiveInterval.h.

◆ Segments

Definition at line 196 of file LiveInterval.h.

◆ SegmentSet

Definition at line 205 of file LiveInterval.h.

◆ vni_iterator

Definition at line 217 of file LiveInterval.h.

◆ VNInfoList

Definition at line 197 of file LiveInterval.h.

Constructor & Destructor Documentation

◆ LiveRange() [1/2]

llvm::LiveRange::LiveRange ( bool  UseSegmentSet = false)
inline

Constructs a new LiveRange object.

Definition at line 227 of file LiveInterval.h.

◆ LiveRange() [2/2]

llvm::LiveRange::LiveRange ( const LiveRange Other,
BumpPtrAllocator Allocator 
)
inline

Constructs a new LiveRange object by copying segments and valnos from another LiveRange.

Definition at line 233 of file LiveInterval.h.

References assert(), and segmentSet.

Member Function Documentation

◆ addSegment()

LiveRange::iterator LiveRange::addSegment ( Segment  S)

Add the specified Segment to this range, merging segments as appropriate.

This returns an iterator to the inserted segment (which may have grown since it was inserted).

Definition at line 551 of file LiveInterval.cpp.

References llvm::sys::path::end().

Referenced by addSegmentsWithValNo(), llvm::LiveIntervals::addSegmentToEndOfBlock(), allPhiOperandsUndefined(), createSegmentsForValues(), llvm::LiveRangeEdit::eraseVirtReg(), llvm::CoalescerPair::isCoalescable(), and llvm::MachineBasicBlock::SplitCriticalEdge().

◆ advanceTo() [1/2]

iterator llvm::LiveRange::advanceTo ( iterator  I,
SlotIndex  Pos 
)
inline

advanceTo - Advance the specified iterator to point to the Segment containing the specified position, or end() if the position is past the end of the range.

If no Segment contains this position, but the position is in a hole, this method returns an iterator pointing to the Segment immediately after the hole.

Definition at line 259 of file LiveInterval.h.

References assert(), llvm::sys::path::end(), and I.

Referenced by llvm::LiveIntervals::addKillFlags(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::SplitAnalysis::countLiveBlocks(), llvm::LiveIntervalUnion::extract(), llvm::LiveIntervals::HMEditor::updateAllRanges(), and llvm::LiveDebugVariables::~LiveDebugVariables().

◆ advanceTo() [2/2]

const_iterator llvm::LiveRange::advanceTo ( const_iterator  I,
SlotIndex  Pos 
) const
inline

Definition at line 267 of file LiveInterval.h.

References assert(), llvm::sys::path::end(), llvm::find(), and I.

◆ append()

void LiveRange::append ( const LiveRange::Segment  S)
protected

Append a segment to the list of segments.

Definition at line 561 of file LiveInterval.cpp.

References assert(), and llvm::LiveRange::Segment::start.

◆ assign()

void llvm::LiveRange::assign ( const LiveRange Other,
BumpPtrAllocator Allocator 
)
inline

◆ begin() [1/2]

iterator llvm::LiveRange::begin ( )
inline

◆ begin() [2/2]

const_iterator llvm::LiveRange::begin ( ) const
inline

◆ beginIndex()

SlotIndex llvm::LiveRange::beginIndex ( ) const
inline

◆ clear()

void llvm::LiveRange::clear ( )
inline

◆ containsOneValue()

bool llvm::LiveRange::containsOneValue ( ) const
inline

Definition at line 299 of file LiveInterval.h.

References llvm::SmallVectorBase::size().

◆ containsValue()

bool llvm::LiveRange::containsValue ( const VNInfo VNI) const
inline

containsValue - Returns true if VNI belongs to this range.

Definition at line 313 of file LiveInterval.h.

References llvm::VNInfo::id.

◆ covers()

bool LiveRange::covers ( const LiveRange Other) const

Returns true if all segments of the Other live range are completely covered by this live range.

Adjacent live ranges do not affect the covering:the liverange [1,5](5,10] covers (3,7].

Definition at line 497 of file LiveInterval.cpp.

References llvm::sys::path::begin(), llvm::empty(), empty(), llvm::sys::path::const_iterator::end, llvm::sys::path::end(), llvm::LiveRange::Segment::end, I, llvm::VNInfo::id, llvm::VNInfo::markUnused(), llvm::RISCVFenceField::O, segments, and llvm::LiveRange::Segment::start.

Referenced by matchPair().

◆ createDeadDef() [1/2]

VNInfo * LiveRange::createDeadDef ( SlotIndex  Def,
VNInfo::Allocator VNIAlloc 
)

createDeadDef - Make sure the range has a value defined at Def.

If one already exists, return it. Otherwise allocate a new value and add liveness for a dead def.

Definition at line 373 of file LiveInterval.cpp.

Referenced by addSegmentsWithValNo(), allPhiOperandsUndefined(), llvm::LiveRangeCalc::constructMainRangeFromSubranges(), createDeadDef(), llvm::SplitEditor::dump(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), and llvm::LiveIntervals::print().

◆ createDeadDef() [2/2]

VNInfo * LiveRange::createDeadDef ( VNInfo VNI)

Create a def of value VNI.

Return VNI. If there already exists a definition at VNI->def, the value defined there must be VNI.

Definition at line 381 of file LiveInterval.cpp.

References llvm::VNInfo::def.

◆ createValueCopy()

VNInfo* llvm::LiveRange::createValueCopy ( const VNInfo orig,
VNInfo::Allocator VNInfoAllocator 
)
inline

Create a copy of the given value.

The new value will be identical except for the Value number.

Definition at line 337 of file LiveInterval.h.

References llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase::size(), llvm::NVPTX::PTXLdStInstCode::V2, and llvm::VNInfo::VNInfo().

◆ dump()

LLVM_DUMP_METHOD void LiveRange::dump ( ) const

Definition at line 999 of file LiveInterval.cpp.

References llvm::dbgs().

◆ empty()

bool llvm::LiveRange::empty ( ) const
inline

◆ end() [1/2]

iterator llvm::LiveRange::end ( )
inline

◆ end() [2/2]

const_iterator llvm::LiveRange::end ( ) const
inline

◆ endIndex()

SlotIndex llvm::LiveRange::endIndex ( ) const
inline

◆ expiredAt()

bool llvm::LiveRange::expiredAt ( SlotIndex  index) const
inline

Definition at line 385 of file LiveInterval.h.

Referenced by regJustKilledBefore().

◆ extendInBlock() [1/2]

std::pair< VNInfo *, bool > LiveRange::extendInBlock ( ArrayRef< SlotIndex Undefs,
SlotIndex  StartIdx,
SlotIndex  Kill 
)

Attempt to extend a value defined after StartIdx to include Use.

Both StartIdx and Use should be in the same basic block. In case of subranges, an extension could be prevented by an explicit "undef" caused by a <def,read-undef> on a non-overlapping lane. The list of location of such "undefs" should be provided in Undefs. The return value is a pair: the first element is VNInfo of the value that was extended (possibly nullptr), the second is a boolean value indicating whether an "undef" was encountered. If this range is live before Use in the basic block that starts at StartIdx, and there is no intervening "undef", extend it to be live up to Use, and return the pair {value, false}. If there is no segment before Use and there is no "undef" between StartIdx and Use, return {nullptr, false}. If there is an "undef" before Use, return {nullptr, true}.

Definition at line 567 of file LiveInterval.cpp.

Referenced by createSegmentsForValues(), and llvm::LiveRangeCalc::extend().

◆ extendInBlock() [2/2]

VNInfo * LiveRange::extendInBlock ( SlotIndex  StartIdx,
SlotIndex  Kill 
)

Simplified version of the above "extendInBlock", which assumes that no register lanes are undefined by <def,read-undef> operands.

If this range is live before Use in the basic block that starts at StartIdx, extend it to be live up to Use, and return the value. If there is no segment before Use, return nullptr.

Definition at line 576 of file LiveInterval.cpp.

◆ find() [1/2]

LiveRange::iterator LiveRange::find ( SlotIndex  Pos)

find - Return an iterator pointing to the first segment that ends after Pos, or end().

This is the same as advanceTo(begin(), Pos), but faster when searching large ranges.

If Pos is contained in a Segment, that segment is returned. If Pos is in a hole, the following Segment is returned. If Pos is beyond endIndex, end() is returned.

Definition at line 353 of file LiveInterval.cpp.

References llvm::sys::path::begin(), llvm::empty(), llvm::sys::path::end(), I, and llvm::size().

Referenced by llvm::LiveRangeUpdater::add(), llvm::LiveIntervals::addKillFlags(), llvm::createCopyConstrainDAGMutation(), getNumAllocatableRegsForConstraints(), getStartOrEndSlot(), llvm::SplitAnalysis::isOriginalEndpoint(), isPlainlyKilled(), overlaps(), regOverlapsSet(), and llvm::LiveIntervals::HMEditor::updateAllRanges().

◆ find() [2/2]

const_iterator llvm::LiveRange::find ( SlotIndex  Pos) const
inline

Definition at line 284 of file LiveInterval.h.

References llvm::find().

◆ FindSegmentContaining() [1/2]

iterator llvm::LiveRange::FindSegmentContaining ( SlotIndex  Idx)
inline

Return an iterator to the segment that contains the specified index, or end() if there is none.

Definition at line 424 of file LiveInterval.h.

References llvm::sys::path::end(), llvm::find(), and I.

Referenced by llvm::CoalescerPair::isCoalescable(), MoveAndTeeForMultiUse(), and llvm::LiveIntervals::shrinkToUses().

◆ FindSegmentContaining() [2/2]

const_iterator llvm::LiveRange::FindSegmentContaining ( SlotIndex  Idx) const
inline

Definition at line 429 of file LiveInterval.h.

References llvm::sys::path::end(), llvm::find(), and I.

◆ flushSegmentSet()

void LiveRange::flushSegmentSet ( )

Flush segment set into the regular segment vector.

The method is to be called after the live range has been created, if use of the segment set was activated in the constructor of the live range.

Definition at line 807 of file LiveInterval.cpp.

References assert(), and llvm::verify().

Referenced by llvm::LiveIntervals::print().

◆ getNextValue()

VNInfo* llvm::LiveRange::getNextValue ( SlotIndex  def,
VNInfo::Allocator VNInfoAllocator 
)
inline

getNextValue - Create a new value number and return it.

MIIdx specifies the instruction that defines the value number.

Definition at line 319 of file LiveInterval.h.

References createDeadDef(), llvm::tgtok::Def, llvm::VNInfo::def, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase::size(), and llvm::VNInfo::VNInfo().

Referenced by llvm::LiveIntervals::addSegmentToEndOfBlock(), allPhiOperandsUndefined(), and llvm::LiveRangeEdit::eraseVirtReg().

◆ getNumValNums()

unsigned llvm::LiveRange::getNumValNums ( ) const
inline

◆ getSegmentContaining() [1/2]

const Segment* llvm::LiveRange::getSegmentContaining ( SlotIndex  Idx) const
inline

Return the segment that contains the specified index, or null if there is none.

Definition at line 396 of file LiveInterval.h.

References llvm::sys::path::end(), and I.

Referenced by llvm::createSIWholeQuadModePass(), llvm::RegPressureTracker::getLastUsedLanes(), llvm::RegPressureTracker::getLiveThroughAt(), removeDeadSegment(), and llvm::LiveIntervals::shrinkToUses().

◆ getSegmentContaining() [2/2]

Segment* llvm::LiveRange::getSegmentContaining ( SlotIndex  Idx)
inline

Return the live segment that contains the specified index, or null if there is none.

Definition at line 403 of file LiveInterval.h.

References llvm::sys::path::end(), and I.

◆ getValNumInfo() [1/2]

VNInfo* llvm::LiveRange::getValNumInfo ( unsigned  ValNo)
inline

getValNumInfo - Returns pointer to the specified val#.

Definition at line 305 of file LiveInterval.h.

Referenced by getStartOrEndSlot(), and matchPair().

◆ getValNumInfo() [2/2]

const VNInfo* llvm::LiveRange::getValNumInfo ( unsigned  ValNo) const
inline

Definition at line 308 of file LiveInterval.h.

◆ getVNInfoAt()

VNInfo* llvm::LiveRange::getVNInfoAt ( SlotIndex  Idx) const
inline

◆ getVNInfoBefore()

VNInfo* llvm::LiveRange::getVNInfoBefore ( SlotIndex  Idx) const
inline

◆ hasAtLeastOneValue()

bool llvm::LiveRange::hasAtLeastOneValue ( ) const
inline

◆ isLiveAtIndexes()

bool LiveRange::isLiveAtIndexes ( ArrayRef< SlotIndex Slots) const

◆ isLocal()

bool llvm::LiveRange::isLocal ( SlotIndex  Start,
SlotIndex  End 
) const
inline

True iff this segment is a single segment that lies between the specified boundaries, exclusively.

Vregs live across a backedge are not considered local. The boundaries are expected to lie within an extended basic block, so vregs that are not live out should contain no holes.

Definition at line 506 of file LiveInterval.h.

References llvm::SlotIndex::getBaseIndex(), and llvm::SlotIndex::getBoundaryIndex().

Referenced by llvm::createCopyConstrainDAGMutation().

◆ isUndefIn()

bool llvm::LiveRange::isUndefIn ( ArrayRef< SlotIndex Undefs,
SlotIndex  Begin,
SlotIndex  End 
) const
inline

Returns true if there is an explicit "undef" between Begin End.

Definition at line 595 of file LiveInterval.h.

References llvm::any_of(), llvm::ArrayRef< T >::begin(), and llvm::ArrayRef< T >::end().

◆ isZeroLength()

bool llvm::LiveRange::isZeroLength ( SlotIndexes Indexes) const
inline

Returns true if the live range is zero length, i.e.

no live segments span instructions. It doesn't pay to spill such a range.

Definition at line 574 of file LiveInterval.h.

References llvm::LiveRange::Segment::end, llvm::SlotIndex::getBaseIndex(), llvm::SlotIndexes::getNextNonNullIndex(), and llvm::LiveRange::Segment::start.

Referenced by llvm::VirtRegAuxInfo::weightCalcHelper().

◆ join()

void LiveRange::join ( LiveRange Other,
const int *  ValNoAssignments,
const int *  RHSValNoAssignments,
SmallVectorImpl< VNInfo *> &  NewVNInfo 
)

join - Join two live ranges (this, and other) together.

This applies mappings to the value numbers in the LHS/RHS ranges as specified. If the ranges are not joinable, this aborts.

Definition at line 644 of file LiveInterval.cpp.

References llvm::LiveRangeUpdater::add(), assert(), llvm::sys::path::begin(), E, llvm::empty(), llvm::sys::path::end(), I, llvm::VNInfo::id, llvm::SmallVectorTemplateBase< T, bool >::push_back(), segments, llvm::SmallVectorBase::size(), llvm::LiveRange::Segment::valno, and llvm::verify().

Referenced by isDefInSubRange().

◆ liveAt()

bool llvm::LiveRange::liveAt ( SlotIndex  index) const
inline

◆ MergeSegmentsInAsValue()

void LiveRange::MergeSegmentsInAsValue ( const LiveRange RHS,
VNInfo LHSValNo 
)

Merge all of the live segments of a specific val# in RHS into this live range as the specified value number.

Merge all of the segments in RHS into this live range as the specified value number.

The segments in RHS are allowed to overlap with segments in the current range, it will replace the value numbers of the overlaped live segments with the specified value number.

The segments in RHS are allowed to overlap with segments in the current range, but only if the overlapping segments have the specified value number.

Definition at line 727 of file LiveInterval.cpp.

References llvm::LiveRangeUpdater::add(), llvm::LiveRange::Segment::end, segments, and llvm::LiveRange::Segment::start.

Referenced by getStartOrEndSlot().

◆ MergeValueInAsValue()

void LiveRange::MergeValueInAsValue ( const LiveRange RHS,
const VNInfo RHSValNo,
VNInfo LHSValNo 
)

MergeValueInAsValue - Merge all of the segments of a specific val# in RHS into this live range as the specified value number.

MergeValueInAsValue - Merge all of the live segments of a specific val# in RHS into this live range as the specified value number.

The segments in RHS are allowed to overlap with segments in the current range, but only if the overlapping segments have the specified value number.

The segments in RHS are allowed to overlap with segments in the current range, it will replace the value numbers of the overlaped segments with the specified value number.

Definition at line 739 of file LiveInterval.cpp.

References llvm::LiveRangeUpdater::add(), llvm::LiveRange::Segment::end, segments, llvm::LiveRange::Segment::start, and llvm::LiveRange::Segment::valno.

◆ MergeValueNumberInto()

VNInfo * LiveRange::MergeValueNumberInto ( VNInfo V1,
VNInfo V2 
)

MergeValueNumberInto - This method is called when two value numbers are found to be equivalent.

MergeValueNumberInto - This method is called when two value nubmers are found to be equivalent.

This eliminates V1, replacing all segments with the V1 value number with the V2 value number. This can cause merging of V1/V2 values numbers and compaction of the value space.

Definition at line 752 of file LiveInterval.cpp.

References assert(), llvm::sys::path::begin(), llvm::VNInfo::copyFrom(), llvm::sys::path::end(), llvm::LiveRange::Segment::end, llvm::VNInfo::id, std::swap(), and llvm::NVPTX::PTXLdStInstCode::V2.

Referenced by addSegmentsWithValNo(), and llvm::CoalescerPair::isCoalescable().

◆ operator<()

bool llvm::LiveRange::operator< ( const LiveRange other) const
inline

Definition at line 587 of file LiveInterval.h.

References beginIndex().

◆ overlaps() [1/3]

bool llvm::LiveRange::overlaps ( const LiveRange other) const
inline

overlaps - Return true if the intersection of the two live ranges is not empty.

Definition at line 436 of file LiveInterval.h.

References begin(), llvm::HexagonISD::CP, empty(), and Other.

Referenced by addSegmentsWithValNo(), llvm::LiveRegMatrix::checkRegUnitInterference(), isACalleeSavedRegister(), isTerminalReg(), and false::IntervalSorter::operator()().

◆ overlaps() [2/3]

bool LiveRange::overlaps ( const LiveRange Other,
const CoalescerPair CP,
const SlotIndexes Indexes 
) const

overlaps - Return true if the two ranges have overlapping segments that are not coalescable according to CP.

Overlapping segments where one range is defined by a coalescable copy are allowed.

Definition at line 448 of file LiveInterval.cpp.

References assert(), beginIndex(), llvm::empty(), empty(), llvm::sys::path::end(), end(), find(), llvm::find(), llvm::SlotIndexes::getInstructionFromIndex(), llvm::ARM_PROC::IE, llvm::SlotIndex::isBlock(), llvm::CoalescerPair::isCoalescable(), llvm::max(), and std::swap().

◆ overlaps() [3/3]

bool LiveRange::overlaps ( SlotIndex  Start,
SlotIndex  End 
) const

overlaps - Return true if the live range overlaps an interval specified by [Start, End).

Definition at line 491 of file LiveInterval.cpp.

◆ overlapsFrom()

bool LiveRange::overlapsFrom ( const LiveRange Other,
const_iterator  StartPos 
) const

overlapsFrom - Return true if the intersection of the two live ranges is not empty.

The specified iterator is a hint that we can begin scanning the Other range starting at I.

Definition at line 407 of file LiveInterval.cpp.

References assert(), llvm::sys::path::begin(), begin(), llvm::empty(), llvm::sys::path::end(), end(), std::swap(), and llvm::upper_bound().

◆ print()

void LiveRange::print ( raw_ostream OS) const

◆ Query()

LiveQueryResult llvm::LiveRange::Query ( SlotIndex  Idx) const
inline

◆ removeSegment() [1/3]

void LiveRange::removeSegment ( SlotIndex  Start,
SlotIndex  End,
bool  RemoveDeadValNo = false 
)

Remove the specified segment from this range.

Note that the segment must be a single Segment in its entirety.

Note that the segment must be in a single Segment in its entirety.

Definition at line 586 of file LiveInterval.cpp.

Referenced by allPhiOperandsUndefined(), MoveForSingleUse(), llvm::LiveIntervals::pruneValue(), removeDeadSegment(), llvm::LiveIntervals::shrinkToUses(), and llvm::MachineBasicBlock::SplitCriticalEdge().

◆ removeSegment() [2/3]

void llvm::LiveRange::removeSegment ( Segment  S,
bool  RemoveDeadValNo = false 
)
inline

◆ removeSegment() [3/3]

iterator llvm::LiveRange::removeSegment ( iterator  I)
inline

Remove segment pointed to by iterator I from this range.

This does not remove dead value numbers.

Definition at line 522 of file LiveInterval.h.

References llvm::SmallVectorImpl< T >::erase().

◆ removeValNo()

void LiveRange::removeValNo ( VNInfo ValNo)

removeValNo - Remove all the segments defined by the specified value#.

Also remove the value# from value# list.

Definition at line 635 of file LiveInterval.cpp.

References llvm::empty(), llvm::sys::path::end(), llvm::remove_if(), and llvm::LiveRange::Segment::valno.

Referenced by allPhiOperandsUndefined(), llvm::LiveIntervals::removePhysRegDefAt(), llvm::LiveIntervals::removeVRegDefAt(), and llvm::LiveIntervals::HMEditor::updateAllRanges().

◆ RenumberValues()

void LiveRange::RenumberValues ( )

RenumberValues - Renumber all values in order of appearance and remove unused values.

RenumberValues - Renumber all values in order of appearance and delete the remaining unused values.

Definition at line 534 of file LiveInterval.cpp.

References assert(), llvm::SmallPtrSetImplBase::clear(), llvm::VNInfo::id, llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::VNInfo::isUnused().

Referenced by llvm::LiveRangeEdit::eliminateDeadDefs(), and llvm::SplitEditor::finish().

◆ size()

size_t llvm::LiveRange::size ( ) const
inline

◆ verify()

void LiveRange::verify ( ) const

Walk the range and assert if any invariants fail to hold.

Note that this is a no-op when asserts are disabled.

Definition at line 1013 of file LiveInterval.cpp.

References assert(), llvm::sys::path::begin(), E, llvm::sys::path::end(), and I.

Referenced by llvm::LiveRangeUpdater::flush(), isDefInSubRange(), and llvm::LiveIntervals::HMEditor::updateAllRanges().

◆ vni_begin() [1/2]

vni_iterator llvm::LiveRange::vni_begin ( )
inline

◆ vni_begin() [2/2]

const_vni_iterator llvm::LiveRange::vni_begin ( ) const
inline

◆ vni_end() [1/2]

vni_iterator llvm::LiveRange::vni_end ( )
inline

◆ vni_end() [2/2]

const_vni_iterator llvm::LiveRange::vni_end ( ) const
inline

Friends And Related Function Documentation

◆ LiveRangeUpdater

friend class LiveRangeUpdater
friend

Definition at line 626 of file LiveInterval.h.

Member Data Documentation

◆ segments

Segments llvm::LiveRange::segments

◆ segmentSet

std::unique_ptr<SegmentSet> llvm::LiveRange::segmentSet

Definition at line 206 of file LiveInterval.h.

Referenced by llvm::LiveRangeUpdater::add(), assign(), and LiveRange().

◆ valnos

VNInfoList llvm::LiveRange::valnos

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