class SlotIndexes
Declaration
class SlotIndexes : public MachineFunctionPass { /* full declaration omitted */ };
Description
SlotIndexes pass. This pass assigns indexes to each instruction.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:313
Inherits from: MachineFunctionPass
Member Variables
- private llvm::BumpPtrAllocator ileAllocator
- private llvm::SlotIndexes::IndexList indexList
- private llvm::MachineFunction* mf = nullptr
- private llvm::SlotIndexes::Mi2IndexMap mi2iMap
- private SmallVector<std::pair<SlotIndex, SlotIndex>, 8> MBBRanges
- MBBRanges - Map MBB number to (start, stop) indexes.
- private SmallVector<llvm::IdxMBBPair, 8> idx2MBBMap
- Idx2MBBMap - Sorted list of pairs of index of first instruction and MBB id.
- public static char ID
Method Overview
- public llvm::SlotIndexes::MBBIndexIterator MBBIndexBegin() const
- public llvm::SlotIndexes::MBBIndexIterator MBBIndexEnd() const
- public SlotIndexes()
- public llvm::SlotIndexes::MBBIndexIterator advanceMBBIndex(llvm::SlotIndexes::MBBIndexIterator I, llvm::SlotIndex To) const
- private llvm::IndexListEntry * createEntry(llvm::MachineInstr * mi, unsigned int index)
- public void dump() const
- public llvm::SlotIndexes::MBBIndexIterator findMBBIndex(llvm::SlotIndex Idx) const
- public void getAnalysisUsage(llvm::AnalysisUsage & au) const
- public llvm::SlotIndex getIndexAfter(const llvm::MachineInstr & MI) const
- public llvm::SlotIndex getIndexBefore(const llvm::MachineInstr & MI) const
- public llvm::MachineInstr * getInstructionFromIndex(llvm::SlotIndex index) const
- public llvm::SlotIndex getInstructionIndex(const llvm::MachineInstr & MI, bool IgnoreBundle = false) const
- public llvm::SlotIndex getLastIndex()
- public llvm::SlotIndex getMBBEndIdx(const llvm::MachineBasicBlock * mbb) const
- public llvm::SlotIndex getMBBEndIdx(unsigned int Num) const
- public llvm::MachineBasicBlock * getMBBFromIndex(llvm::SlotIndex index) const
- public const std::pair<SlotIndex, SlotIndex> & getMBBRange(unsigned int Num) const
- public const std::pair<SlotIndex, SlotIndex> & getMBBRange(const llvm::MachineBasicBlock * MBB) const
- public llvm::SlotIndex getMBBStartIdx(unsigned int Num) const
- public llvm::SlotIndex getMBBStartIdx(const llvm::MachineBasicBlock * mbb) const
- public llvm::SlotIndex getNextNonNullIndex(llvm::SlotIndex Index)
- public llvm::SlotIndex getZeroIndex()
- public bool hasIndex(const llvm::MachineInstr & instr) const
- public void insertMBBInMaps(llvm::MachineBasicBlock * mbb)
- public llvm::SlotIndex insertMachineInstrInMaps(llvm::MachineInstr & MI, bool Late = false)
- public void releaseMemory()
- public void removeMachineInstrFromMaps(llvm::MachineInstr & MI, bool AllowBundled = false)
- public void removeSingleMachineInstrFromMaps(llvm::MachineInstr & MI)
- private void renumberIndexes(IndexList::iterator curItr)
- public void repairIndexesInRange(llvm::MachineBasicBlock * MBB, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End)
- public llvm::SlotIndex replaceMachineInstrInMaps(llvm::MachineInstr & MI, llvm::MachineInstr & NewMI)
- public bool runOnMachineFunction(llvm::MachineFunction & fn)
- public ~SlotIndexes()
Inherited from MachineFunctionPass:
- public doInitialization
- protected getAnalysisUsage
- protected getClearedProperties
- protected getRequiredProperties
- protected getSetProperties
- protected runOnMachineFunction
Inherited from FunctionPass:
- public assignPassManager
- public createPrinterPass
- public getPotentialPassManagerType
- public runOnFunction
- protected skipFunction
Inherited from Pass:
- public assignPassManager
- public createPass
- public createPrinterPass
- public doFinalization
- public doInitialization
- public dump
- public dumpPassStructure
- public getAdjustedAnalysisPointer
- public getAnalysis
- public getAnalysis
- public getAnalysisID
- public getAnalysisID
- public getAnalysisIfAvailable
- public getAnalysisUsage
- public getAsImmutablePass
- public getAsPMDataManager
- public getPassID
- public getPassKind
- public getPassName
- public getPotentialPassManagerType
- public getResolver
- public lookupPassInfo
- public lookupPassInfo
- public mustPreserveAnalysisID
- public preparePassManager
- public print
- public releaseMemory
- public setResolver
- public verifyAnalysis
Methods
¶llvm::SlotIndexes::MBBIndexIterator
MBBIndexBegin() const
llvm::SlotIndexes::MBBIndexIterator
MBBIndexBegin() const
Description
Returns an iterator for the begin of the idx2MBBMap.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:503
¶llvm::SlotIndexes::MBBIndexIterator MBBIndexEnd()
const
llvm::SlotIndexes::MBBIndexIterator MBBIndexEnd()
const
Description
Return an iterator for the end of the idx2MBBMap.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:508
¶SlotIndexes()
SlotIndexes()
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:349
¶llvm::SlotIndexes::MBBIndexIterator
advanceMBBIndex(
llvm::SlotIndexes::MBBIndexIterator I,
llvm::SlotIndex To) const
llvm::SlotIndexes::MBBIndexIterator
advanceMBBIndex(
llvm::SlotIndexes::MBBIndexIterator I,
llvm::SlotIndex To) const
Description
Move iterator to the next IdxMBBPair where the SlotIndex is greater or equal to \p To.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:490
Parameters
- llvm::SlotIndexes::MBBIndexIterator I
- llvm::SlotIndex To
¶llvm::IndexListEntry* createEntry(
llvm::MachineInstr* mi,
unsigned int index)
llvm::IndexListEntry* createEntry(
llvm::MachineInstr* mi,
unsigned int index)
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:333
Parameters
- llvm::MachineInstr* mi
- unsigned int index
¶void dump() const
void dump() const
Description
Dump the indexes.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:359
¶llvm::SlotIndexes::MBBIndexIterator findMBBIndex(
llvm::SlotIndex Idx) const
llvm::SlotIndexes::MBBIndexIterator findMBBIndex(
llvm::SlotIndex Idx) const
Description
Get an iterator pointing to the IdxMBBPair with the biggest SlotIndex that is greater or equal to \p Idx.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:498
Parameters
- llvm::SlotIndex Idx
¶void getAnalysisUsage(
llvm::AnalysisUsage& au) const
void getAnalysisUsage(
llvm::AnalysisUsage& au) const
Description
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:353
Parameters
¶llvm::SlotIndex getIndexAfter(
const llvm::MachineInstr& MI) const
llvm::SlotIndex getIndexAfter(
const llvm::MachineInstr& MI) const
Description
getIndexAfter - Returns the index of the first indexed instruction after MI, or the end index of its basic block. MI is not required to have an index.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:438
Parameters
- const llvm::MachineInstr& MI
¶llvm::SlotIndex getIndexBefore(
const llvm::MachineInstr& MI) const
llvm::SlotIndex getIndexBefore(
const llvm::MachineInstr& MI) const
Description
getIndexBefore - Returns the index of the last indexed instruction before MI, or the start index of its basic block. MI is not required to have an index.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:421
Parameters
- const llvm::MachineInstr& MI
¶llvm::MachineInstr* getInstructionFromIndex(
llvm::SlotIndex index) const
llvm::MachineInstr* getInstructionFromIndex(
llvm::SlotIndex index) const
Description
Returns the instruction for the given index, or null if the given index has no instruction associated with it.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:402
Parameters
- llvm::SlotIndex index
¶llvm::SlotIndex getInstructionIndex(
const llvm::MachineInstr& MI,
bool IgnoreBundle = false) const
llvm::SlotIndex getInstructionIndex(
const llvm::MachineInstr& MI,
bool IgnoreBundle = false) const
Description
Returns the base index for the given instruction.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:384
Parameters
- const llvm::MachineInstr& MI
- bool IgnoreBundle = false
¶llvm::SlotIndex getLastIndex()
llvm::SlotIndex getLastIndex()
Description
Returns the base index of the last slot in this analysis.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:373
¶llvm::SlotIndex getMBBEndIdx(
const llvm::MachineBasicBlock* mbb) const
llvm::SlotIndex getMBBEndIdx(
const llvm::MachineBasicBlock* mbb) const
Description
Returns the last index in the given basic block.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:480
Parameters
- const llvm::MachineBasicBlock* mbb
¶llvm::SlotIndex getMBBEndIdx(
unsigned int Num) const
llvm::SlotIndex getMBBEndIdx(
unsigned int Num) const
Description
Returns the last index in the given basic block number.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:475
Parameters
- unsigned int Num
¶llvm::MachineBasicBlock* getMBBFromIndex(
llvm::SlotIndex index) const
llvm::MachineBasicBlock* getMBBFromIndex(
llvm::SlotIndex index) const
Description
Returns the basic block which the given index falls in.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:513
Parameters
- llvm::SlotIndex index
¶const std::pair<SlotIndex, SlotIndex>&
getMBBRange(unsigned int Num) const
const std::pair<SlotIndex, SlotIndex>&
getMBBRange(unsigned int Num) const
Description
Return the (start,end) range of the given basic block number.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:454
Parameters
- unsigned int Num
¶const std::pair<SlotIndex, SlotIndex>&
getMBBRange(
const llvm::MachineBasicBlock* MBB) const
const std::pair<SlotIndex, SlotIndex>&
getMBBRange(
const llvm::MachineBasicBlock* MBB) const
Description
Return the (start,end) range of the given basic block.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:460
Parameters
- const llvm::MachineBasicBlock* MBB
¶llvm::SlotIndex getMBBStartIdx(
unsigned int Num) const
llvm::SlotIndex getMBBStartIdx(
unsigned int Num) const
Description
Returns the first index in the given basic block number.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:465
Parameters
- unsigned int Num
¶llvm::SlotIndex getMBBStartIdx(
const llvm::MachineBasicBlock* mbb) const
llvm::SlotIndex getMBBStartIdx(
const llvm::MachineBasicBlock* mbb) const
Description
Returns the first index in the given basic block.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:470
Parameters
- const llvm::MachineBasicBlock* mbb
¶llvm::SlotIndex getNextNonNullIndex(
llvm::SlotIndex Index)
llvm::SlotIndex getNextNonNullIndex(
llvm::SlotIndex Index)
Description
Returns the next non-null index, if one exists. Otherwise returns getLastIndex().
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:408
Parameters
- llvm::SlotIndex Index
¶llvm::SlotIndex getZeroIndex()
llvm::SlotIndex getZeroIndex()
Description
Returns the zero index for this analysis.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:367
¶bool hasIndex(
const llvm::MachineInstr& instr) const
bool hasIndex(
const llvm::MachineInstr& instr) const
Description
Returns true if the given machine instr is mapped to an index, otherwise returns false.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:379
Parameters
- const llvm::MachineInstr& instr
¶void insertMBBInMaps(llvm::MachineBasicBlock* mbb)
void insertMBBInMaps(llvm::MachineBasicBlock* mbb)
Description
Add the given MachineBasicBlock into the maps. If it contains any instructions then they must already be in the maps. This is used after a block has been split by moving some suffix of its instructions into a newly created block.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:609
Parameters
¶llvm::SlotIndex insertMachineInstrInMaps(
llvm::MachineInstr& MI,
bool Late = false)
llvm::SlotIndex insertMachineInstrInMaps(
llvm::MachineInstr& MI,
bool Late = false)
Description
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.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:534
Parameters
- llvm::MachineInstr& MI
- bool Late = false
¶void releaseMemory()
void releaseMemory()
Description
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused. Optionally implement this function to release pass memory when it is no longer used.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:354
¶void removeMachineInstrFromMaps(
llvm::MachineInstr& MI,
bool AllowBundled = false)
void removeMachineInstrFromMaps(
llvm::MachineInstr& MI,
bool AllowBundled = false)
Description
Removes machine instruction (bundle) \p MI from the mapping. This should be called before MachineInstr::eraseFromParent() is used to remove a whole bundle or an unbundled instruction. If \p AllowBundled is set then this can be used on a bundled instruction; however, this exists to support handleMoveIntoBundle, and in general removeSingleMachineInstrFromMaps should be used instead.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:580
Parameters
- llvm::MachineInstr& MI
- bool AllowBundled = false
¶void removeSingleMachineInstrFromMaps(
llvm::MachineInstr& MI)
void removeSingleMachineInstrFromMaps(
llvm::MachineInstr& MI)
Description
Removes a single machine instruction \p MI from the mapping. This should be called before MachineInstr::eraseFromBundle() is used to remove a single instruction (out of a bundle).
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:586
Parameters
¶void renumberIndexes(IndexList::iterator curItr)
void renumberIndexes(IndexList::iterator curItr)
Description
Renumber locally after inserting curItr.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:344
Parameters
- IndexList::iterator curItr
¶void repairIndexesInRange(
llvm::MachineBasicBlock* MBB,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End)
void repairIndexesInRange(
llvm::MachineBasicBlock* MBB,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End)
Description
Repair indexes after adding and removing instructions.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:362
Parameters
¶llvm::SlotIndex replaceMachineInstrInMaps(
llvm::MachineInstr& MI,
llvm::MachineInstr& NewMI)
llvm::SlotIndex replaceMachineInstrInMaps(
llvm::MachineInstr& MI,
llvm::MachineInstr& NewMI)
Description
ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in maps used by register allocator.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:591
Parameters
- llvm::MachineInstr& MI
- llvm::MachineInstr& NewMI
Returns
the index where the new instruction was inserted.
¶bool runOnMachineFunction(
llvm::MachineFunction& fn)
bool runOnMachineFunction(
llvm::MachineFunction& fn)
Description
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:356
Parameters
¶~SlotIndexes()
~SlotIndexes()
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:351