1 //===---------------------- FetchStage.h ------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// This file defines the Fetch stage of an instruction pipeline. Its sole
12 /// purpose in life is to produce instructions for the rest of the pipeline.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H
17 #define LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H
19 #include "InstrBuilder.h"
20 #include "SourceMgr.h"
26 class FetchStage : public Stage {
27 using InstMap = std::map<unsigned, std::unique_ptr<Instruction>>;
33 FetchStage(InstrBuilder &IB, SourceMgr &SM) : IB(IB), SM(SM) {}
34 FetchStage(const FetchStage &Other) = delete;
35 FetchStage &operator=(const FetchStage &Other) = delete;
37 bool hasWorkToComplete() const override final;
38 bool execute(InstRef &IR) override final;
39 void postExecute() override final;
40 void cycleEnd() override final;
45 #endif // LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H