LLVM API Documentation

llvm::LiveInterval Struct Reference

#include <LiveInterval.h>

Collaboration diagram for llvm::LiveInterval:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< LiveRangeRanges
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 LiveRangegetLiveRangeContaining (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

Detailed Description

LiveInterval - This class represents some number of live ranges for a register or value. This class also contains a bit of register allocator state.

Definition at line 74 of file LiveInterval.h.


Member Typedef Documentation

typedef Ranges::const_iterator llvm::LiveInterval::const_iterator

Definition at line 88 of file LiveInterval.h.

typedef Ranges::iterator llvm::LiveInterval::iterator

Definition at line 84 of file LiveInterval.h.

typedef std::vector<LiveRange> llvm::LiveInterval::Ranges

Definition at line 75 of file LiveInterval.h.


Constructor & Destructor Documentation

llvm::LiveInterval::LiveInterval ( unsigned  Reg,
float  Weight 
) [inline]

Definition at line 80 of file LiveInterval.h.


Member Function Documentation

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().

iterator llvm::LiveInterval::advanceTo ( iterator  I,
unsigned  Pos 
) [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().

const_iterator llvm::LiveInterval::begin (  )  const [inline]

Definition at line 89 of file LiveInterval.h.

References ranges.

iterator llvm::LiveInterval::begin (  )  [inline]

Definition at line 85 of file LiveInterval.h.

References ranges.

Referenced by overlaps(), and overlapsFrom().

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<().

bool llvm::LiveInterval::containsOneValue (  )  const [inline]

Definition at line 112 of file LiveInterval.h.

void LiveInterval::dump (  )  const

Definition at line 427 of file LiveInterval.cpp.

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().

const_iterator llvm::LiveInterval::end (  )  const [inline]

Definition at line 90 of file LiveInterval.h.

References ranges.

iterator llvm::LiveInterval::end (  )  [inline]

Definition at line 86 of file LiveInterval.h.

References ranges.

Referenced by advanceTo(), and overlapsFrom().

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]

Definition at line 133 of file LiveInterval.h.

References endNumber().

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().

unsigned llvm::LiveInterval::getNextValue (  )  [inline]

Definition at line 114 of file LiveInterval.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), and join().

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.

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.

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.

bool LiveInterval::liveAt ( unsigned  index  )  const

Definition at line 36 of file LiveInterval.cpp.

References r, and ranges.

bool llvm::LiveInterval::operator< ( const LiveInterval other  )  const [inline]

Definition at line 184 of file LiveInterval.h.

References beginNumber().

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 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::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.

void llvm::LiveInterval::swap ( LiveInterval other  )  [inline]

Definition at line 105 of file LiveInterval.h.

References NumValues, ranges, reg, and weight.


Member Data Documentation

Ranges llvm::LiveInterval::ranges

Definition at line 78 of file LiveInterval.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), addRange(), begin(), beginNumber(), empty(), end(), endNumber(), getLiveRangeContaining(), getOverlapingRanges(), join(), joinable(), liveAt(), overlapsFrom(), print(), removeRange(), and swap().

unsigned llvm::LiveInterval::reg

Definition at line 76 of file LiveInterval.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), print(), and swap().

float llvm::LiveInterval::weight

Definition at line 77 of file LiveInterval.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), join(), print(), llvm::LiveIntervals::runOnMachineFunction(), and swap().


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