LLVM 23.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
19
20namespace llvm {
21
22class MachineInstr;
23class SUnit;
24
27
28public:
30
33
34 void AddHazardRecognizer(std::unique_ptr<ScheduleHazardRecognizer> &&);
35
36 bool atIssueLimit() const override;
37 HazardType getHazardType(SUnit *, int Stalls = 0) override;
38 void Reset() override;
39 void EmitInstruction(SUnit *) override;
40 void EmitInstruction(MachineInstr *) override;
41 unsigned PreEmitNoops(SUnit *) override;
42 unsigned PreEmitNoops(MachineInstr *) override;
43 bool ShouldPreferAnother(SUnit *) const override;
44 void AdvanceCycle() override;
45 void RecedeCycle() override;
46 void EmitNoop() override;
47};
48
49} // end namespace llvm
50
51#endif // LLVM_CODEGEN_MULTIHAZARDRECOGNIZER_H
#define LLVM_ABI
Definition Compiler.h:213
This file defines the SmallVector class.
Representation of each machine instruction.
unsigned PreEmitNoops(SUnit *) override
PreEmitNoops - This callback is invoked prior to emitting an instruction.
void EmitNoop() override
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
MultiHazardRecognizer(const MultiHazardRecognizer &)=delete
bool atIssueLimit() const override
atIssueLimit - Return true if no more instructions may be issued in this cycle.
void AddHazardRecognizer(std::unique_ptr< ScheduleHazardRecognizer > &&)
void Reset() override
Reset - This callback is invoked when a new block of instructions is about to be schedule.
void EmitInstruction(SUnit *) override
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard stat...
HazardType getHazardType(SUnit *, int Stalls=0) override
getHazardType - Return the hazard type of emitting this node.
void RecedeCycle() override
RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot...
MultiHazardRecognizer & operator=(const MultiHazardRecognizer &)=delete
void AdvanceCycle() override
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot...
bool ShouldPreferAnother(SUnit *) const override
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard.
Scheduling unit. This is a node in the scheduling DAG.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.