16 #ifndef LLVM_CODEGEN_SCOREBOARDHAZARDRECOGNIZER_H
17 #define LLVM_CODEGEN_SCOREBOARDHAZARDRECOGNIZER_H
20 #include "llvm/Support/DataTypes.h"
26 class InstrItineraryData;
50 Scoreboard():
Data(
nullptr), Depth(0), Head(0) { }
55 size_t getDepth()
const {
return Depth; }
56 unsigned& operator[](
size_t idx)
const {
58 assert(Depth && !(Depth & (Depth - 1)) &&
59 "Scoreboard was not initialized properly!");
61 return Data[(Head + idx) & (Depth-1)];
64 void reset(
size_t d = 1) {
67 Data =
new unsigned[Depth];
70 memset(
Data, 0, Depth *
sizeof(
Data[0]));
75 Head = (Head + 1) & (Depth-1);
79 Head = (Head - 1) & (Depth-1);
89 static const char *DebugType;
103 Scoreboard ReservedScoreboard;
104 Scoreboard RequiredScoreboard;
109 const char *ParentDebugType =
"");
118 void Reset()
override;
void RecedeCycle() override
RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot...
static void advance(T &it, size_t Val)
bool atIssueLimit() const override
atIssueLimit - Return true if no more instructions may be issued in this cycle.
void EmitInstruction(SUnit *SU) override
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard stat...
Itinerary data supplied by a subtarget to be used by a target.
ScoreboardHazardRecognizer(const InstrItineraryData *ItinData, const ScheduleDAG *DAG, const char *ParentDebugType="")
HazardType getHazardType(SUnit *SU, int Stalls) override
getHazardType - Return the hazard type of emitting this node.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
HazardRecognizer - This determines whether or not an instruction can be issued this cycle...
void Reset() override
Reset - This callback is invoked when a new block of instructions is about to be schedule.
void AdvanceCycle() override
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot...
SUnit - Scheduling unit. This is a node in the scheduling DAG.