llvm/tools/llvm-mca/FetchStage.h
Andrea Di Biagio fad0c9b3b0 [llvm-mca] Move definitions in FetchStage.cpp inside namespace mca. NFC
Also, get rid of a redundant include in FetchStage.h and FetchStage.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332468 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16 13:38:17 +00:00

45 lines
1.3 KiB
C++

//===---------------------- FetchStage.h ------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
/// \file
///
/// This file defines the Fetch stage of an instruction pipeline. Its sole
/// purpose in life is to produce instructions for the rest of the pipeline.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H
#define LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H
#include "InstrBuilder.h"
#include "SourceMgr.h"
#include "Stage.h"
#include <map>
namespace mca {
class FetchStage : public Stage {
using InstMap = std::map<unsigned, std::unique_ptr<Instruction>>;
InstMap Instructions;
InstrBuilder &IB;
SourceMgr &SM;
public:
FetchStage(InstrBuilder &IB, SourceMgr &SM) : IB(IB), SM(SM) {}
FetchStage(const FetchStage &Other) = delete;
FetchStage &operator=(const FetchStage &Other) = delete;
bool isReady() const override final;
bool execute(InstRef &IR) override final;
void postExecute(const InstRef &IR) override final;
};
} // namespace mca
#endif // LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H