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:314
Inherits from: MachineFunctionPass
Member Variables
- 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
- 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) const
- public llvm::SlotIndex getLastIndex()
- public llvm::SlotIndex getMBBEndIdx(unsigned int Num) const
- public llvm::SlotIndex getMBBEndIdx(const llvm::MachineBasicBlock * mbb) 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)
- public void removeSingleMachineInstrFromMaps(llvm::MachineInstr & MI)
- 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:502
¶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:507
¶SlotIndexes()
SlotIndexes()
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:350
¶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:489
Parameters
- llvm::SlotIndexes::MBBIndexIterator I
- llvm::SlotIndex To
¶void dump() const
void dump() const
Description
Dump the indexes.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:360
¶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:497
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:354
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:437
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:420
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:401
Parameters
- llvm::SlotIndex index
¶llvm::SlotIndex getInstructionIndex(
const llvm::MachineInstr& MI) const
llvm::SlotIndex getInstructionIndex(
const llvm::MachineInstr& MI) const
Description
Returns the base index for the given instruction.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:385
Parameters
- const llvm::MachineInstr& MI
¶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:374
¶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:474
Parameters
- unsigned int Num
¶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:479
Parameters
- const llvm::MachineBasicBlock* mbb
¶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:512
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:453
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:459
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:464
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:469
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:407
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:368
¶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:380
Parameters
- const llvm::MachineInstr& instr
¶void insertMBBInMaps(llvm::MachineBasicBlock* mbb)
void insertMBBInMaps(llvm::MachineBasicBlock* mbb)
Description
Add the given MachineBasicBlock into the maps.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:601
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:533
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:355
¶void removeMachineInstrFromMaps(
llvm::MachineInstr& MI)
void removeMachineInstrFromMaps(
llvm::MachineInstr& MI)
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.
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:576
Parameters
¶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:581
Parameters
¶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:363
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:586
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:357
Parameters
¶~SlotIndexes()
~SlotIndexes()
Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:352