LLVM API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
llvm::SlotIndex Class Reference

SlotIndex - An opaque wrapper around machine indexes. More...

#include <SlotIndexes.h>

List of all members.

Public Types

enum  { InstrDist = 4 * Slot_Count }

Public Member Functions

 SlotIndex ()
 Construct an invalid index.
 SlotIndex (const SlotIndex &li, Slot s)
bool isValid () const
LLVM_EXPLICIT operator bool () const
 Return true for a valid index.
void print (raw_ostream &os) const
 Print this index to the given raw_ostream.
void dump () const
 Dump this index to stderr.
bool operator== (SlotIndex other) const
 Compare two SlotIndex objects for equality.
bool operator!= (SlotIndex other) const
 Compare two SlotIndex objects for inequality.
bool operator< (SlotIndex other) const
bool operator<= (SlotIndex other) const
bool operator> (SlotIndex other) const
bool operator>= (SlotIndex other) const
int distance (SlotIndex other) const
 Return the distance from this index to the given one.
int getInstrDistance (SlotIndex other) const
bool isBlock () const
 isBlock - Returns true if this is a block boundary slot.
bool isEarlyClobber () const
 isEarlyClobber - Returns true if this is an early-clobber slot.
bool isRegister () const
bool isDead () const
 isDead - Returns true if this is a dead def kill slot.
SlotIndex getBaseIndex () const
SlotIndex getBoundaryIndex () const
SlotIndex getRegSlot (bool EC=false) const
SlotIndex getDeadSlot () const
 Returns the dead def kill slot for the current instruction.
SlotIndex getNextSlot () const
SlotIndex getNextIndex () const
SlotIndex getPrevSlot () const
SlotIndex getPrevIndex () const

Static Public Member Functions

static bool isSameInstr (SlotIndex A, SlotIndex B)
 isSameInstr - Return true if A and B refer to the same instruction.
static bool isEarlierInstr (SlotIndex A, SlotIndex B)

Friends

class SlotIndexes

Detailed Description

SlotIndex - An opaque wrapper around machine indexes.

Definition at line 92 of file SlotIndexes.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
InstrDist 

The default distance between instructions as returned by distance(). This may vary as instructions are inserted and removed.

Definition at line 143 of file SlotIndexes.h.


Constructor & Destructor Documentation

llvm::SlotIndex::SlotIndex ( ) [inline]

Construct an invalid index.

Definition at line 150 of file SlotIndexes.h.

Referenced by getBaseIndex(), getBoundaryIndex(), getDeadSlot(), getNextIndex(), getNextSlot(), getPrevIndex(), getPrevSlot(), and getRegSlot().

llvm::SlotIndex::SlotIndex ( const SlotIndex li,
Slot  s 
) [inline]

Member Function Documentation

int llvm::SlotIndex::distance ( SlotIndex  other) const [inline]

Return the distance from this index to the given one.

Definition at line 217 of file SlotIndexes.h.

void SlotIndex::dump ( ) const

Dump this index to stderr.

Definition at line 245 of file SlotIndexes.cpp.

References llvm::dbgs(), and print().

Returns the base index for associated with this index. The base index is the one associated with the Slot_Block slot for the instruction pointed to by this index.

Definition at line 244 of file SlotIndexes.h.

References SlotIndex().

Referenced by llvm::SplitEditor::enterIntvBefore(), findInsertLocation(), llvm::LiveRange::isLocal(), llvm::LiveRange::isZeroLength(), llvm::SplitEditor::leaveIntvBefore(), llvm::LiveRange::Query(), llvm::SplitEditor::splitLiveThroughBlock(), and llvm::SplitEditor::splitRegOutBlock().

Returns the boundary index for associated with this index. The boundary index is the one associated with the Slot_Block slot for the instruction pointed to by this index.

Definition at line 251 of file SlotIndexes.h.

References SlotIndex().

Referenced by llvm::SplitEditor::enterIntvAfter(), llvm::LiveRange::isLocal(), llvm::SplitEditor::leaveIntvAfter(), llvm::SplitEditor::splitLiveThroughBlock(), and llvm::SplitEditor::splitRegInBlock().

Returns the dead def kill slot for the current instruction.

Definition at line 262 of file SlotIndexes.h.

References SlotIndex().

Referenced by llvm::LiveIntervals::computeDeadValues(), llvm::LiveRange::createDeadDef(), llvm::LiveIntervals::repairIntervalsInRange(), and llvm::LiveIntervals::shrinkToUses().

int llvm::SlotIndex::getInstrDistance ( SlotIndex  other) const [inline]

Return the scaled distance from this index to the given one, where all slots on the same instruction have zero distance.

Definition at line 223 of file SlotIndexes.h.

References llvm::IndexListEntry::getIndex().

Returns the next index. This is the index corresponding to the this index's slot, but for the next instruction.

Definition at line 282 of file SlotIndexes.h.

References SlotIndex().

Returns the next slot in the index list. This could be either the next slot for the instruction pointed to by this index or, if this index is a STORE, the first slot for the next instruction. WARNING: This method is considerably more expensive than the methods that return specific slots (getUseIndex(), etc). If you can - please use one of those methods.

Definition at line 272 of file SlotIndexes.h.

References SlotIndex().

Referenced by llvm::SplitEditor::leaveIntvAfter(), and llvm::SplitEditor::leaveIntvBefore().

Returns the previous index. This is the index corresponding to this index's slot, but for the previous instruction.

Definition at line 302 of file SlotIndexes.h.

References SlotIndex().

Referenced by findInsertLocation().

Returns the previous slot in the index list. This could be either the previous slot for the instruction pointed to by this index or, if this index is a Slot_Block, the last slot for the previous instruction. WARNING: This method is considerably more expensive than the methods that return specific slots (getUseIndex(), etc). If you can - please use one of those methods.

Definition at line 292 of file SlotIndexes.h.

References SlotIndex().

Referenced by llvm::SplitEditor::enterIntvAtEnd(), llvm::LiveRangeCalc::extend(), llvm::LiveRange::extendInBlock(), llvm::LiveRange::getVNInfoBefore(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::LiveIntervals::shrinkToUses(), and llvm::MachineBasicBlock::SplitCriticalEdge().

SlotIndex llvm::SlotIndex::getRegSlot ( bool  EC = false) const [inline]
bool llvm::SlotIndex::isBlock ( ) const [inline]

isBlock - Returns true if this is a block boundary slot.

Definition at line 229 of file SlotIndexes.h.

Referenced by llvm::LiveIntervals::intervalIsInOneMBB(), llvm::VNInfo::isPHIDef(), and llvm::LiveRange::overlaps().

bool llvm::SlotIndex::isDead ( ) const [inline]

isDead - Returns true if this is a dead def kill slot.

Definition at line 239 of file SlotIndexes.h.

Referenced by llvm::LiveRange::createDeadDef(), and llvm::LiveQueryResult::isDeadDef().

static bool llvm::SlotIndex::isEarlierInstr ( SlotIndex  A,
SlotIndex  B 
) [inline, static]

isEarlierInstr - Return true if A refers to an instruction earlier than B. This is equivalent to A < B && !isSameInstr(A, B).

Definition at line 212 of file SlotIndexes.h.

References llvm::IndexListEntry::getIndex().

Referenced by llvm::LiveRange::createDeadDef(), and llvm::LiveRange::Query().

isEarlyClobber - Returns true if this is an early-clobber slot.

Definition at line 232 of file SlotIndexes.h.

bool llvm::SlotIndex::isRegister ( ) const [inline]

isRegister - Returns true if this is a normal register use/def slot. Note that early-clobber slots may also be used for uses and defs.

Definition at line 236 of file SlotIndexes.h.

static bool llvm::SlotIndex::isSameInstr ( SlotIndex  A,
SlotIndex  B 
) [inline, static]
bool llvm::SlotIndex::isValid ( ) const [inline]
LLVM_EXPLICIT llvm::SlotIndex::operator bool ( ) const [inline]

Return true for a valid index.

Definition at line 165 of file SlotIndexes.h.

References isValid().

bool llvm::SlotIndex::operator!= ( SlotIndex  other) const [inline]

Compare two SlotIndex objects for inequality.

Definition at line 178 of file SlotIndexes.h.

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

Compare two SlotIndex objects. Return true if the first index is strictly lower than the second.

Definition at line 184 of file SlotIndexes.h.

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

Compare two SlotIndex objects. Return true if the first index is lower than, or equal to, the second.

Definition at line 189 of file SlotIndexes.h.

bool llvm::SlotIndex::operator== ( SlotIndex  other) const [inline]

Compare two SlotIndex objects for equality.

Definition at line 174 of file SlotIndexes.h.

bool llvm::SlotIndex::operator> ( SlotIndex  other) const [inline]

Compare two SlotIndex objects. Return true if the first index is greater than the second.

Definition at line 195 of file SlotIndexes.h.

bool llvm::SlotIndex::operator>= ( SlotIndex  other) const [inline]

Compare two SlotIndex objects. Return true if the first index is greater than, or equal to, the second.

Definition at line 201 of file SlotIndexes.h.

void SlotIndex::print ( raw_ostream os) const

Print this index to the given raw_ostream.

Definition at line 236 of file SlotIndexes.cpp.

References llvm::IndexListEntry::getIndex(), and isValid().

Referenced by dump(), and llvm::operator<<().


Friends And Related Function Documentation

friend class SlotIndexes [friend]

Definition at line 93 of file SlotIndexes.h.


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