LLVM 19.0.0git
Public Member Functions | Protected Attributes | List of all members
llvm::mca::InstrumentManager Class Reference

This class allows targets to optionally customize the logic that resolves scheduling class IDs. More...

#include "llvm/MCA/CustomBehaviour.h"

Inheritance diagram for llvm::mca::InstrumentManager:
Inheritance graph
[legend]

Public Member Functions

 InstrumentManager (const MCSubtargetInfo &STI, const MCInstrInfo &MCII)
 
virtual ~InstrumentManager ()=default
 
virtual bool shouldIgnoreInstruments () const
 Returns true if llvm-mca should ignore instruments.
 
virtual bool supportsInstrumentType (StringRef Type) const
 
virtual UniqueInstrument createInstrument (StringRef Desc, StringRef Data)
 Allocate an Instrument, and return a unique pointer to it.
 
virtual SmallVector< UniqueInstrumentcreateInstruments (const MCInst &Inst)
 Return a list of unique pointers to Instruments, where each Instrument is allocated by this function.
 
virtual unsigned getSchedClassID (const MCInstrInfo &MCII, const MCInst &MCI, const SmallVector< Instrument * > &IVec) const
 Given an MCInst and a vector of Instrument, a target can return a SchedClassID.
 

Protected Attributes

const MCSubtargetInfoSTI
 
const MCInstrInfoMCII
 

Detailed Description

This class allows targets to optionally customize the logic that resolves scheduling class IDs.

Targets can use information encoded in Instrument objects to make more informed scheduling decisions.

Definition at line 141 of file CustomBehaviour.h.

Constructor & Destructor Documentation

◆ InstrumentManager()

llvm::mca::InstrumentManager::InstrumentManager ( const MCSubtargetInfo STI,
const MCInstrInfo MCII 
)
inline

Definition at line 147 of file CustomBehaviour.h.

◆ ~InstrumentManager()

virtual llvm::mca::InstrumentManager::~InstrumentManager ( )
virtualdefault

Member Function Documentation

◆ createInstrument()

UniqueInstrument llvm::mca::InstrumentManager::createInstrument ( llvm::StringRef  Desc,
llvm::StringRef  Data 
)
virtual

Allocate an Instrument, and return a unique pointer to it.

This function may be useful to create instruments coming from comments in the assembly. See createInstruments to create Instruments from MCInst

Reimplemented in llvm::mca::RISCVInstrumentManager.

Definition at line 45 of file CustomBehaviour.cpp.

References llvm::Data.

◆ createInstruments()

SmallVector< UniqueInstrument > llvm::mca::InstrumentManager::createInstruments ( const MCInst Inst)
virtual

Return a list of unique pointers to Instruments, where each Instrument is allocated by this function.

See createInstrument to create Instrument from a description and data.

Reimplemented in llvm::mca::RISCVInstrumentManager.

Definition at line 51 of file CustomBehaviour.cpp.

◆ getSchedClassID()

unsigned llvm::mca::InstrumentManager::getSchedClassID ( const MCInstrInfo MCII,
const MCInst MCI,
const SmallVector< Instrument * > &  IVec 
) const
virtual

Given an MCInst and a vector of Instrument, a target can return a SchedClassID.

This can be used by a subtarget to return a PseudoInstruction SchedClassID instead of the one that belongs to the BaseInstruction This can be useful when a BaseInstruction does not convey the correct scheduling information without additional data. By default, it returns the SchedClassID that belongs to MCI.

Reimplemented in llvm::mca::RISCVInstrumentManager.

Definition at line 55 of file CustomBehaviour.cpp.

References llvm::MCInstrInfo::get(), llvm::MCInst::getOpcode(), llvm::MCInstrDesc::getSchedClass(), and MCII.

◆ shouldIgnoreInstruments()

virtual bool llvm::mca::InstrumentManager::shouldIgnoreInstruments ( ) const
inlinevirtual

Returns true if llvm-mca should ignore instruments.

Reimplemented in llvm::mca::RISCVInstrumentManager.

Definition at line 153 of file CustomBehaviour.h.

◆ supportsInstrumentType()

virtual bool llvm::mca::InstrumentManager::supportsInstrumentType ( StringRef  Type) const
inlinevirtual

Reimplemented in llvm::mca::RISCVInstrumentManager.

Definition at line 157 of file CustomBehaviour.h.

Member Data Documentation

◆ MCII

const MCInstrInfo& llvm::mca::InstrumentManager::MCII
protected

◆ STI

const MCSubtargetInfo& llvm::mca::InstrumentManager::STI
protected

Definition at line 143 of file CustomBehaviour.h.


The documentation for this class was generated from the following files: