LLVM 22.0.0git
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:
[legend]

Public Member Functions

 InstrumentManager (const MCSubtargetInfo &STI, const MCInstrInfo &MCII, bool EnableInstruments=true)
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.
virtual bool canCustomize (const ArrayRef< Instrument * > IVec) const
virtual void customize (const ArrayRef< Instrument * > IVec, llvm::mca::InstrDesc &Desc) const

Protected Attributes

const MCSubtargetInfoSTI
const MCInstrInfoMCII
bool EnableInstruments

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 161 of file CustomBehaviour.h.

Constructor & Destructor Documentation

◆ InstrumentManager()

llvm::mca::InstrumentManager::InstrumentManager ( const MCSubtargetInfo & STI,
const MCInstrInfo & MCII,
bool EnableInstruments = true )
inline

◆ ~InstrumentManager()

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

Member Function Documentation

◆ canCustomize()

bool llvm::mca::InstrumentManager::canCustomize ( const ArrayRef< Instrument * > IVec) const
virtual

◆ createInstrument()

UniqueInstrument llvm::mca::InstrumentManager::createInstrument ( StringRef Desc,
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 78 of file CustomBehaviour.cpp.

References llvm::Data, llvm::mca::LatencyInstrument::DESC_NAME, and EnableInstruments.

◆ 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 88 of file CustomBehaviour.cpp.

References llvm::SmallVector.

◆ customize()

void llvm::mca::InstrumentManager::customize ( const ArrayRef< Instrument * > IVec,
llvm::mca::InstrDesc & Desc ) const
virtual

◆ 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 92 of file CustomBehaviour.cpp.

References llvm::MCInst::getOpcode(), 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 175 of file CustomBehaviour.h.

References EnableInstruments.

◆ supportsInstrumentType()

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

Member Data Documentation

◆ EnableInstruments

bool llvm::mca::InstrumentManager::EnableInstruments
protected

◆ MCII

◆ STI

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

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