LLVM API Documentation
#include <LiveInterval.h>
Collaboration diagram for llvm::LiveInterval:
Public Types | |
typedef std::vector< LiveRange > | Ranges |
typedef Ranges::iterator | iterator |
typedef Ranges::const_iterator | const_iterator |
Public Member Functions | |
LiveInterval (unsigned Reg, float Weight) | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
iterator | advanceTo (iterator I, unsigned Pos) |
void | swap (LiveInterval &other) |
bool | containsOneValue () const |
unsigned | getNextValue () |
bool | empty () const |
unsigned | beginNumber () const |
beginNumber - Return the lowest numbered slot covered by interval. | |
unsigned | endNumber () const |
bool | expiredAt (unsigned index) const |
bool | liveAt (unsigned index) const |
const LiveRange * | getLiveRangeContaining (unsigned Idx) const |
bool | joinable (const LiveInterval &other, unsigned CopyIdx) const |
void | getOverlapingRanges (const LiveInterval &Other, unsigned CopyIdx, std::vector< LiveRange * > &Ranges) |
bool | overlaps (const LiveInterval &other) const |
bool | overlapsFrom (const LiveInterval &other, const_iterator I) const |
void | addRange (LiveRange LR) |
void | join (LiveInterval &other, unsigned CopyIdx) |
void | removeRange (unsigned Start, unsigned End) |
bool | operator< (const LiveInterval &other) const |
void | print (std::ostream &OS, const MRegisterInfo *MRI=0) const |
void | dump () const |
Public Attributes | |
unsigned | reg |
float | weight |
Ranges | ranges |
Definition at line 74 of file LiveInterval.h.
typedef std::vector<LiveRange> llvm::LiveInterval::Ranges |
Definition at line 75 of file LiveInterval.h.
typedef Ranges::iterator llvm::LiveInterval::iterator |
Definition at line 84 of file LiveInterval.h.
typedef Ranges::const_iterator llvm::LiveInterval::const_iterator |
Definition at line 88 of file LiveInterval.h.
llvm::LiveInterval::LiveInterval | ( | unsigned | Reg, | |
float | Weight | |||
) | [inline] |
Definition at line 80 of file LiveInterval.h.
iterator llvm::LiveInterval::begin | ( | ) | [inline] |
Definition at line 85 of file LiveInterval.h.
References ranges.
Referenced by overlaps(), and overlapsFrom().
iterator llvm::LiveInterval::end | ( | ) | [inline] |
Definition at line 86 of file LiveInterval.h.
References ranges.
Referenced by advanceTo(), and overlapsFrom().
const_iterator llvm::LiveInterval::begin | ( | ) | const [inline] |
const_iterator llvm::LiveInterval::end | ( | ) | const [inline] |
advanceTo - Advance the specified iterator to point to the LiveRange containing the specified position, or end() if the position is past the end of the interval. If no LiveRange contains this position, but the position is in a hole, this method returns an iterator pointing the the LiveRange immediately after the hole.
Definition at line 98 of file LiveInterval.h.
References end(), and endNumber().
void llvm::LiveInterval::swap | ( | LiveInterval & | other | ) | [inline] |
bool llvm::LiveInterval::containsOneValue | ( | ) | const [inline] |
Definition at line 112 of file LiveInterval.h.
unsigned llvm::LiveInterval::getNextValue | ( | ) | [inline] |
Definition at line 114 of file LiveInterval.h.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), and join().
bool llvm::LiveInterval::empty | ( | ) | const [inline] |
Definition at line 118 of file LiveInterval.h.
References ranges.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), beginNumber(), endNumber(), and print().
unsigned llvm::LiveInterval::beginNumber | ( | ) | const [inline] |
beginNumber - Return the lowest numbered slot covered by interval.
Definition at line 121 of file LiveInterval.h.
References empty(), and ranges.
Referenced by operator<().
unsigned llvm::LiveInterval::endNumber | ( | ) | const [inline] |
endNumber - return the maximum point of the interval of the whole, exclusive.
Definition at line 128 of file LiveInterval.h.
References empty(), and ranges.
Referenced by advanceTo(), and expiredAt().
bool llvm::LiveInterval::expiredAt | ( | unsigned | index | ) | const [inline] |
bool LiveInterval::liveAt | ( | unsigned | index | ) | const |
const LiveRange * LiveInterval::getLiveRangeContaining | ( | unsigned | Idx | ) | const |
getLiveRangeContaining - Return the live range that contains the specified index, or null if there is none.
Definition at line 349 of file LiveInterval.cpp.
References llvm::LiveRange::contains(), llvm::prior(), and ranges.
Referenced by getOverlapingRanges(), join(), and joinable().
bool LiveInterval::joinable | ( | const LiveInterval & | other, | |
unsigned | CopyIdx | |||
) | const |
joinable - Two intervals are joinable if the either don't overlap at all or if the destination of the copy is a single assignment value, and it only overlaps with one value in the source interval.
Definition at line 128 of file LiveInterval.cpp.
References getLiveRangeContaining(), NontrivialOverlap(), ranges, and llvm::LiveRange::ValId.
void LiveInterval::getOverlapingRanges | ( | const LiveInterval & | Other, | |
unsigned | CopyIdx, | |||
std::vector< LiveRange * > & | Ranges | |||
) |
getOverlapingRanges - Given another live interval which is defined as a copy from this one, return a list of all of the live ranges where the two overlap and have different value numbers.
Definition at line 164 of file LiveInterval.cpp.
References getLiveRangeContaining(), NontrivialOverlap(), ranges, and llvm::LiveRange::ValId.
bool llvm::LiveInterval::overlaps | ( | const LiveInterval & | other | ) | const [inline] |
overlaps - Return true if the intersection of the two live intervals is not empty.
Definition at line 157 of file LiveInterval.h.
References begin(), and overlapsFrom().
bool LiveInterval::overlapsFrom | ( | const LiveInterval & | other, | |
const_iterator | I | |||
) | const |
overlapsFrom - Return true if the intersection of the two live intervals is not empty. The specified iterator is a hint that we can begin scanning the Other interval starting at I.
Definition at line 64 of file LiveInterval.cpp.
References begin(), end(), and ranges.
Referenced by overlaps().
void llvm::LiveInterval::addRange | ( | LiveRange | LR | ) | [inline] |
addRange - Add the specified LiveRange to this interval, merging intervals as appropriate. This returns an iterator to the inserted live range (which may have grown since it was inserted.
Definition at line 169 of file LiveInterval.h.
References ranges.
Referenced by llvm::LiveIntervals::addIntervalsForSpills().
void LiveInterval::join | ( | LiveInterval & | other, | |
unsigned | CopyIdx | |||
) |
join - Join two live intervals (this, and other) together. This operation is the result of a copy instruction in the source program, that occurs at index 'CopyIdx' that copies from 'other' to 'this'. This destroys 'other'.
Definition at line 365 of file LiveInterval.cpp.
References E, getLiveRangeContaining(), getNextValue(), InsertPos, llvm::MVT::Other, ranges, llvm::LiveRange::ValId, and weight.
void LiveInterval::removeRange | ( | unsigned | Start, | |
unsigned | End | |||
) |
removeRange - Remove the specified range from this interval. Note that the range must already be in this interval in its entirety.
Definition at line 315 of file LiveInterval.cpp.
References llvm::next(), and ranges.
bool llvm::LiveInterval::operator< | ( | const LiveInterval & | other | ) | const [inline] |
void LiveInterval::print | ( | std::ostream & | OS, | |
const MRegisterInfo * | MRI = 0 | |||
) | const |
Definition at line 409 of file LiveInterval.cpp.
References E, empty(), llvm::MRegisterInfo::getName(), llvm::MRegisterInfo::isPhysicalRegister(), MRI, ranges, reg, and weight.
void LiveInterval::dump | ( | ) | const |
Definition at line 427 of file LiveInterval.cpp.
unsigned llvm::LiveInterval::reg |
Definition at line 76 of file LiveInterval.h.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), print(), and swap().
Definition at line 77 of file LiveInterval.h.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), join(), print(), llvm::LiveIntervals::runOnMachineFunction(), and swap().
Definition at line 78 of file LiveInterval.h.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), addRange(), begin(), beginNumber(), empty(), end(), endNumber(), getLiveRangeContaining(), getOverlapingRanges(), isZeroLengthInterval(), join(), joinable(), liveAt(), overlapsFrom(), print(), removeRange(), and swap().