14#ifndef LLVM_MCA_SOURCEMGR_H
15#define LLVM_MCA_SOURCEMGR_H
25typedef std::pair<unsigned, const Instruction &>
SourceRef;
62 const unsigned Iterations;
63 static const unsigned DefaultIterations = 100;
67 : Sequence(S), Current(0U), Iterations(Iter ? Iter : DefaultIterations) {}
73 return Current < (Iterations * Sequence.size());
79 return SourceRef(Current, *Sequence[Current % Sequence.size()]);
This file defines abstractions used by the Pipeline to model register reads, register writes and inst...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
The default implementation of SourceMgr.
void updateNext() override
Advance to the next SourceRef.
SourceRef peekNext() const override
The next SourceRef.
CircularSourceMgr(ArrayRef< UniqueInst > S, unsigned Iter)
bool hasNext() const override
Whether there is any SourceRef to inspect / peek next.
ArrayRef< UniqueInst > getInstructions() const override
Provides a fixed range of UniqueInst to iterate.
bool isEnd() const override
Whether the instruction stream has eneded.
unsigned getNumIterations() const
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 ...
virtual void updateNext()=0
Advance to the next SourceRef.
virtual size_t size() const
(Fixed) Number of UniqueInst.
virtual ArrayRef< UniqueInst > getInstructions() const =0
Provides a fixed range of UniqueInst to iterate.
virtual bool isEnd() const =0
Whether the instruction stream has eneded.
std::unique_ptr< Instruction > UniqueInst
virtual SourceRef peekNext() const =0
The next SourceRef.
virtual bool hasNext() const =0
Whether there is any SourceRef to inspect / peek next.