class IncrementalSourceMgr
Declaration
class IncrementalSourceMgr : public SourceMgr { /* full declaration omitted */ };
Description
An implementation of \a SourceMgr that allows users to add new instructions incrementally / dynamically. Note that this SourceMgr takes ownership of all \a mca::Instruction.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:26
Inherits from: SourceMgr
Member Variables
- private std::deque<UniqueInst> InstStorage
- Owner of all mca::Instruction instances. Note that we use std::deque here to have a better throughput, in comparison to std::vector or llvm::SmallVector, as they usually pay a higher re-allocation cost when there is a large number of instructions.
- private std::deque<Instruction*> Staging
- Instructions that are ready to be used. Each of them is a pointer of an\a UniqueInst inside InstStorage.
- private unsigned int TotalCounter
- Current instruction index.
- private bool EOS
- End-of-stream flag.
- private llvm::mca::IncrementalSourceMgr::InstFreedCallback InstFreedCB
Method Overview
- public IncrementalSourceMgr()
- public void addInst(llvm::mca::SourceMgr::UniqueInst && Inst)
- public void addRecycledInst(llvm::mca::Instruction * Inst)
- public void clear()
- public void endOfStream()
- public ArrayRef<llvm::mca::SourceMgr::UniqueInst> getInstructions() const
- public bool hasNext() const
- public bool isEnd() const
- public llvm::mca::SourceRef peekNext() const
- public void printStatistic(llvm::raw_ostream & OS)
- public void setOnInstFreedCallback(llvm::mca::IncrementalSourceMgr::InstFreedCallback CB)
- public void updateNext()
Inherited from SourceMgr:
Methods
¶IncrementalSourceMgr()
IncrementalSourceMgr()
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:48
¶void addInst(
llvm::mca::SourceMgr::UniqueInst&& Inst)
void addInst(
llvm::mca::SourceMgr::UniqueInst&& Inst)
Description
Add a new instruction.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:70
Parameters
- llvm::mca::SourceMgr::UniqueInst&& Inst
¶void addRecycledInst(llvm::mca::Instruction* Inst)
void addRecycledInst(llvm::mca::Instruction* Inst)
Description
Add a recycled instruction.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:76
Parameters
- llvm::mca::Instruction* Inst
¶void clear()
void clear()
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:50
¶void endOfStream()
void endOfStream()
Description
Mark the end of instruction stream.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:81
¶ArrayRef<llvm::mca::SourceMgr::UniqueInst>
getInstructions() const
ArrayRef<llvm::mca::SourceMgr::UniqueInst>
getInstructions() const
Description
Provides a fixed range of \a UniqueInst to iterate.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:57
¶bool hasNext() const
bool hasNext() const
Description
Whether there is any \a SourceRef to inspect / peek next. Note that returning false from this doesn't mean the instruction stream has ended.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:61
¶bool isEnd() const
bool isEnd() const
Description
Whether the instruction stream has eneded.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:62
¶llvm::mca::SourceRef peekNext() const
llvm::mca::SourceRef peekNext() const
Description
The next \a SourceRef.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:64
¶void printStatistic(llvm::raw_ostream& OS)
void printStatistic(llvm::raw_ostream& OS)
Description
Print statistic about instruction recycling stats.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:85
Parameters
¶void setOnInstFreedCallback(
llvm::mca::IncrementalSourceMgr::
InstFreedCallback CB)
void setOnInstFreedCallback(
llvm::mca::IncrementalSourceMgr::
InstFreedCallback CB)
Description
Set a callback that is invoked when a mca::Instruction is no longer needed. This is usually used for recycling the instruction.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:55
Parameters
- llvm::mca::IncrementalSourceMgr::InstFreedCallback CB
¶void updateNext()
void updateNext()
Description
Advance to the next \a SourceRef.
Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:78