LLVM 23.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#include "llvm/Support/Debug.h"
26
27#define DEBUG_TYPE "llvm-mca"
28
29namespace llvm {
30namespace mca {
31
32class LLVM_ABI InstructionTables final : public Stage {
33 const MCSchedModel &SM;
34 SmallVector<ResourceUse, 4> UsedResources;
36
37public:
39 : SM(Model), Masks(Model.getNumProcResourceKinds()) {
40 computeProcResourceMasks(Model, Masks);
41 LLVM_DEBUG(dumpProcResourceMasks(Model, Masks));
42 }
43
44 bool hasWorkToComplete() const override { return false; }
45 Error execute(InstRef &IR) override;
46};
47} // namespace mca
48} // namespace llvm
49
50#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:81
A scheduler for Processor Resource Units and Processor Resource Groups.
This file defines the SmallVector class.
This file defines a stage.
#define LLVM_DEBUG(...)
Definition Debug.h:114
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 dumpProcResourceMasks(const MCSchedModel &SM, ArrayRef< uint64_t > Masks)
Definition Support.cpp:74
LLVM_ABI void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)
Populates vector Masks with processor resource masks.
Definition Support.cpp:41
This is an optimization pass for GlobalISel generic memory operations.
Machine model for scheduling, bundling, and heuristics.
Definition MCSchedule.h:258