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

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

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

Description

Return an iterator for the end of the idx2MBBMap.

Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:507

SlotIndexes()

Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:350

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

Description

Dump the indexes.

Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:360

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

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::AnalysisUsage& au

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

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

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

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()

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

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

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

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

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

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

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

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)

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()

Description

Returns the zero index for this analysis.

Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:368

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)

Description

Add the given MachineBasicBlock into the maps.

Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:601

Parameters

llvm::MachineBasicBlock* mbb

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()

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)

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

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

llvm::MachineInstr& MI

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::MachineBasicBlock* MBB
MachineBasicBlock::iterator Begin
MachineBasicBlock::iterator End

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)

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

llvm::MachineFunction& fn

~SlotIndexes()

Declared at: llvm/include/llvm/CodeGen/SlotIndexes.h:352