1 //===--------------------- InstructionTables.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 implements a custom stage to generate instruction tables.
12 /// See the description of command-line flag -instruction-tables in
13 /// docs/CommandGuide/lvm-mca.rst
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H
18 #define LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H
20 #include "InstrBuilder.h"
21 #include "Scheduler.h"
24 #include "llvm/ADT/SmallVector.h"
25 #include "llvm/MC/MCSchedule.h"
29 class InstructionTables : public Stage {
30 const llvm::MCSchedModel &SM;
32 llvm::SmallVector<std::pair<ResourceRef, double>, 4> UsedResources;
35 InstructionTables(const llvm::MCSchedModel &Model, InstrBuilder &Builder)
36 : Stage(), SM(Model), IB(Builder) {}
38 bool hasWorkToComplete() const override final { return false; }
39 bool execute(InstRef &IR) override final;