Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:33

0001 //=- llvm/CodeGen/MultiHazardRecognizer.h - Scheduling Support ----*- 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 //
0009 // This file implements the MultiHazardRecognizer class, which is a wrapper
0010 // for a set of ScheduleHazardRecognizer instances
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H
0015 #define LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H
0016 
0017 #include "llvm/ADT/SmallVector.h"
0018 #include "llvm/CodeGen/ScheduleHazardRecognizer.h"
0019 
0020 namespace llvm {
0021 
0022 class MachineInstr;
0023 class SUnit;
0024 
0025 class MultiHazardRecognizer : public ScheduleHazardRecognizer {
0026   SmallVector<std::unique_ptr<ScheduleHazardRecognizer>, 4> Recognizers;
0027 
0028 public:
0029   MultiHazardRecognizer() = default;
0030   void AddHazardRecognizer(std::unique_ptr<ScheduleHazardRecognizer> &&);
0031 
0032   bool atIssueLimit() const override;
0033   HazardType getHazardType(SUnit *, int Stalls = 0) override;
0034   void Reset() override;
0035   void EmitInstruction(SUnit *) override;
0036   void EmitInstruction(MachineInstr *) override;
0037   unsigned PreEmitNoops(SUnit *) override;
0038   unsigned PreEmitNoops(MachineInstr *) override;
0039   bool ShouldPreferAnother(SUnit *) override;
0040   void AdvanceCycle() override;
0041   void RecedeCycle() override;
0042   void EmitNoop() override;
0043 };
0044 
0045 } // end namespace llvm
0046 
0047 #endif // LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H