|
LLVM
4.0.0
|
This class represents the liveness of a register, stack slot, etc. More...
#include <LiveInterval.h>
Classes | |
| struct | Segment |
| This represents a simple continuous liveness interval for a value. More... | |
Public Types | |
| typedef SmallVector< Segment, 2 > | Segments |
| typedef SmallVector< VNInfo *, 2 > | VNInfoList |
| typedef std::set< Segment > | SegmentSet |
| typedef Segments::iterator | iterator |
| typedef Segments::const_iterator | const_iterator |
| typedef VNInfoList::iterator | vni_iterator |
| typedef VNInfoList::const_iterator | const_vni_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... | |
| 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 |
| VNInfo * | getValNumInfo (unsigned ValNo) |
| getValNumInfo - Returns pointer to the specified val#. More... | |
| const VNInfo * | getValNumInfo (unsigned ValNo) const |
| bool | containsValue (const VNInfo *VNI) const |
| containsValue - Returns true if VNI belongs to this range. More... | |
| VNInfo * | getNextValue (SlotIndex def, VNInfo::Allocator &VNInfoAllocator) |
| getNextValue - Create a new value number and return it. More... | |
| VNInfo * | createDeadDef (SlotIndex Def, VNInfo::Allocator &VNInfoAllocator) |
| createDeadDef - Make sure the range has a value defined at Def. More... | |
| VNInfo * | createDeadDef (VNInfo *VNI) |
Create a def of value VNI. More... | |
| VNInfo * | createValueCopy (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... | |
| VNInfo * | MergeValueNumberInto (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 Segment * | getSegmentContaining (SlotIndex Idx) const |
| Return the segment that contains the specified index, or null if there is none. More... | |
| Segment * | getSegmentContaining (SlotIndex Idx) |
| Return the live segment that contains the specified index, or null if there is none. More... | |
| VNInfo * | getVNInfoAt (SlotIndex Idx) const |
| getVNInfoAt - Return the VNInfo that is live at Idx, or NULL. More... | |
| VNInfo * | getVNInfoBefore (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 I) 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 *, bool > | extendInBlock (ArrayRef< SlotIndex > Undefs, SlotIndex StartIdx, SlotIndex Use) |
Attempt to extend a value defined after StartIdx to include Use. More... | |
| VNInfo * | extendInBlock (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< SegmentSet > | segmentSet |
Protected Member Functions | |
| void | append (const LiveRange::Segment S) |
| Append a segment to the list of segments. More... | |
Friends | |
| class | LiveRangeUpdater |
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 153 of file LiveInterval.h.
Definition at line 208 of file LiveInterval.h.
Definition at line 216 of file LiveInterval.h.
Definition at line 204 of file LiveInterval.h.
| typedef SmallVector<Segment, 2> llvm::LiveRange::Segments |
Definition at line 192 of file LiveInterval.h.
| typedef std::set<Segment> llvm::LiveRange::SegmentSet |
Definition at line 201 of file LiveInterval.h.
Definition at line 212 of file LiveInterval.h.
| typedef SmallVector<VNInfo *, 2> llvm::LiveRange::VNInfoList |
Definition at line 193 of file LiveInterval.h.
Constructs a new LiveRange object.
Definition at line 221 of file LiveInterval.h.
|
inline |
Constructs a new LiveRange object by copying segments and valnos from another LiveRange.
Definition at line 227 of file LiveInterval.h.
References assert(), createValueCopy(), llvm::LiveRange::Segment::end, llvm::VNInfo::id, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), segments, segmentSet, llvm::LiveRange::Segment::start, llvm::LiveRange::Segment::valno, and valnos.
| 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 534 of file LiveInterval.cpp.
References end(), and segmentSet.
Referenced by addSegmentsWithValNo(), llvm::LiveIntervals::addSegmentToEndOfBlock(), createSegmentsForValues(), extendSegmentsToUses(), and llvm::MachineBasicBlock::SplitCriticalEdge().
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 246 of file LiveInterval.h.
References assert(), end(), endIndex(), and I.
Referenced by llvm::LiveIntervals::addKillFlags(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::SplitAnalysis::countLiveBlocks(), covers(), llvm::LiveIntervalUnion::extract(), and isLiveAtIndexes().
|
inline |
Definition at line 254 of file LiveInterval.h.
References assert(), end(), endIndex(), and I.
|
protected |
Append a segment to the list of segments.
Definition at line 544 of file LiveInterval.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), segments, and llvm::LiveRange::Segment::start.
|
inline |
Definition at line 205 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and segments.
Referenced by llvm::LiveIntervals::addKillFlags(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::SplitAnalysis::countLiveBlocks(), covers(), llvm::LiveIntervalUnion::extract(), find(), llvm::SplitAnalysis::isOriginalEndpoint(), join(), MergeValueNumberInto(), overlaps(), overlapsFrom(), removeSegment(), llvm::LiveIntervalUnion::unify(), and verify().
|
inline |
Definition at line 209 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and segments.
|
inline |
beginIndex - Return the lowest numbered slot covered.
Definition at line 360 of file LiveInterval.h.
References assert(), empty(), llvm::SmallVectorTemplateCommon< T, typename >::front(), and segments.
Referenced by llvm::LiveIntervals::intervalIsInOneMBB(), isLocal(), operator<(), llvm::LiveInterval::operator<(), and overlaps().
|
inline |
Definition at line 275 of file LiveInterval.h.
References llvm::SmallVectorImpl< T >::clear(), segments, and valnos.
Referenced by llvm::LiveRangeCalc::calculate().
|
inline |
Definition at line 286 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size(), and valnos.
containsValue - Returns true if VNI belongs to this range.
Definition at line 300 of file LiveInterval.h.
References getNumValNums(), getValNumInfo(), and llvm::VNInfo::id.
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 480 of file LiveInterval.cpp.
References advanceTo(), begin(), empty(), llvm::LiveRange::Segment::end, end(), I, segments, and llvm::LiveRange::Segment::start.
Referenced by llvm::LiveInterval::verify().
| VNInfo * LiveRange::createDeadDef | ( | SlotIndex | Def, |
| VNInfo::Allocator & | VNInfoAllocator | ||
| ) |
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 356 of file LiveInterval.cpp.
References segmentSet.
Referenced by llvm::LiveRangeCalc::constructMainRangeFromSubranges(), createDeadDef(), and llvm::SystemZInstrInfo::foldMemoryOperandImpl().
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 364 of file LiveInterval.cpp.
References llvm::VNInfo::def, and segmentSet.
|
inline |
Create a copy of the given value.
The new value will be identical except for the Value number.
Definition at line 324 of file LiveInterval.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and valnos.
Referenced by LiveRange().
| LLVM_DUMP_METHOD void LiveRange::dump | ( | ) | const |
Definition at line 951 of file LiveInterval.cpp.
References llvm::dbgs().
|
inline |
Definition at line 357 of file LiveInterval.h.
References llvm::SmallVectorBase::empty(), and segments.
Referenced by llvm::LiveIntervals::addKillFlags(), llvm::RegAllocBase::allocatePhysRegs(), beginIndex(), llvm::LiveRangeCalc::calculate(), llvm::LiveRegMatrix::checkInterference(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::LiveRegMatrix::checkRegUnitInterference(), llvm::SplitAnalysis::countLiveBlocks(), covers(), endIndex(), llvm::LiveIntervalUnion::extract(), find(), llvm::SplitAnalysis::isOriginalEndpoint(), join(), overlaps(), overlapsFrom(), print(), llvm::LiveInterval::removeEmptySubRanges(), removeValNo(), and llvm::LiveIntervalUnion::unify().
|
inline |
Definition at line 206 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end(), and segments.
Referenced by llvm::LiveRangeUpdater::add(), llvm::LiveIntervals::addKillFlags(), addSegment(), advanceTo(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::SplitAnalysis::countLiveBlocks(), covers(), llvm::LiveIntervalUnion::extract(), find(), FindSegmentContaining(), getSegmentContaining(), getVNInfoAt(), getVNInfoBefore(), isLiveAtIndexes(), llvm::SplitAnalysis::isOriginalEndpoint(), isPlainlyKilled(), join(), liveAt(), MergeValueNumberInto(), overlaps(), overlapsFrom(), Query(), removeSegment(), removeValNo(), llvm::LiveIntervalUnion::unify(), and verify().
|
inline |
Definition at line 210 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end(), and segments.
|
inline |
endNumber - return the maximum point of the range of the whole, exclusive.
Definition at line 367 of file LiveInterval.h.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), empty(), and segments.
Referenced by advanceTo(), expiredAt(), find(), llvm::LiveIntervals::intervalIsInOneMBB(), and isLocal().
Definition at line 372 of file LiveInterval.h.
References endIndex().
Referenced by regJustKilledBefore().
| std::pair< VNInfo *, bool > LiveRange::extendInBlock | ( | ArrayRef< SlotIndex > | Undefs, |
| SlotIndex | StartIdx, | ||
| SlotIndex | Use | ||
| ) |
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 550 of file LiveInterval.cpp.
References segmentSet.
Referenced by llvm::LiveRangeCalc::extend(), and extendSegmentsToUses().
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 559 of file LiveInterval.cpp.
References segmentSet.
| 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 336 of file LiveInterval.cpp.
References begin(), empty(), end(), endIndex(), I, and size().
Referenced by llvm::LiveIntervals::addKillFlags(), find(), FindSegmentContaining(), isLiveAtIndexes(), llvm::SplitAnalysis::isOriginalEndpoint(), isPlainlyKilled(), liveAt(), overlaps(), Query(), and removeSegment().
|
inline |
Definition at line 271 of file LiveInterval.h.
References find().
Return an iterator to the segment that contains the specified index, or end() if there is none.
Definition at line 411 of file LiveInterval.h.
References end(), find(), and I.
Referenced by getSegmentContaining(), getVNInfoAt(), getVNInfoBefore(), and MoveAndTeeForMultiUse().
|
inline |
Definition at line 416 of file LiveInterval.h.
| 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 790 of file LiveInterval.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorBase::empty(), segments, segmentSet, and verify().
|
inline |
getNextValue - Create a new value number and return it.
MIIdx specifies the instruction that defines the value number.
Definition at line 306 of file LiveInterval.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and valnos.
Referenced by llvm::LiveIntervals::addSegmentToEndOfBlock().
|
inline |
Definition at line 288 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size(), and valnos.
Referenced by llvm::ConnectedVNInfoEqClasses::Classify(), containsValue(), join(), and print().
Return the segment that contains the specified index, or null if there is none.
Definition at line 383 of file LiveInterval.h.
References end(), FindSegmentContaining(), and I.
Referenced by llvm::RegPressureTracker::getLastUsedLanes(), llvm::RegPressureTracker::getLiveThroughAt(), removeDeadSegment(), and llvm::LiveIntervals::shrinkToUses().
Return the live segment that contains the specified index, or null if there is none.
Definition at line 390 of file LiveInterval.h.
References end(), FindSegmentContaining(), and I.
getValNumInfo - Returns pointer to the specified val#.
Definition at line 292 of file LiveInterval.h.
References valnos.
Referenced by containsValue(), join(), and print().
Definition at line 295 of file LiveInterval.h.
References valnos.
getVNInfoAt - Return the VNInfo that is live at Idx, or NULL.
Definition at line 396 of file LiveInterval.h.
References end(), FindSegmentContaining(), and I.
Referenced by llvm::ConnectedVNInfoEqClasses::Distribute(), llvm::SplitEditor::enterIntvAfter(), llvm::SplitEditor::enterIntvAtEnd(), llvm::SplitEditor::enterIntvBefore(), HasOneUse(), llvm::SplitEditor::leaveIntvAfter(), llvm::SplitEditor::leaveIntvAtTop(), llvm::SplitEditor::leaveIntvBefore(), MoveAndTeeForMultiUse(), llvm::SplitEditor::overlapIntv(), llvm::LiveIntervals::removePhysRegDefAt(), llvm::LiveIntervals::removeVRegDefAt(), ReplaceDominatedUses(), and llvm::MachineBasicBlock::SplitCriticalEdge().
getVNInfoBefore - Return the VNInfo that is live up to but not necessarilly including Idx, or NULL.
Use this to find the reaching def used by an instruction at this SlotIndex position.
Definition at line 404 of file LiveInterval.h.
References end(), FindSegmentContaining(), llvm::SlotIndex::getPrevSlot(), and I.
Referenced by llvm::ConnectedVNInfoEqClasses::Classify(), llvm::ScheduleDAGMILive::computeCyclicCriticalPath(), extendSegmentsToUses(), GetVRegDef(), llvm::LiveIntervals::hasPHIKill(), OneUseDominatesOtherUses(), llvm::SplitEditor::overlapIntv(), and llvm::ScheduleDAGMILive::updatePressureDiffs().
|
inline |
Definition at line 284 of file LiveInterval.h.
References llvm::SmallVectorBase::empty(), and valnos.
Referenced by isPlainlyKilled(), and llvm::LiveIntervals::repairIntervalsInRange().
Definition at line 800 of file LiveInterval.cpp.
References advanceTo(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), end(), and find().
Referenced by llvm::VirtRegAuxInfo::calculateSpillWeightAndHint().
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 493 of file LiveInterval.h.
References beginIndex(), endIndex(), llvm::SlotIndex::getBaseIndex(), and llvm::SlotIndex::getBoundaryIndex().
|
inline |
Returns true if there is an explicit "undef" between Begin End.
Definition at line 582 of file LiveInterval.h.
References llvm::any_of(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), and llvm::WebAssembly::End.
|
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 561 of file LiveInterval.h.
References llvm::SlotIndex::getBaseIndex(), llvm::SlotIndexes::getNextNonNullIndex(), and segments.
Referenced by llvm::VirtRegAuxInfo::calculateSpillWeightAndHint().
| 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 627 of file LiveInterval.cpp.
References llvm::LiveRangeUpdater::add(), assert(), begin(), E, empty(), end(), llvm::SmallVectorImpl< T >::erase(), getNumValNums(), getValNumInfo(), I, i, llvm::VNInfo::id, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorImpl< T >::resize(), segments, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::LiveRange::Segment::valno, valnos, and verify().
Definition at line 376 of file LiveInterval.h.
Referenced by llvm::SystemZInstrInfo::foldMemoryOperandImpl(), getLiveLanesAt(), llvm::RegPressureTracker::getLiveLanesAt(), llvm::LiveIntervals::isLiveInToMBB(), llvm::LiveIntervals::isLiveOutOfMBB(), RematerializeCheapDef(), ReplaceDominatedUses(), llvm::MachineBasicBlock::SplitCriticalEdge(), and subRangeLiveAt().
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 710 of file LiveInterval.cpp.
References llvm::LiveRangeUpdater::add(), llvm::LiveRange::Segment::end, segments, and llvm::LiveRange::Segment::start.
| 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 722 of file LiveInterval.cpp.
References llvm::LiveRangeUpdater::add(), llvm::LiveRange::Segment::end, segments, llvm::LiveRange::Segment::start, and llvm::LiveRange::Segment::valno.
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 735 of file LiveInterval.cpp.
References assert(), begin(), llvm::VNInfo::copyFrom(), end(), llvm::SmallVectorImpl< T >::erase(), llvm::VNInfo::id, segments, std::swap(), and llvm::NVPTX::PTXLdStInstCode::V2.
Definition at line 574 of file LiveInterval.h.
References beginIndex().
overlaps - Return true if the intersection of the two live ranges is not empty.
Definition at line 423 of file LiveInterval.h.
References begin(), empty(), and overlapsFrom().
Referenced by llvm::LiveRegMatrix::checkRegUnitInterference().
| 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 431 of file LiveInterval.cpp.
References assert(), beginIndex(), empty(), end(), find(), llvm::SlotIndexes::getInstructionFromIndex(), llvm::ARM_PROC::IE, llvm::SlotIndex::isBlock(), llvm::CoalescerPair::isCoalescable(), and std::swap().
| bool LiveRange::overlapsFrom | ( | const LiveRange & | Other, |
| const_iterator | I | ||
| ) | 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 390 of file LiveInterval.cpp.
References assert(), begin(), empty(), end(), i, and std::swap().
Referenced by overlaps().
| void LiveRange::print | ( | raw_ostream & | OS | ) | const |
Definition at line 907 of file LiveInterval.cpp.
References assert(), llvm::VNInfo::def, empty(), getNumValNums(), getValNumInfo(), i, llvm::VNInfo::isPHIDef(), llvm::VNInfo::isUnused(), segments, vni_begin(), and vni_end().
Referenced by llvm::LiveRangeUpdater::dump(), and llvm::operator<<().
|
inline |
Query Liveness at Idx.
The sub-instruction slot of Idx doesn't matter, only the instruction it refers to is considered.
Definition at line 516 of file LiveInterval.h.
References llvm::VNInfo::def, E, end(), find(), llvm::SlotIndex::getBaseIndex(), I, llvm::SlotIndex::isEarlierInstr(), llvm::SlotIndex::isSameInstr(), and llvm::RegState::Kill.
Referenced by llvm::ScheduleDAGMILive::computeCyclicCriticalPath(), llvm::RegisterOperands::detectDeadDefs(), llvm::ConnectedVNInfoEqClasses::Distribute(), HasOneUse(), isRematerializable(), llvm::LiveIntervals::pruneValue(), llvm::LiveIntervals::shrinkToUses(), and llvm::ScheduleDAGMILive::updatePressureDiffs().
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 569 of file LiveInterval.cpp.
References assert(), begin(), llvm::WebAssembly::End, end(), llvm::SmallVectorImpl< T >::erase(), find(), llvm::SmallVectorImpl< T >::insert(), and segments.
Referenced by MoveForSingleUse(), llvm::LiveIntervals::pruneValue(), removeDeadSegment(), removeSegment(), llvm::LiveIntervals::shrinkToUses(), and llvm::MachineBasicBlock::SplitCriticalEdge().
Definition at line 503 of file LiveInterval.h.
References llvm::LiveRange::Segment::end, removeSegment(), and llvm::LiveRange::Segment::start.
Remove segment pointed to by iterator I from this range.
This does not remove dead value numbers.
Definition at line 509 of file LiveInterval.h.
References llvm::SmallVectorImpl< T >::erase(), and segments.
| 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 618 of file LiveInterval.cpp.
References empty(), end(), llvm::SmallVectorImpl< T >::erase(), llvm::remove_if(), segments, and llvm::LiveRange::Segment::valno.
Referenced by llvm::LiveIntervals::removePhysRegDefAt(), and llvm::LiveIntervals::removeVRegDefAt().
| 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 517 of file LiveInterval.cpp.
References assert(), llvm::SmallVectorImpl< T >::clear(), llvm::VNInfo::id, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::VNInfo::isUnused(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), segments, llvm::SmallVectorTemplateCommon< T, typename >::size(), and valnos.
Referenced by llvm::LiveRangeEdit::eliminateDeadDefs(), and llvm::SplitEditor::finish().
|
inline |
Definition at line 280 of file LiveInterval.h.
References segments, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::LiveIntervalUnion::Query::collectInterferingVRegs(), and find().
| 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 965 of file LiveInterval.cpp.
References assert(), begin(), E, end(), I, llvm::SmallVectorTemplateCommon< T, typename >::size(), and valnos.
Referenced by flushSegmentSet(), and join().
|
inline |
Definition at line 213 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and valnos.
Referenced by isRematerializable(), print(), and llvm::LiveIntervals::shrinkToUses().
|
inline |
Definition at line 217 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and valnos.
|
inline |
Definition at line 214 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end(), and valnos.
Referenced by isRematerializable(), print(), and llvm::LiveIntervals::shrinkToUses().
|
inline |
Definition at line 218 of file LiveInterval.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end(), and valnos.
|
friend |
Definition at line 613 of file LiveInterval.h.
| Segments llvm::LiveRange::segments |
Definition at line 195 of file LiveInterval.h.
Referenced by addSegmentsWithValNo(), append(), begin(), beginIndex(), clear(), llvm::LiveRangeCalc::constructMainRangeFromSubranges(), covers(), empty(), end(), endIndex(), flushSegmentSet(), llvm::LiveInterval::getSize(), isZeroLength(), join(), LiveRange(), MergeSegmentsInAsValue(), MergeValueInAsValue(), MergeValueNumberInto(), print(), removeSegment(), removeValNo(), RenumberValues(), llvm::LiveIntervals::shrinkToUses(), and size().
| std::unique_ptr<SegmentSet> llvm::LiveRange::segmentSet |
Definition at line 202 of file LiveInterval.h.
Referenced by addSegment(), createDeadDef(), extendInBlock(), flushSegmentSet(), and LiveRange().
| VNInfoList llvm::LiveRange::valnos |
Definition at line 196 of file LiveInterval.h.
Referenced by llvm::ConnectedVNInfoEqClasses::Classify(), clear(), llvm::LiveRangeCalc::constructMainRangeFromSubranges(), containsOneValue(), createValueCopy(), getNextValue(), getNumValNums(), getValNumInfo(), hasAtLeastOneValue(), llvm::LiveIntervals::hasPHIKill(), join(), LiveRange(), RenumberValues(), llvm::LiveIntervals::shrinkToUses(), verify(), vni_begin(), and vni_end().
1.8.6