14#ifndef LLVM_MCA_INCREMENTALSOURCEMGR_H
15#define LLVM_MCA_INCREMENTALSOURCEMGR_H
32 std::deque<UniqueInst> InstStorage;
36 std::deque<Instruction *> Staging;
39 unsigned TotalCounter = 0U;
45 using InstFreedCallback = std::function<void(
Instruction *)>;
46 InstFreedCallback InstFreedCB;
66 bool hasNext()
const override {
return !Staging.empty(); }
67 bool isEnd()
const override {
return EOS; }
71 return SourceRef(TotalCounter, *Staging.front());
76 InstStorage.emplace_back(std::move(Inst));
77 Staging.push_back(InstStorage.back().get());
83 void updateNext()
override;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains abstract class SourceMgr and the default implementation, CircularSourceMgr.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void setOnInstFreedCallback(InstFreedCallback CB)
Set a callback that is invoked when a mca::Instruction is no longer needed.
void addRecycledInst(Instruction *Inst)
Add a recycled instruction.
bool isEnd() const override
Whether the instruction stream has eneded.
void addInst(UniqueInst &&Inst)
Add a new instruction.
ArrayRef< UniqueInst > getInstructions() const override
Provides a fixed range of UniqueInst to iterate.
SourceRef peekNext() const override
The next SourceRef.
bool hasNext() const override
Whether there is any SourceRef to inspect / peek next.
void endOfStream()
Mark the end of instruction stream.
IncrementalSourceMgr & operator=(const IncrementalSourceMgr &)=delete
IncrementalSourceMgr()=default
IncrementalSourceMgr(const IncrementalSourceMgr &)=delete
An instruction propagated through the simulated instruction pipeline.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::pair< unsigned, const Instruction & > SourceRef
This is an optimization pass for GlobalISel generic memory operations.
Abstracting the input code sequence (a sequence of MCInst) and assigning unique identifiers to every ...
std::unique_ptr< Instruction > UniqueInst