diff options
Diffstat (limited to 'llvm/tools/llvm-mca/InstructionTables.h')
-rw-r--r-- | llvm/tools/llvm-mca/InstructionTables.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/llvm/tools/llvm-mca/InstructionTables.h b/llvm/tools/llvm-mca/InstructionTables.h index 200083d3715..18e01998843 100644 --- a/llvm/tools/llvm-mca/InstructionTables.h +++ b/llvm/tools/llvm-mca/InstructionTables.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// \file /// -/// This file implements a custom driver to generate instruction tables. +/// This file implements a custom stage to generate instruction tables. /// See the description of command-line flag -instruction-tables in /// docs/CommandGuide/lvm-mca.rst /// @@ -17,32 +17,26 @@ #ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H #define LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H -#include "View.h" #include "InstrBuilder.h" -#include "SourceMgr.h" +#include "Scheduler.h" +#include "Stage.h" +#include "View.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" namespace mca { -class InstructionTables { +class InstructionTables : public Stage { const llvm::MCSchedModel &SM; InstrBuilder &IB; - SourceMgr &S; - llvm::SmallVector<std::unique_ptr<View>, 8> Views; + llvm::SmallVector<std::pair<ResourceRef, double>, 4> UsedResources; public: - InstructionTables(const llvm::MCSchedModel &Model, InstrBuilder &Builder, - SourceMgr &Source) - : SM(Model), IB(Builder), S(Source) {} - - void addView(std::unique_ptr<View> V) { - Views.emplace_back(std::move(V)); - } + InstructionTables(const llvm::MCSchedModel &Model, InstrBuilder &Builder) + : Stage(), SM(Model), IB(Builder) {} - void run(); - - void printReport(llvm::raw_ostream &OS) const; + bool hasWorkToComplete() const override final { return false; } + bool execute(InstRef &IR) override final; }; } // namespace mca |