LLVM 20.0.0git
|
An implementation of SourceMgr that allows users to add new instructions incrementally / dynamically. More...
#include "llvm/MCA/IncrementalSourceMgr.h"
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< UniqueInst > | getInstructions () 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< UniqueInst > | getInstructions () 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 > |
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.
|
default |
|
inline |
Add a new instruction.
Definition at line 70 of file IncrementalSourceMgr.h.
|
inline |
Add a recycled instruction.
Definition at line 76 of file IncrementalSourceMgr.h.
void IncrementalSourceMgr::clear | ( | ) |
Definition at line 22 of file IncrementalSourceMgr.cpp.
|
inline |
Mark the end of instruction stream.
Definition at line 81 of file IncrementalSourceMgr.h.
|
inlineoverridevirtual |
Provides a fixed range of UniqueInst to iterate.
Implements llvm::mca::SourceMgr.
Definition at line 57 of file IncrementalSourceMgr.h.
References llvm_unreachable.
|
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().
|
inlineoverridevirtual |
Whether the instruction stream has eneded.
Implements llvm::mca::SourceMgr.
Definition at line 62 of file IncrementalSourceMgr.h.
|
inlineoverridevirtual |
The next SourceRef.
Implements llvm::mca::SourceMgr.
Definition at line 64 of file IncrementalSourceMgr.h.
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.
|
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.
|
overridevirtual |
Advance to the next SourceRef.
Implements llvm::mca::SourceMgr.
Definition at line 29 of file IncrementalSourceMgr.cpp.
References I.