LLVM  8.0.1
EntryStage.h
Go to the documentation of this file.
1 //===---------------------- EntryStage.h ------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 /// \file
10 ///
11 /// This file defines the Entry stage of an instruction pipeline. Its sole
12 /// purpose in life is to pick instructions in sequence and move them to the
13 /// next pipeline stage.
14 ///
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_MCA_ENTRY_STAGE_H
18 #define LLVM_MCA_ENTRY_STAGE_H
19 
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/MCA/SourceMgr.h"
22 #include "llvm/MCA/Stages/Stage.h"
23 
24 namespace llvm {
25 namespace mca {
26 
27 class EntryStage final : public Stage {
28  InstRef CurrentInstruction;
30  SourceMgr &SM;
31  unsigned NumRetired;
32 
33  // Updates the program counter, and sets 'CurrentInstruction'.
34  void getNextInstruction();
35 
36  EntryStage(const EntryStage &Other) = delete;
37  EntryStage &operator=(const EntryStage &Other) = delete;
38 
39 public:
40  EntryStage(SourceMgr &SM) : CurrentInstruction(), SM(SM), NumRetired(0) { }
41 
42  bool isAvailable(const InstRef &IR) const override;
43  bool hasWorkToComplete() const override;
44  Error execute(InstRef &IR) override;
45  Error cycleStart() override;
46  Error cycleEnd() override;
47 };
48 
49 } // namespace mca
50 } // namespace llvm
51 
52 #endif // LLVM_MCA_FETCH_STAGE_H
EntryStage(SourceMgr &SM)
Definition: EntryStage.h:40
This class represents lattice values for constants.
Definition: AllocatorList.h:24
bool isAvailable(const InstRef &IR) const override
Returns true if it can execute IR during this cycle.
Definition: EntryStage.cpp:24
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
Definition: EntryStage.cpp:22
An InstRef contains both a SourceMgr index and Instruction pair.
Definition: Instruction.h:478
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:784
This file defines a stage.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:847
Error cycleEnd() override
Called once at the end of each cycle.
Definition: EntryStage.cpp:58
This file implements class SourceMgr.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
Error execute(InstRef &IR) override
The primary action that this stage performs on instruction IR.
Definition: EntryStage.cpp:41
Statically lint checks LLVM IR
Definition: Lint.cpp:193
Error cycleStart() override
Called once at the start of each cycle.
Definition: EntryStage.cpp:52