LLVM  14.0.0git
MultiHazardRecognizer.h
Go to the documentation of this file.
1 //=- llvm/CodeGen/MultiHazardRecognizer.h - Scheduling Support ----*- 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 //
9 // This file implements the MultiHazardRecognizer class, which is a wrapper
10 // for a set of ScheduleHazardRecognizer instances
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H
15 #define LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H
16 
17 #include "llvm/ADT/SmallVector.h"
19 
20 namespace llvm {
21 
22 class MachineInstr;
23 class SUnit;
24 
27 
28 public:
29  MultiHazardRecognizer() = default;
30  void AddHazardRecognizer(std::unique_ptr<ScheduleHazardRecognizer> &&);
31 
32  bool atIssueLimit() const override;
33  HazardType getHazardType(SUnit *, int Stalls = 0) override;
34  void Reset() override;
35  void EmitInstruction(SUnit *) override;
36  void EmitInstruction(MachineInstr *) override;
37  unsigned PreEmitNoops(SUnit *) override;
38  unsigned PreEmitNoops(MachineInstr *) override;
39  bool ShouldPreferAnother(SUnit *) override;
40  void AdvanceCycle() override;
41  void RecedeCycle() override;
42  void EmitNoop() override;
43 };
44 
45 } // end namespace llvm
46 
47 #endif // LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::MultiHazardRecognizer::getHazardType
HazardType getHazardType(SUnit *, int Stalls=0) override
getHazardType - Return the hazard type of emitting this node.
Definition: MultiHazardRecognizer.cpp:34
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::MultiHazardRecognizer::MultiHazardRecognizer
MultiHazardRecognizer()=default
ScheduleHazardRecognizer.h
llvm::MultiHazardRecognizer::EmitInstruction
void EmitInstruction(SUnit *) override
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard stat...
Definition: MultiHazardRecognizer.cpp:48
llvm::MultiHazardRecognizer::atIssueLimit
bool atIssueLimit() const override
atIssueLimit - Return true if no more instructions may be issued in this cycle.
Definition: MultiHazardRecognizer.cpp:28
llvm::MultiHazardRecognizer
Definition: MultiHazardRecognizer.h:25
llvm::ScheduleHazardRecognizer::HazardType
HazardType
Definition: ScheduleHazardRecognizer.h:37
llvm::MultiHazardRecognizer::Reset
void Reset() override
Reset - This callback is invoked when a new block of instructions is about to be schedule.
Definition: MultiHazardRecognizer.cpp:43
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::MultiHazardRecognizer::RecedeCycle
void RecedeCycle() override
RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot...
Definition: MultiHazardRecognizer.cpp:84
llvm::MultiHazardRecognizer::EmitNoop
void EmitNoop() override
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
Definition: MultiHazardRecognizer.cpp:89
SmallVector.h
llvm::MultiHazardRecognizer::PreEmitNoops
unsigned PreEmitNoops(SUnit *) override
PreEmitNoops - This callback is invoked prior to emitting an instruction.
Definition: MultiHazardRecognizer.cpp:58
llvm::SUnit
Scheduling unit. This is a node in the scheduling DAG.
Definition: ScheduleDAG.h:242
llvm::ScheduleHazardRecognizer
HazardRecognizer - This determines whether or not an instruction can be issued this cycle,...
Definition: ScheduleHazardRecognizer.h:25
llvm::MultiHazardRecognizer::AdvanceCycle
void AdvanceCycle() override
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot...
Definition: MultiHazardRecognizer.cpp:79
llvm::MultiHazardRecognizer::AddHazardRecognizer
void AddHazardRecognizer(std::unique_ptr< ScheduleHazardRecognizer > &&)
Definition: MultiHazardRecognizer.cpp:22
llvm::MultiHazardRecognizer::ShouldPreferAnother
bool ShouldPreferAnother(SUnit *) override
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard.
Definition: MultiHazardRecognizer.cpp:72