LLVM  8.0.1
RetireStage.h
Go to the documentation of this file.
1 //===---------------------- RetireStage.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 retire stage of a default instruction pipeline.
12 /// The RetireStage represents the process logic that interacts with the
13 /// simulated RetireControlUnit hardware.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_MCA_RETIRE_STAGE_H
18 #define LLVM_MCA_RETIRE_STAGE_H
19 
22 #include "llvm/MCA/Stages/Stage.h"
23 
24 namespace llvm {
25 namespace mca {
26 
27 class RetireStage final : public Stage {
28  // Owner will go away when we move listeners/eventing to the stages.
29  RetireControlUnit &RCU;
30  RegisterFile &PRF;
31 
32  RetireStage(const RetireStage &Other) = delete;
33  RetireStage &operator=(const RetireStage &Other) = delete;
34 
35 public:
37  : Stage(), RCU(R), PRF(F) {}
38 
39  bool hasWorkToComplete() const override { return !RCU.isEmpty(); }
40  Error cycleStart() override;
41  Error execute(InstRef &IR) override;
42  void notifyInstructionRetired(const InstRef &IR) const;
43 };
44 
45 } // namespace mca
46 } // namespace llvm
47 
48 #endif // LLVM_MCA_RETIRE_STAGE_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
This file simulates the hardware responsible for retiring instructions.
void notifyInstructionRetired(const InstRef &IR) const
Definition: RetireStage.cpp:51
F(f)
An InstRef contains both a SourceMgr index and Instruction pair.
Definition: Instruction.h:478
This class tracks which instructions are in-flight (i.e., dispatched but not retired) in the OoO back...
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:784
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
Definition: RetireStage.h:39
This file defines a register mapping file class.
This file defines a stage.
Manages hardware register files, and tracks register definitions for register renaming purposes...
Definition: RegisterFile.h:36
RetireStage(RetireControlUnit &R, RegisterFile &F)
Definition: RetireStage.h:36
Error cycleStart() override
Called once at the start of each cycle.
Definition: RetireStage.cpp:26
Error execute(InstRef &IR) override
The primary action that this stage performs on instruction IR.
Definition: RetireStage.cpp:46
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
Statically lint checks LLVM IR
Definition: Lint.cpp:193