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

Inherited from SourceMgr:

Methods

IncrementalSourceMgr()

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:48

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)

Description

Add a recycled instruction.

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:76

Parameters

llvm::mca::Instruction* Inst

void clear()

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:50

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

Description

Provides a fixed range of \a UniqueInst to iterate.

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:57

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

Description

Whether the instruction stream has eneded.

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:62

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)

Description

Print statistic about instruction recycling stats.

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:85

Parameters

llvm::raw_ostream& OS

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()

Description

Advance to the next \a SourceRef.

Declared at: llvm/include/llvm/MCA/IncrementalSourceMgr.h:78