Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:16

0001 //===--------------------- InstructionTables.h ------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 ///
0010 /// This file implements a custom stage to generate instruction tables.
0011 /// See the description of command-line flag -instruction-tables in
0012 /// docs/CommandGuide/lvm-mca.rst
0013 ///
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_MCA_STAGES_INSTRUCTIONTABLES_H
0017 #define LLVM_MCA_STAGES_INSTRUCTIONTABLES_H
0018 
0019 #include "llvm/ADT/SmallVector.h"
0020 #include "llvm/MC/MCSchedule.h"
0021 #include "llvm/MCA/HardwareUnits/Scheduler.h"
0022 #include "llvm/MCA/Stages/Stage.h"
0023 #include "llvm/MCA/Support.h"
0024 
0025 namespace llvm {
0026 namespace mca {
0027 
0028 class InstructionTables final : public Stage {
0029   const MCSchedModel &SM;
0030   SmallVector<ResourceUse, 4> UsedResources;
0031   SmallVector<uint64_t, 8> Masks;
0032 
0033 public:
0034   InstructionTables(const MCSchedModel &Model)
0035       : SM(Model), Masks(Model.getNumProcResourceKinds()) {
0036     computeProcResourceMasks(Model, Masks);
0037   }
0038 
0039   bool hasWorkToComplete() const override { return false; }
0040   Error execute(InstRef &IR) override;
0041 };
0042 } // namespace mca
0043 } // namespace llvm
0044 
0045 #endif // LLVM_MCA_STAGES_INSTRUCTIONTABLES_H