LLVM  10.0.0svn
InstructionTables.h
Go to the documentation of this file.
1 //===--------------------- InstructionTables.h ------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 ///
10 /// This file implements a custom stage to generate instruction tables.
11 /// See the description of command-line flag -instruction-tables in
12 /// docs/CommandGuide/lvm-mca.rst
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_MCA_INSTRUCTIONTABLES_H
17 #define LLVM_MCA_INSTRUCTIONTABLES_H
18 
19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/MC/MCSchedule.h"
22 #include "llvm/MCA/Stages/Stage.h"
23 #include "llvm/MCA/Support.h"
24 
25 namespace llvm {
26 namespace mca {
27 
28 class InstructionTables final : public Stage {
29  const MCSchedModel &SM;
32 
33 public:
35  : Stage(), SM(Model), Masks(Model.getNumProcResourceKinds()) {
36  computeProcResourceMasks(Model, Masks);
37  }
38 
39  bool hasWorkToComplete() const override { return false; }
40  Error execute(InstRef &IR) override;
41 };
42 } // namespace mca
43 } // namespace llvm
44 
45 #endif // LLVM_MCA_INSTRUCTIONTABLES_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
An InstRef contains both a SourceMgr index and Instruction pair.
Definition: Instruction.h:562
void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)
Populates vector Masks with processor resource masks.
Definition: Support.cpp:39
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:837
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:157
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:192