LLVM 22.0.0git
llvm::mca::IncrementalSourceMgr Class Reference

An implementation of SourceMgr that allows users to add new instructions incrementally / dynamically. More...

#include "llvm/MCA/IncrementalSourceMgr.h"

Inheritance diagram for llvm::mca::IncrementalSourceMgr:
[legend]

Public Member Functions

 IncrementalSourceMgr ()=default
IncrementalSourceMgroperator= (const IncrementalSourceMgr &)=delete
 IncrementalSourceMgr (const IncrementalSourceMgr &)=delete
void clear ()
void setOnInstFreedCallback (InstFreedCallback CB)
 Set a callback that is invoked when a mca::Instruction is no longer needed.
ArrayRef< UniqueInstgetInstructions () const override
 Provides a fixed range of UniqueInst to iterate.
bool hasNext () const override
 Whether there is any SourceRef to inspect / peek next.
bool isEnd () const override
 Whether the instruction stream has eneded.
SourceRef peekNext () const override
 The next SourceRef.
void addInst (UniqueInst &&Inst)
 Add a new instruction.
void addRecycledInst (Instruction *Inst)
 Add a recycled instruction.
void updateNext () override
 Advance to the next SourceRef.
void endOfStream ()
 Mark the end of instruction stream.
void printStatistic (raw_ostream &OS)
 Print statistic about instruction recycling stats.
Public Member Functions inherited from llvm::mca::SourceMgr
virtual size_t size () const
 (Fixed) Number of UniqueInst.
virtual ~SourceMgr ()

Additional Inherited Members

Public Types inherited from llvm::mca::SourceMgr
using UniqueInst = std::unique_ptr<Instruction>

Detailed Description

An implementation of SourceMgr that allows users to add new instructions incrementally / dynamically.

Note that this SourceMgr takes ownership of all mca::Instruction.

Definition at line 27 of file IncrementalSourceMgr.h.

Constructor & Destructor Documentation

◆ IncrementalSourceMgr() [1/2]

llvm::mca::IncrementalSourceMgr::IncrementalSourceMgr ( )
default

Referenced by IncrementalSourceMgr(), and operator=().

◆ IncrementalSourceMgr() [2/2]

llvm::mca::IncrementalSourceMgr::IncrementalSourceMgr ( const IncrementalSourceMgr & )
delete

References clear(), and IncrementalSourceMgr().

Member Function Documentation

◆ addInst()

void llvm::mca::IncrementalSourceMgr::addInst ( UniqueInst && Inst)
inline

Add a new instruction.

Definition at line 75 of file IncrementalSourceMgr.h.

◆ addRecycledInst()

void llvm::mca::IncrementalSourceMgr::addRecycledInst ( Instruction * Inst)
inline

Add a recycled instruction.

Definition at line 81 of file IncrementalSourceMgr.h.

◆ clear()

void IncrementalSourceMgr::clear ( )

Definition at line 22 of file IncrementalSourceMgr.cpp.

Referenced by IncrementalSourceMgr().

◆ endOfStream()

void llvm::mca::IncrementalSourceMgr::endOfStream ( )
inline

Mark the end of instruction stream.

Definition at line 86 of file IncrementalSourceMgr.h.

◆ getInstructions()

ArrayRef< UniqueInst > llvm::mca::IncrementalSourceMgr::getInstructions ( ) const
inlineoverridevirtual

Provides a fixed range of UniqueInst to iterate.

Implements llvm::mca::SourceMgr.

Definition at line 62 of file IncrementalSourceMgr.h.

References llvm_unreachable.

◆ hasNext()

bool llvm::mca::IncrementalSourceMgr::hasNext ( ) const
inlineoverridevirtual

Whether there is any SourceRef to inspect / peek next.

Note that returning false from this doesn't mean the instruction stream has ended.

Implements llvm::mca::SourceMgr.

Definition at line 66 of file IncrementalSourceMgr.h.

Referenced by peekNext().

◆ isEnd()

bool llvm::mca::IncrementalSourceMgr::isEnd ( ) const
inlineoverridevirtual

Whether the instruction stream has eneded.

Implements llvm::mca::SourceMgr.

Definition at line 67 of file IncrementalSourceMgr.h.

◆ operator=()

IncrementalSourceMgr & llvm::mca::IncrementalSourceMgr::operator= ( const IncrementalSourceMgr & )
delete

◆ peekNext()

SourceRef llvm::mca::IncrementalSourceMgr::peekNext ( ) const
inlineoverridevirtual

The next SourceRef.

Implements llvm::mca::SourceMgr.

Definition at line 69 of file IncrementalSourceMgr.h.

References assert(), and hasNext().

◆ printStatistic()

void IncrementalSourceMgr::printStatistic ( raw_ostream & OS)

Print statistic about instruction recycling stats.

Definition at line 40 of file IncrementalSourceMgr.cpp.

References llvm::format().

◆ setOnInstFreedCallback()

void llvm::mca::IncrementalSourceMgr::setOnInstFreedCallback ( InstFreedCallback CB)
inline

Set a callback that is invoked when a mca::Instruction is no longer needed.

This is usually used for recycling the instruction.

Definition at line 60 of file IncrementalSourceMgr.h.

◆ updateNext()

void IncrementalSourceMgr::updateNext ( )
overridevirtual

Advance to the next SourceRef.

Implements llvm::mca::SourceMgr.

Definition at line 29 of file IncrementalSourceMgr.cpp.

References I.


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