LLVM: llvm::SlotIndexes Class Reference (original) (raw)
SlotIndexes pass. More...
#include "[llvm/CodeGen/SlotIndexes.h](SlotIndexes%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| SlotIndexes (SlotIndexes &&)=default | |
| SlotIndexes (MachineFunction &MF) | |
| LLVM_ABI | ~SlotIndexes () |
| void | reanalyze (MachineFunction &MF) |
| LLVM_ABI void | print (raw_ostream &OS) const |
| LLVM_ABI void | dump () const |
| Dump the indexes. | |
| LLVM_ABI void | repairIndexesInRange (MachineBasicBlock *MBB, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End) |
| Repair indexes after adding and removing instructions. | |
| SlotIndex | getZeroIndex () |
| Returns the zero index for this analysis. | |
| SlotIndex | getLastIndex () |
| Returns the base index of the last slot in this analysis. | |
| bool | hasIndex (const MachineInstr &instr) const |
| Returns true if the given machine instr is mapped to an index, otherwise returns false. | |
| SlotIndex | getInstructionIndex (const MachineInstr &MI, bool IgnoreBundle=false) const |
| Returns the base index for the given instruction. | |
| MachineInstr * | getInstructionFromIndex (SlotIndex index) const |
| Returns the instruction for the given index, or null if the given index has no instruction associated with it. | |
| SlotIndex | getNextNonNullIndex (SlotIndex Index) |
| Returns the next non-null index, if one exists. | |
| SlotIndex | getIndexBefore (const MachineInstr &MI) const |
| getIndexBefore - Returns the index of the last indexed instruction before MI, or the start index of its basic block. | |
| SlotIndex | getIndexAfter (const MachineInstr &MI) const |
| getIndexAfter - Returns the index of the first indexed instruction after MI, or the end index of its basic block. | |
| const std::pair< SlotIndex, SlotIndex > & | getMBBRange (unsigned Num) const |
| Return the (start,end) range of the given basic block number. | |
| const std::pair< SlotIndex, SlotIndex > & | getMBBRange (const MachineBasicBlock *MBB) const |
| Return the (start,end) range of the given basic block. | |
| SlotIndex | getMBBStartIdx (unsigned Num) const |
| Returns the first index in the given basic block number. | |
| SlotIndex | getMBBStartIdx (const MachineBasicBlock *mbb) const |
| Returns the first index in the given basic block. | |
| SlotIndex | getMBBEndIdx (unsigned Num) const |
| Returns the index past the last valid index in the given basic block. | |
| SlotIndex | getMBBEndIdx (const MachineBasicBlock *mbb) const |
| Returns the index past the last valid index in the given basic block. | |
| SlotIndex | getMBBLastIdx (const MachineBasicBlock *MBB) const |
| Returns the last valid index in the given basic block. | |
| MBBIndexIterator | getMBBLowerBound (MBBIndexIterator Start, SlotIndex Idx) const |
| Get an iterator pointing to the first IdxMBBPair with SlotIndex greater than or equal to Idx. | |
| MBBIndexIterator | getMBBLowerBound (SlotIndex Idx) const |
| MBBIndexIterator | getMBBUpperBound (SlotIndex Idx) const |
| Get an iterator pointing to the first IdxMBBPair with SlotIndex greater than Idx. | |
| MBBIndexIterator | MBBIndexBegin () const |
| Returns an iterator for the begin of the idx2MBBMap. | |
| MBBIndexIterator | MBBIndexEnd () const |
| Return an iterator for the end of the idx2MBBMap. | |
| MachineBasicBlock * | getMBBFromIndex (SlotIndex index) const |
| Returns the basic block which the given index falls in. | |
| SlotIndex | insertMachineInstrInMaps (MachineInstr &MI, bool Late=false) |
| Insert the given machine instruction into the mapping. | |
| LLVM_ABI void | removeMachineInstrFromMaps (MachineInstr &MI, bool AllowBundled=false) |
| Removes machine instruction (bundle) MI from the mapping. | |
| LLVM_ABI void | removeSingleMachineInstrFromMaps (MachineInstr &MI) |
| Removes a single machine instruction MI from the mapping. | |
| SlotIndex | replaceMachineInstrInMaps (MachineInstr &MI, MachineInstr &NewMI) |
| ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in maps used by register allocator. | |
| void | insertMBBInMaps (MachineBasicBlock *mbb) |
| Add the given MachineBasicBlock into the maps. | |
| LLVM_ABI void | packIndexes () |
| Renumber all indexes using the default instruction distance. |
| Friends | |
|---|---|
| class | SlotIndexesWrapperPass |
SlotIndexes pass.
This pass assigns indexes to each instruction.
Definition at line 298 of file SlotIndexes.h.
◆ MBBIndexIterator
Iterator over the idx2MBBMap (sorted pairs of slot index of basic block begin and basic block)
Definition at line 493 of file SlotIndexes.h.
| llvm::SlotIndexes::SlotIndexes ( SlotIndexes && ) | default |
|---|
◆ SlotIndexes() [2/2]
◆ ~SlotIndexes()
| SlotIndexes::~SlotIndexes | ( | ) |
|---|
◆ dump()
◆ getIndexAfter()
◆ getIndexBefore()
◆ getInstructionFromIndex()
◆ getInstructionIndex()
Returns the base index for the given instruction.
Definition at line 380 of file SlotIndexes.h.
References assert(), llvm::getBundleEnd(), llvm::getBundleStart(), llvm::MachineInstr::isDebugInstr(), MI, and llvm::skipDebugInstructionsForward().
Referenced by buildVRegToDbgValueMap(), llvm::LiveInterval::computeSubRangeUndefs(), createDeadDef(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), insertMBBInMaps(), llvm::MachineBasicBlock::print(), and repairIndexesInRange().
◆ getLastIndex()
| SlotIndex llvm::SlotIndexes::getLastIndex ( ) | inline |
|---|
◆ getMBBEndIdx() [1/2]
◆ getMBBEndIdx() [2/2]
◆ getMBBFromIndex()
◆ getMBBLastIdx()
Returns the last valid index in the given basic block.
This index corresponds to the dead slot of the last non-debug instruction and can be used to find live-out ranges of the block. Note that getMBBEndIdx returns the start index of the next block, which is also used as the start index for segments with phi-def values. If the basic block doesn't contain any non-debug instructions, this returns the same as getMBBStartIdx.getDeadSlot().
Definition at line 487 of file SlotIndexes.h.
References getMBBEndIdx(), llvm::SlotIndex::getPrevSlot(), and MBB.
Referenced by llvm::GCNRegPressurePrinter::runOnMachineFunction().
◆ getMBBLowerBound() [1/2]
| MBBIndexIterator llvm::SlotIndexes::getMBBLowerBound ( MBBIndexIterator Start, SlotIndex Idx ) const | inline |
|---|
◆ getMBBLowerBound() [2/2]
| MBBIndexIterator llvm::SlotIndexes::getMBBLowerBound ( SlotIndex Idx) const | inline |
|---|
◆ getMBBRange() [1/2]
◆ getMBBRange() [2/2]
◆ getMBBStartIdx() [1/2]
◆ getMBBStartIdx() [2/2]
◆ getMBBUpperBound()
| MBBIndexIterator llvm::SlotIndexes::getMBBUpperBound ( SlotIndex Idx) const | inline |
|---|
◆ getNextNonNullIndex()
◆ getZeroIndex()
| SlotIndex llvm::SlotIndexes::getZeroIndex ( ) | inline |
|---|
◆ hasIndex()
◆ insertMachineInstrInMaps()
Insert the given machine instruction into the mapping.
Returns the assigned index. If Late is set and there are null indexes between mi's neighboring instructions, create the new index after the null indexes instead of before them.
Definition at line 543 of file SlotIndexes.h.
References assert(), getIndexAfter(), getIndexBefore(), llvm::ilist_node_impl< OptionsT >::getIterator(), and MI.
Referenced by insertCSRRestores(), insertCSRSaves(), llvm::SIInstrInfo::insertScratchExecCopy(), repairIndexesInRange(), llvm::SIInstrInfo::restoreExec(), llvm::SIRegisterInfo::restoreSGPR(), and llvm::SIRegisterInfo::spillSGPR().
◆ insertMBBInMaps()
◆ MBBIndexBegin()
| MBBIndexIterator llvm::SlotIndexes::MBBIndexBegin ( ) const | inline |
|---|
◆ MBBIndexEnd()
| MBBIndexIterator llvm::SlotIndexes::MBBIndexEnd ( ) const | inline |
|---|
◆ packIndexes()
| void SlotIndexes::packIndexes | ( | ) |
|---|
◆ print()
◆ reanalyze()
◆ removeMachineInstrFromMaps()
| void SlotIndexes::removeMachineInstrFromMaps | ( | MachineInstr & | MI, |
|---|---|---|---|
| bool | AllowBundled = false ) |
◆ removeSingleMachineInstrFromMaps()
| void SlotIndexes::removeSingleMachineInstrFromMaps | ( | MachineInstr & | MI | ) |
|---|
◆ repairIndexesInRange()
Repair indexes after adding and removing instructions.
Definition at line 191 of file SlotIndexes.cpp.
References assert(), getInstructionIndex(), llvm::ilist_node_impl< OptionsT >::getIterator(), getMBBEndIdx(), getMBBStartIdx(), llvm::MachineInstr::getParent(), insertMachineInstrInMaps(), llvm::MachineInstr::isDebugOrPseudoInstr(), MBB, MBBI, MI, and removeMachineInstrFromMaps().
Referenced by insertCSRRestores(), and insertCSRSaves().
◆ replaceMachineInstrInMaps()
◆ SlotIndexesWrapperPass
The documentation for this class was generated from the following files:
- include/llvm/CodeGen/SlotIndexes.h
- lib/CodeGen/SlotIndexes.cpp