[InstCombine] Signed saturation patterns
[llvm-complete.git] / include / llvm / MCA / Stages / InstructionTables.h
blob4b463c9b51c15230f9f4b3193b2ce7c3910ec1c9
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 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_MCA_INSTRUCTIONTABLES_H
17 #define LLVM_MCA_INSTRUCTIONTABLES_H
19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/MC/MCSchedule.h"
21 #include "llvm/MCA/HardwareUnits/Scheduler.h"
22 #include "llvm/MCA/Stages/Stage.h"
23 #include "llvm/MCA/Support.h"
25 namespace llvm {
26 namespace mca {
28 class InstructionTables final : public Stage {
29 const MCSchedModel &SM;
30 SmallVector<std::pair<ResourceRef, ResourceCycles>, 4> UsedResources;
31 SmallVector<uint64_t, 8> Masks;
33 public:
34 InstructionTables(const MCSchedModel &Model)
35 : Stage(), SM(Model), Masks(Model.getNumProcResourceKinds()) {
36 computeProcResourceMasks(Model, Masks);
39 bool hasWorkToComplete() const override { return false; }
40 Error execute(InstRef &IR) override;
42 } // namespace mca
43 } // namespace llvm
45 #endif // LLVM_MCA_INSTRUCTIONTABLES_H