LLVM 20.0.0git
EntryStage.h
Go to the documentation of this file.
1//===---------------------- EntryStage.h ------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9///
10/// This file defines the Entry stage of an instruction pipeline. Its sole
11/// purpose in life is to pick instructions in sequence and move them to the
12/// next pipeline stage.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_MCA_STAGES_ENTRYSTAGE_H
17#define LLVM_MCA_STAGES_ENTRYSTAGE_H
18
20#include "llvm/MCA/SourceMgr.h"
22
23namespace llvm {
24namespace mca {
25
26class EntryStage final : public Stage {
27 InstRef CurrentInstruction;
29 SourceMgr &SM;
30 unsigned NumRetired;
31
32 // Updates the program counter, and sets 'CurrentInstruction'.
33 Error getNextInstruction();
34
35 EntryStage(const EntryStage &Other) = delete;
36 EntryStage &operator=(const EntryStage &Other) = delete;
37
38public:
39 EntryStage(SourceMgr &SM) : SM(SM), NumRetired(0) {}
40
41 bool isAvailable(const InstRef &IR) const override;
42 bool hasWorkToComplete() const override;
43 Error execute(InstRef &IR) override;
44 Error cycleStart() override;
45 Error cycleResume() override;
46 Error cycleEnd() override;
47};
48
49} // namespace mca
50} // namespace llvm
51
52#endif // LLVM_MCA_STAGES_ENTRYSTAGE_H
Legalize the Machine IR a function s Machine IR
Definition: Legalizer.cpp:80
This file contains abstract class SourceMgr and the default implementation, CircularSourceMgr.
This file defines the SmallVector class.
This file defines a stage.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1196
Error cycleStart() override
Called once at the start of each cycle.
Definition: EntryStage.cpp:57
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
Definition: EntryStage.cpp:21
Error cycleEnd() override
Called once at the end of each cycle.
Definition: EntryStage.cpp:68
bool isAvailable(const InstRef &IR) const override
Returns true if it can execute IR during this cycle.
Definition: EntryStage.cpp:25
Error execute(InstRef &IR) override
The primary action that this stage performs on instruction IR.
Definition: EntryStage.cpp:47
Error cycleResume() override
Called after the pipeline is resumed from pausing state.
Definition: EntryStage.cpp:63
EntryStage(SourceMgr &SM)
Definition: EntryStage.h:39
An InstRef contains both a SourceMgr index and Instruction pair.
Definition: Instruction.h:720
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Other
Any other memory.
Abstracting the input code sequence (a sequence of MCInst) and assigning unique identifiers to every ...
Definition: SourceMgr.h:29