LLVM 22.0.0git
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_STAGES_INSTRUCTIONTABLES_H
17#define LLVM_MCA_STAGES_INSTRUCTIONTABLES_H
18
20#include "llvm/MC/MCSchedule.h"
23#include "llvm/MCA/Support.h"
25
26namespace llvm {
27namespace mca {
28
29class LLVM_ABI InstructionTables final : public Stage {
30 const MCSchedModel &SM;
31 SmallVector<ResourceUse, 4> UsedResources;
33
34public:
36 : 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_STAGES_INSTRUCTIONTABLES_H
#define LLVM_ABI
Definition Compiler.h:213
Legalize the Machine IR a function s Machine IR
Definition Legalizer.cpp:80
A scheduler for Processor Resource Units and Processor Resource Groups.
This file defines the SmallVector class.
This file defines a stage.
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An InstRef contains both a SourceMgr index and Instruction pair.
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
InstructionTables(const MCSchedModel &Model)
Helper functions used by various pipeline components.
LLVM_ABI void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)
Populates vector Masks with processor resource masks.
Definition Support.cpp:40
This is an optimization pass for GlobalISel generic memory operations.
Machine model for scheduling, bundling, and heuristics.
Definition MCSchedule.h:258