LLVM
15.0.0git
|
SlotIndex - An opaque wrapper around machine indexes. More...
#include "llvm/CodeGen/SlotIndexes.h"
Public Types | |
enum | { InstrDist = 4 * Slot_Count } |
Public Member Functions | |
SlotIndex ()=default | |
Construct an invalid index. More... | |
SlotIndex (const SlotIndex &li, Slot s) | |
bool | isValid () const |
Returns true if this is a valid index. More... | |
operator bool () const | |
Return true for a valid index. More... | |
void | print (raw_ostream &os) const |
Print this index to the given raw_ostream. More... | |
void | dump () const |
Dump this index to stderr. More... | |
bool | operator== (SlotIndex other) const |
Compare two SlotIndex objects for equality. More... | |
bool | operator!= (SlotIndex other) const |
Compare two SlotIndex objects for inequality. More... | |
bool | operator< (SlotIndex other) const |
Compare two SlotIndex objects. More... | |
bool | operator<= (SlotIndex other) const |
Compare two SlotIndex objects. More... | |
bool | operator> (SlotIndex other) const |
Compare two SlotIndex objects. More... | |
bool | operator>= (SlotIndex other) const |
Compare two SlotIndex objects. More... | |
int | distance (SlotIndex other) const |
Return the distance from this index to the given one. More... | |
int | getInstrDistance (SlotIndex other) const |
Return the scaled distance from this index to the given one, where all slots on the same instruction have zero distance. More... | |
bool | isBlock () const |
isBlock - Returns true if this is a block boundary slot. More... | |
bool | isEarlyClobber () const |
isEarlyClobber - Returns true if this is an early-clobber slot. More... | |
bool | isRegister () const |
isRegister - Returns true if this is a normal register use/def slot. More... | |
bool | isDead () const |
isDead - Returns true if this is a dead def kill slot. More... | |
SlotIndex | getBaseIndex () const |
Returns the base index for associated with this index. More... | |
SlotIndex | getBoundaryIndex () const |
Returns the boundary index for associated with this index. More... | |
SlotIndex | getRegSlot (bool EC=false) const |
Returns the register use/def slot in the current instruction for a normal or early-clobber def. More... | |
SlotIndex | getDeadSlot () const |
Returns the dead def kill slot for the current instruction. More... | |
SlotIndex | getNextSlot () const |
Returns the next slot in the index list. More... | |
SlotIndex | getNextIndex () const |
Returns the next index. More... | |
SlotIndex | getPrevSlot () const |
Returns the previous slot in the index list. More... | |
SlotIndex | getPrevIndex () const |
Returns the previous index. More... | |
Static Public Member Functions | |
static bool | isSameInstr (SlotIndex A, SlotIndex B) |
isSameInstr - Return true if A and B refer to the same instruction. More... | |
static bool | isEarlierInstr (SlotIndex A, SlotIndex B) |
isEarlierInstr - Return true if A refers to an instruction earlier than B. More... | |
static bool | isEarlierEqualInstr (SlotIndex A, SlotIndex B) |
Return true if A refers to the same instruction as B or an earlier one. More... | |
Friends | |
class | SlotIndexes |
SlotIndex - An opaque wrapper around machine indexes.
Definition at line 82 of file SlotIndexes.h.
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 133 of file SlotIndexes.h.
|
default |
Construct an invalid index.
Referenced by getBaseIndex(), getBoundaryIndex(), getDeadSlot(), getNextIndex(), getNextSlot(), getPrevIndex(), getPrevSlot(), and getRegSlot().
Definition at line 143 of file SlotIndexes.h.
References assert(), and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer().
Return the distance from this index to the given one.
Definition at line 213 of file SlotIndexes.h.
LLVM_DUMP_METHOD void SlotIndex::dump | ( | ) | const |
Dump this index to stderr.
Definition at line 277 of file SlotIndexes.cpp.
References llvm::dbgs(), and print().
|
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 240 of file SlotIndexes.h.
References SlotIndex().
Referenced by llvm::RegisterOperands::adjustLaneLiveness(), llvm::GCNDownwardRPTracker::advanceBeforeNext(), llvm::SplitEditor::enterIntvBefore(), findInsertLocation(), llvm::RegPressureTracker::getLastUsedLanes(), llvm::getLiveRegsBefore(), getUsedRegMask(), llvm::GCNUpwardRPTracker::isValid(), llvm::LiveRange::isZeroLength(), llvm::SplitEditor::leaveIntvBefore(), llvm::LiveRange::Query(), and llvm::LiveIntervals::removeVRegDefAt().
|
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 247 of file SlotIndexes.h.
References SlotIndex().
Referenced by llvm::SplitEditor::enterIntvAfter(), and llvm::SplitEditor::leaveIntvAfter().
|
inline |
Returns the dead def kill slot for the current instruction.
Definition at line 258 of file SlotIndexes.h.
References SlotIndex().
Referenced by llvm::RegisterOperands::adjustLaneLiveness(), llvm::getLiveRegsAfter(), llvm::RegPressureTracker::getLiveThroughAt(), rematerializeCheapDef(), replaceDominatedUses(), and llvm::LiveIntervals::shrinkToUses().
Return the scaled distance from this index to the given one, where all slots on the same instruction have zero distance.
Definition at line 219 of file SlotIndexes.h.
References llvm::IndexListEntry::getIndex().
|
inline |
Returns the next index.
This is the index corresponding to the this index's slot, but for the next instruction.
Definition at line 278 of file SlotIndexes.h.
References SlotIndex().
|
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 268 of file SlotIndexes.h.
References s, and SlotIndex().
Referenced by llvm::SplitEditor::leaveIntvAfter(), and llvm::SplitEditor::leaveIntvBefore().
|
inline |
Returns the previous index.
This is the index corresponding to this index's slot, but for the previous instruction.
Definition at line 298 of file SlotIndexes.h.
References SlotIndex().
Referenced by findInsertLocation().
|
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 288 of file SlotIndexes.h.
References s, and SlotIndex().
Referenced by llvm::LiveRange::getVNInfoBefore(), and llvm::MachineBasicBlock::SplitCriticalEdge().
Returns the register use/def slot in the current instruction for a normal or early-clobber def.
Definition at line 253 of file SlotIndexes.h.
References SlotIndex().
Referenced by llvm::LiveRangeEdit::allUsesAvailableAt(), llvm::RegPressureTracker::bumpDownwardPressure(), llvm::RegPressureTracker::bumpUpwardPressure(), llvm::X86InstrInfo::classifyLEAReg(), llvm::LiveInterval::computeSubRangeUndefs(), llvm::RISCVInstrInfo::convertToThreeAddress(), createDeadDef(), dumpMachineInstrRangeWithSlotIndex(), findUseBetween(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::RegPressureTracker::getCurrSlot(), llvm::RegPressureTracker::getLiveThroughAt(), hasOneUse(), isDefBetween(), moveAndTeeForMultiUse(), moveForSingleUse(), llvm::RegPressureTracker::recede(), llvm::RegPressureTracker::recedeSkipDebugValues(), llvm::LiveRangeEdit::rematerializeAt(), rematerializeCheapDef(), replaceDominatedUses(), llvm::GCNScheduleDAGMILive::schedule(), llvm::ScheduleDAGMILive::scheduleMI(), llvm::GCNIterativeScheduler::scheduleRegion(), and llvm::LiveIntervals::shrinkToUses().
|
inline |
isBlock - Returns true if this is a block boundary slot.
Definition at line 225 of file SlotIndexes.h.
Referenced by llvm::VNInfo::isPHIDef().
|
inline |
isDead - Returns true if this is a dead def kill slot.
Definition at line 235 of file SlotIndexes.h.
Referenced by addSegmentsWithValNo(), and llvm::LiveQueryResult::isDeadDef().
Return true if A refers to the same instruction as B or an earlier one.
This is equivalent to !isEarlierInstr(B, A).
Definition at line 208 of file SlotIndexes.h.
References A, B, and isEarlierInstr().
Referenced by findNextInsertLocation().
isEarlierInstr - Return true if A refers to an instruction earlier than B.
This is equivalent to A < B && !isSameInstr(A, B).
Definition at line 202 of file SlotIndexes.h.
Referenced by isEarlierEqualInstr(), and llvm::LiveRange::Query().
|
inline |
isEarlyClobber - Returns true if this is an early-clobber slot.
Definition at line 228 of file SlotIndexes.h.
|
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 232 of file SlotIndexes.h.
isSameInstr - Return true if A and B refer to the same instruction.
Definition at line 196 of file SlotIndexes.h.
Referenced by llvm::LiveRangeEdit::allUsesAvailableAt(), llvm::SplitAnalysis::BlockInfo::isOneInstr(), isPlainlyKilled(), llvm::SplitEditor::leaveIntvAfter(), and llvm::LiveRange::Query().
|
inline |
Returns true if this is a valid index.
Invalid indices do not point into an index table, and cannot be compared.
Definition at line 150 of file SlotIndexes.h.
References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer().
Referenced by llvm::SIRegisterInfo::findReachingDef(), llvm::LiveRangeUpdater::isDirty(), llvm::VNInfo::isUnused(), operator bool(), and print().
|
inlineexplicit |
|
inline |
Compare two SlotIndex objects for inequality.
Definition at line 168 of file SlotIndexes.h.
|
inline |
Compare two SlotIndex objects.
Return true if the first index is strictly lower than the second.
Definition at line 174 of file SlotIndexes.h.
|
inline |
Compare two SlotIndex objects.
Return true if the first index is lower than, or equal to, the second.
Definition at line 179 of file SlotIndexes.h.
|
inline |
Compare two SlotIndex objects for equality.
Definition at line 164 of file SlotIndexes.h.
|
inline |
Compare two SlotIndex objects.
Return true if the first index is greater than the second.
Definition at line 185 of file SlotIndexes.h.
|
inline |
Compare two SlotIndex objects.
Return true if the first index is greater than, or equal to, the second.
Definition at line 191 of file SlotIndexes.h.
void SlotIndex::print | ( | raw_ostream & | os | ) | const |
Print this index to the given raw_ostream.
Definition at line 268 of file SlotIndexes.cpp.
References llvm::IndexListEntry::getIndex(), and isValid().
Referenced by dump(), and llvm::operator<<().
|
friend |
Definition at line 83 of file SlotIndexes.h.