Go to the documentation of this file.
14 #ifndef LLVM_MCA_INCREMENTALSOURCEMGR_H
15 #define LLVM_MCA_INCREMENTALSOURCEMGR_H
31 std::deque<UniqueInst> InstStorage;
35 std::deque<Instruction *> Staging;
38 unsigned TotalCounter;
61 bool hasNext()
const override {
return !Staging.empty(); }
62 bool isEnd()
const override {
return EOS; }
66 return SourceRef(TotalCounter, *Staging.front());
71 InstStorage.emplace_back(
std::move(Inst));
72 Staging.push_back(InstStorage.back().get());
92 #endif // LLVM_MCA_INCREMENTALSOURCEMGR_H
void setOnInstFreedCallback(InstFreedCallback CB)
Set a callback that is invoked when a mca::Instruction is no longer needed.
This is an optimization pass for GlobalISel generic memory operations.
void addInst(UniqueInst &&Inst)
Add a new instruction.
void addRecycledInst(Instruction *Inst)
Add a recycled instruction.
void updateNext() override
Advance to the next SourceRef.
Abstracting the input code sequence (a sequence of MCInst) and assigning unique identifiers to every ...
bool isEnd() const override
Whether the instruction stream has eneded.
SourceRef peekNext() const override
The next SourceRef.
An instruction propagated through the simulated instruction pipeline.
This class implements an extremely fast bulk output stream that can only output to a stream.
void endOfStream()
Mark the end of instruction stream.
bool hasNext() const override
Whether there is any SourceRef to inspect / peek next.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
An implementation of SourceMgr that allows users to add new instructions incrementally / dynamically.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void printStatistic(raw_ostream &OS)
Print statistic about instruction recycling stats.
std::unique_ptr< Instruction > UniqueInst
std::pair< unsigned, const Instruction & > SourceRef
ArrayRef< UniqueInst > getInstructions() const override
Provides a fixed range of UniqueInst to iterate.