LLVM 20.0.0git
Public Member Functions | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

 IncrementalSourceMgr ()=default
 
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 ArrayRef< UniqueInstgetInstructions () const =0
 Provides a fixed range of UniqueInst to iterate.
 
virtual size_t size () const
 (Fixed) Number of UniqueInst.
 
virtual bool hasNext () const =0
 Whether there is any SourceRef to inspect / peek next.
 
virtual bool isEnd () const =0
 Whether the instruction stream has eneded.
 
virtual SourceRef peekNext () const =0
 The next SourceRef.
 
virtual void updateNext ()=0
 Advance to the next SourceRef.
 
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 26 of file IncrementalSourceMgr.h.

Constructor & Destructor Documentation

◆ IncrementalSourceMgr()

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

Member Function Documentation

◆ addInst()

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

Add a new instruction.

Definition at line 70 of file IncrementalSourceMgr.h.

◆ addRecycledInst()

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

Add a recycled instruction.

Definition at line 76 of file IncrementalSourceMgr.h.

◆ clear()

void IncrementalSourceMgr::clear ( )

Definition at line 22 of file IncrementalSourceMgr.cpp.

◆ endOfStream()

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

Mark the end of instruction stream.

Definition at line 81 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 57 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 61 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 62 of file IncrementalSourceMgr.h.

◆ peekNext()

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

The next SourceRef.

Implements llvm::mca::SourceMgr.

Definition at line 64 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(), and OS.

◆ 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 55 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: