LLVM  8.0.1
InstructionTables.h
Go to the documentation of this file.
1 //===--------------------- InstructionTables.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 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
14 ///
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_MCA_INSTRUCTIONTABLES_H
18 #define LLVM_MCA_INSTRUCTIONTABLES_H
19 
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/MC/MCSchedule.h"
23 #include "llvm/MCA/Stages/Stage.h"
24 #include "llvm/MCA/Support.h"
25 
26 namespace llvm {
27 namespace mca {
28 
29 class InstructionTables final : public Stage {
30  const MCSchedModel &SM;
33 
34 public:
36  : Stage(), SM(Model), Masks(Model.getNumProcResourceKinds()) {
37  computeProcResourceMasks(Model, Masks);
38  }
39 
40  bool hasWorkToComplete() const override { return false; }
41  Error execute(InstRef &IR) override;
42 };
43 } // namespace mca
44 } // namespace llvm
45 
46 #endif // LLVM_MCA_INSTRUCTIONTABLES_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
An InstRef contains both a SourceMgr index and Instruction pair.
Definition: Instruction.h:478
void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)
Populates vector Masks with processor resource masks.
Definition: Support.cpp:24
This file defines a stage.
Error execute(InstRef &IR) override
The primary action that this stage performs on instruction IR.
Helper functions used by various pipeline components.
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:847
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
InstructionTables(const MCSchedModel &Model)
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
A scheduler for Processor Resource Units and Processor Resource Groups.
Machine model for scheduling, bundling, and heuristics.
Definition: MCSchedule.h:244
Statically lint checks LLVM IR
Definition: Lint.cpp:193