LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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
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 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 69 of file LiveInterval.h.


Member Typedef Documentation

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

Definition at line 83 of file LiveInterval.h.

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

Definition at line 79 of file LiveInterval.h.

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

Definition at line 70 of file LiveInterval.h.


Constructor & Destructor Documentation

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

Definition at line 75 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 159 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 93 of file LiveInterval.h.

References end(), and endNumber().

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

Definition at line 84 of file LiveInterval.h.

References ranges.

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

Definition at line 80 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 116 of file LiveInterval.h.

References empty(), and ranges.

Referenced by operator<().

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

Definition at line 107 of file LiveInterval.h.

void LiveInterval::dump  )  const
 

Definition at line 367 of file LiveInterval.cpp.

bool llvm::LiveInterval::empty  )  const [inline]
 

Definition at line 113 of file LiveInterval.h.

References ranges.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), beginNumber(), endNumber(), and llvm::operator<<().

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

Definition at line 85 of file LiveInterval.h.

References ranges.

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

Definition at line 81 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 123 of file LiveInterval.h.

References empty(), and ranges.

Referenced by advanceTo(), and expiredAt().

bool llvm::LiveInterval::expiredAt unsigned  index  )  const [inline]
 

Definition at line 128 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 294 of file LiveInterval.cpp.

References llvm::prior(), and ranges.

Referenced by join(), and joinable().

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

Definition at line 109 of file LiveInterval.h.

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

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 310 of file LiveInterval.cpp.

References E, getLiveRangeContaining(), getNextValue(), NumValues, ranges, 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 106 of file LiveInterval.cpp.

References getLiveRangeContaining(), and ranges.

bool LiveInterval::liveAt unsigned  index  )  const
 

Definition at line 35 of file LiveInterval.cpp.

References r, and ranges.

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

Definition at line 174 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 147 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 63 of file LiveInterval.cpp.

References begin(), end(), and ranges.

Referenced by overlaps().

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 260 of file LiveInterval.cpp.

References llvm::next(), and ranges.

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

Definition at line 100 of file LiveInterval.h.

References NumValues, ranges, reg, and weight.


Member Data Documentation

Ranges llvm::LiveInterval::ranges
 

Definition at line 73 of file LiveInterval.h.

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

unsigned llvm::LiveInterval::reg
 

Definition at line 71 of file LiveInterval.h.

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

float llvm::LiveInterval::weight
 

Definition at line 72 of file LiveInterval.h.

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


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