Go to the documentation of this file.
22 return static_cast<bool>(CurrentInstruction);
26 if (CurrentInstruction)
31 void EntryStage::getNextInstruction() {
32 assert(!CurrentInstruction &&
"There is already an instruction to process!");
36 std::unique_ptr<Instruction> Inst = std::make_unique<Instruction>(SR.second);
37 CurrentInstruction =
InstRef(SR.first, Inst.get());
38 Instructions.emplace_back(
std::move(Inst));
43 assert(CurrentInstruction &&
"There is no instruction to process!");
54 if (!CurrentInstruction)
61 auto Range =
make_range(&Instructions[NumRetired], Instructions.end());
62 auto It =
find_if(Range, [](
const std::unique_ptr<Instruction> &
I) {
63 return !
I->isRetired();
66 NumRetired = std::distance(Instructions.begin(), It);
68 if ((NumRetired * 2) >= Instructions.size()) {
69 Instructions.erase(Instructions.begin(), It);
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Error cycleStart() override
Called once at the start of each cycle.
bool isAvailable(const InstRef &IR) const override
Returns true if it can execute IR during this cycle.
Error cycleEnd() override
Called once at the end of each cycle.
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
SourceRef peekNext() const
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
Subclass of Error for the sole purpose of identifying the success path in the type system.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
An InstRef contains both a SourceMgr index and Instruction pair.
bool checkNextStage(const InstRef &IR) const
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
Lightweight error class with error context and mandatory checking.
std::pair< unsigned, const Instruction & > SourceRef
void invalidate()
Invalidate this reference.
Error moveToTheNextStage(InstRef &IR)
Called when an instruction is ready to move the next pipeline stage.
Error execute(InstRef &IR) override
The primary action that this stage performs on instruction IR.