LLVM  16.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]
Collaboration diagram for llvm::mca::IncrementalSourceMgr:
Collaboration graph
[legend]

Public Member Functions

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

Definition at line 48 of file IncrementalSourceMgr.h.

Member Function Documentation

◆ addInst()

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

Add a new instruction.

Definition at line 70 of file IncrementalSourceMgr.h.

References move.

◆ 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 double, and 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 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: