LLVM API Documentation
SlotIndex - An opaque wrapper around machine indexes. More...
#include <SlotIndexes.h>
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 |
SlotIndex - An opaque wrapper around machine indexes.
Definition at line 92 of file SlotIndexes.h.
anonymous enum |
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.
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().
Definition at line 153 of file SlotIndexes.h.
References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits >::getPointer().
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().
SlotIndex llvm::SlotIndex::getBaseIndex | ( | ) | const [inline] |
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().
SlotIndex llvm::SlotIndex::getBoundaryIndex | ( | ) | const [inline] |
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().
SlotIndex llvm::SlotIndex::getDeadSlot | ( | ) | const [inline] |
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().
SlotIndex llvm::SlotIndex::getNextIndex | ( | ) | const [inline] |
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().
SlotIndex llvm::SlotIndex::getNextSlot | ( | ) | const [inline] |
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().
SlotIndex llvm::SlotIndex::getPrevIndex | ( | ) | const [inline] |
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().
SlotIndex llvm::SlotIndex::getPrevSlot | ( | ) | const [inline] |
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] |
Returns the register use/def slot in the current instruction for a normal or early-clobber def.
Definition at line 257 of file SlotIndexes.h.
References SlotIndex().
Referenced by llvm::RegPressureTracker::bumpDownwardPressure(), llvm::LiveRangeCalc::createDeadDefs(), dumpMachineInstrRangeWithSlotIndex(), llvm::LiveRangeCalc::extendToUses(), findUseBetween(), llvm::RegPressureTracker::getCurrSlot(), llvm::RegPressureTracker::recede(), llvm::LiveRangeEdit::rematerializeAt(), llvm::LiveIntervals::repairIntervalsInRange(), and llvm::LiveIntervals::shrinkToUses().
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().
bool llvm::SlotIndex::isEarlyClobber | ( | ) | const [inline] |
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] |
isSameInstr - Return true if A and B refer to the same instruction.
Definition at line 206 of file SlotIndexes.h.
References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits >::getPointer().
Referenced by llvm::LiveRange::createDeadDef(), llvm::SplitAnalysis::BlockInfo::isOneInstr(), isPlainlyKilled(), llvm::SplitEditor::leaveIntvAfter(), and llvm::LiveRange::Query().
bool llvm::SlotIndex::isValid | ( | ) | const [inline] |
Returns true if this is a valid index. Invalid indicies do not point into an index table, and cannot be compared.
Definition at line 160 of file SlotIndexes.h.
References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits >::getPointer().
Referenced by llvm::LiveRangeCalc::extend(), llvm::SlotIndexes::getInstructionFromIndex(), llvm::LiveRangeUpdater::isDirty(), llvm::VNInfo::isUnused(), operator bool(), print(), and llvm::LiveIntervals::repairIntervalsInRange().
LLVM_EXPLICIT llvm::SlotIndex::operator bool | ( | ) | const [inline] |
Compare two SlotIndex objects for inequality.
Definition at line 178 of file SlotIndexes.h.
Compare two SlotIndex objects. Return true if the first index is strictly lower than the second.
Definition at line 184 of file SlotIndexes.h.
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.
Compare two SlotIndex objects for equality.
Definition at line 174 of file SlotIndexes.h.
Compare two SlotIndex objects. Return true if the first index is greater than the second.
Definition at line 195 of file SlotIndexes.h.
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<<().
friend class SlotIndexes [friend] |
Definition at line 93 of file SlotIndexes.h.