llvm.org GIT mirror llvm / 6b12072
Generalize PostRAHazardRecognizer so it can be used in any pass for both forward and backward scheduling. Rename it to ScoreboardHazardRecognizer (Scoreboard is one word). Remove integer division from the scoreboard's critical path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121274 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 9 years ago
8 changed file(s) with 313 addition(s) and 287 deletion(s). Raw diff Collapse all Expand all
+0
-94
include/llvm/CodeGen/PostRAHazardRecognizer.h less more
None //=- llvm/CodeGen/PostRAHazardRecognizer.h - Scheduling Support -*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the PostRAHazardRecognizer class, which
10 // implements hazard-avoidance heuristics for scheduling, based on the
11 // scheduling itineraries specified for the target.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_EXACTHAZARDRECOGNIZER_H
16 #define LLVM_CODEGEN_EXACTHAZARDRECOGNIZER_H
17
18 #include "llvm/CodeGen/ScheduleHazardRecognizer.h"
19 #include "llvm/Support/DataTypes.h"
20
21 #include
22 #include
23 #include
24
25 namespace llvm {
26
27 class InstrItineraryData;
28 class SUnit;
29
30 class PostRAHazardRecognizer : public ScheduleHazardRecognizer {
31 // ScoreBoard to track function unit usage. ScoreBoard[0] is a
32 // mask of the FUs in use in the cycle currently being
33 // schedule. ScoreBoard[1] is a mask for the next cycle. The
34 // ScoreBoard is used as a circular buffer with the current cycle
35 // indicated by Head.
36 class ScoreBoard {
37 unsigned *Data;
38
39 // The maximum number of cycles monitored by the Scoreboard. This
40 // value is determined based on the target itineraries to ensure
41 // that all hazards can be tracked.
42 size_t Depth;
43 // Indices into the Scoreboard that represent the current cycle.
44 size_t Head;
45 public:
46 ScoreBoard():Data(NULL), Depth(0), Head(0) { }
47 ~ScoreBoard() {
48 delete[] Data;
49 }
50
51 size_t getDepth() const { return Depth; }
52 unsigned& operator[](size_t idx) const {
53 assert(Depth && "ScoreBoard was not initialized properly!");
54
55 return Data[(Head + idx) % Depth];
56 }
57
58 void reset(size_t d = 1) {
59 if (Data == NULL) {
60 Depth = d;
61 Data = new unsigned[Depth];
62 }
63
64 memset(Data, 0, Depth * sizeof(Data[0]));
65 Head = 0;
66 }
67
68 void advance() {
69 Head = (Head + 1) % Depth;
70 }
71
72 // Print the scoreboard.
73 void dump() const;
74 };
75
76 // Itinerary data for the target.
77 const InstrItineraryData *ItinData;
78
79 ScoreBoard ReservedScoreboard;
80 ScoreBoard RequiredScoreboard;
81
82 public:
83 PostRAHazardRecognizer(const InstrItineraryData *ItinData);
84
85 virtual HazardType getHazardType(SUnit *SU);
86 virtual void Reset();
87 virtual void EmitInstruction(SUnit *SU);
88 virtual void AdvanceCycle();
89 };
90
91 }
92
93 #endif
0 //=- llvm/CodeGen/ScoreboardHazardRecognizer.h - Schedule Support -*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the ScoreboardHazardRecognizer class, which
10 // encapsulates hazard-avoidance heuristics for scheduling, based on the
11 // scheduling itineraries specified for the target.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_SCOREBOARDHAZARDRECOGNIZER_H
16 #define LLVM_CODEGEN_SCOREBOARDHAZARDRECOGNIZER_H
17
18 #include "llvm/CodeGen/ScheduleHazardRecognizer.h"
19 #include "llvm/Support/DataTypes.h"
20
21 #include
22 #include
23 #include
24
25 namespace llvm {
26
27 class InstrItineraryData;
28 class SUnit;
29
30 class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
31 // Scoreboard to track function unit usage. Scoreboard[0] is a
32 // mask of the FUs in use in the cycle currently being
33 // schedule. Scoreboard[1] is a mask for the next cycle. The
34 // Scoreboard is used as a circular buffer with the current cycle
35 // indicated by Head.
36 //
37 // Scoreboard always counts cycles in forward execution order. If used by a
38 // bottom-up scheduler, then the scoreboard cycles are the inverse of the
39 // scheduler's cycles.
40 class Scoreboard {
41 unsigned *Data;
42
43 // The maximum number of cycles monitored by the Scoreboard. This
44 // value is determined based on the target itineraries to ensure
45 // that all hazards can be tracked.
46 size_t Depth;
47 // Indices into the Scoreboard that represent the current cycle.
48 size_t Head;
49 public:
50 Scoreboard():Data(NULL), Depth(0), Head(0) { }
51 ~Scoreboard() {
52 delete[] Data;
53 }
54
55 size_t getDepth() const { return Depth; }
56 unsigned& operator[](size_t idx) const {
57 // Depth is expected to be a power-of-2.
58 assert(Depth && !(Depth & (Depth - 1)) &&
59 "Scoreboard was not initialized properly!");
60
61 return Data[(Head + idx) & (Depth-1)];
62 }
63
64 void reset(size_t d = 1) {
65 if (Data == NULL) {
66 Depth = d;
67 Data = new unsigned[Depth];
68 }
69
70 memset(Data, 0, Depth * sizeof(Data[0]));
71 Head = 0;
72 }
73
74 void advance() {
75 Head = (Head + 1) & (Depth-1);
76 }
77
78 void recede() {
79 Head = (Head - 1) & (Depth-1);
80 }
81
82 // Print the scoreboard.
83 void dump() const;
84 };
85
86 // Itinerary data for the target.
87 const InstrItineraryData *ItinData;
88
89 Scoreboard ReservedScoreboard;
90 Scoreboard RequiredScoreboard;
91
92 public:
93 ScoreboardHazardRecognizer(const InstrItineraryData *ItinData);
94
95 virtual HazardType getHazardType(SUnit *SU);
96 virtual void Reset();
97 virtual void EmitInstruction(SUnit *SU);
98 virtual void AdvanceCycle();
99 virtual void RecedeCycle();
100 };
101
102 }
103
104 #endif //!LLVM_CODEGEN_SCOREBOARDHAZARDRECOGNIZER_H
5252 PHIEliminationUtils.cpp
5353 Passes.cpp
5454 PeepholeOptimizer.cpp
55 PostRAHazardRecognizer.cpp
55 ScoreboardHazardRecognizer.cpp
5656 PostRASchedulerList.cpp
5757 PreAllocSplitting.cpp
5858 ProcessImplicitDefs.cpp
+0
-180
lib/CodeGen/PostRAHazardRecognizer.cpp less more
None //===----- PostRAHazardRecognizer.cpp - hazard recognizer -------- ---------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This implements a hazard recognizer using the instructions itineraries
10 // defined for the current target.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #define DEBUG_TYPE "post-RA-sched"
15 #include "llvm/CodeGen/PostRAHazardRecognizer.h"
16 #include "llvm/CodeGen/ScheduleDAG.h"
17 #include "llvm/Support/Debug.h"
18 #include "llvm/Support/ErrorHandling.h"
19 #include "llvm/Support/raw_ostream.h"
20 #include "llvm/Target/TargetInstrItineraries.h"
21
22 using namespace llvm;
23
24 PostRAHazardRecognizer::
25 PostRAHazardRecognizer(const InstrItineraryData *LItinData) :
26 ScheduleHazardRecognizer(), ItinData(LItinData) {
27 // Determine the maximum depth of any itinerary. This determines the
28 // depth of the scoreboard. We always make the scoreboard at least 1
29 // cycle deep to avoid dealing with the boundary condition.
30 unsigned ScoreboardDepth = 1;
31 if (ItinData && !ItinData->isEmpty()) {
32 for (unsigned idx = 0; ; ++idx) {
33 if (ItinData->isEndMarker(idx))
34 break;
35
36 const InstrStage *IS = ItinData->beginStage(idx);
37 const InstrStage *E = ItinData->endStage(idx);
38 unsigned ItinDepth = 0;
39 for (; IS != E; ++IS)
40 ItinDepth += IS->getCycles();
41
42 ScoreboardDepth = std::max(ScoreboardDepth, ItinDepth);
43 }
44 }
45
46 ReservedScoreboard.reset(ScoreboardDepth);
47 RequiredScoreboard.reset(ScoreboardDepth);
48
49 DEBUG(dbgs() << "Using post-ra hazard recognizer: ScoreboardDepth = "
50 << ScoreboardDepth << '\n');
51 }
52
53 void PostRAHazardRecognizer::Reset() {
54 RequiredScoreboard.reset();
55 ReservedScoreboard.reset();
56 }
57
58 void PostRAHazardRecognizer::ScoreBoard::dump() const {
59 dbgs() << "Scoreboard:\n";
60
61 unsigned last = Depth - 1;
62 while ((last > 0) && ((*this)[last] == 0))
63 last--;
64
65 for (unsigned i = 0; i <= last; i++) {
66 unsigned FUs = (*this)[i];
67 dbgs() << "\t";
68 for (int j = 31; j >= 0; j--)
69 dbgs() << ((FUs & (1 << j)) ? '1' : '0');
70 dbgs() << '\n';
71 }
72 }
73
74 ScheduleHazardRecognizer::HazardType
75 PostRAHazardRecognizer::getHazardType(SUnit *SU) {
76 if (!ItinData || ItinData->isEmpty())
77 return NoHazard;
78
79 unsigned cycle = 0;
80
81 // Use the itinerary for the underlying instruction to check for
82 // free FU's in the scoreboard at the appropriate future cycles.
83 unsigned idx = SU->getInstr()->getDesc().getSchedClass();
84 for (const InstrStage *IS = ItinData->beginStage(idx),
85 *E = ItinData->endStage(idx); IS != E; ++IS) {
86 // We must find one of the stage's units free for every cycle the
87 // stage is occupied. FIXME it would be more accurate to find the
88 // same unit free in all the cycles.
89 for (unsigned int i = 0; i < IS->getCycles(); ++i) {
90 assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
91 "Scoreboard depth exceeded!");
92
93 unsigned freeUnits = IS->getUnits();
94 switch (IS->getReservationKind()) {
95 default:
96 assert(0 && "Invalid FU reservation");
97 case InstrStage::Required:
98 // Required FUs conflict with both reserved and required ones
99 freeUnits &= ~ReservedScoreboard[cycle + i];
100 // FALLTHROUGH
101 case InstrStage::Reserved:
102 // Reserved FUs can conflict only with required ones.
103 freeUnits &= ~RequiredScoreboard[cycle + i];
104 break;
105 }
106
107 if (!freeUnits) {
108 DEBUG(dbgs() << "*** Hazard in cycle " << (cycle + i) << ", ");
109 DEBUG(dbgs() << "SU(" << SU->NodeNum << "): ");
110 DEBUG(SU->getInstr()->dump());
111 return Hazard;
112 }
113 }
114
115 // Advance the cycle to the next stage.
116 cycle += IS->getNextCycles();
117 }
118
119 return NoHazard;
120 }
121
122 void PostRAHazardRecognizer::EmitInstruction(SUnit *SU) {
123 if (!ItinData || ItinData->isEmpty())
124 return;
125
126 unsigned cycle = 0;
127
128 // Use the itinerary for the underlying instruction to reserve FU's
129 // in the scoreboard at the appropriate future cycles.
130 unsigned idx = SU->getInstr()->getDesc().getSchedClass();
131 for (const InstrStage *IS = ItinData->beginStage(idx),
132 *E = ItinData->endStage(idx); IS != E; ++IS) {
133 // We must reserve one of the stage's units for every cycle the
134 // stage is occupied. FIXME it would be more accurate to reserve
135 // the same unit free in all the cycles.
136 for (unsigned int i = 0; i < IS->getCycles(); ++i) {
137 assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
138 "Scoreboard depth exceeded!");
139
140 unsigned freeUnits = IS->getUnits();
141 switch (IS->getReservationKind()) {
142 default:
143 assert(0 && "Invalid FU reservation");
144 case InstrStage::Required:
145 // Required FUs conflict with both reserved and required ones
146 freeUnits &= ~ReservedScoreboard[cycle + i];
147 // FALLTHROUGH
148 case InstrStage::Reserved:
149 // Reserved FUs can conflict only with required ones.
150 freeUnits &= ~RequiredScoreboard[cycle + i];
151 break;
152 }
153
154 // reduce to a single unit
155 unsigned freeUnit = 0;
156 do {
157 freeUnit = freeUnits;
158 freeUnits = freeUnit & (freeUnit - 1);
159 } while (freeUnits);
160
161 assert(freeUnit && "No function unit available!");
162 if (IS->getReservationKind() == InstrStage::Required)
163 RequiredScoreboard[cycle + i] |= freeUnit;
164 else
165 ReservedScoreboard[cycle + i] |= freeUnit;
166 }
167
168 // Advance the cycle to the next stage.
169 cycle += IS->getNextCycles();
170 }
171
172 DEBUG(ReservedScoreboard.dump());
173 DEBUG(RequiredScoreboard.dump());
174 }
175
176 void PostRAHazardRecognizer::AdvanceCycle() {
177 ReservedScoreboard[0] = 0; ReservedScoreboard.advance();
178 RequiredScoreboard[0] = 0; RequiredScoreboard.advance();
179 }
0 //===----- ScoreboardHazardRecognizer.cpp - Scheduler Support -------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the ScoreboardHazardRecognizer class, which
10 // encapsultes hazard-avoidance heuristics for scheduling, based on the
11 // scheduling itineraries specified for the target.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #define DEBUG_TYPE "sched-hazard"
16 #include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
17 #include "llvm/CodeGen/ScheduleDAG.h"
18 #include "llvm/Support/Debug.h"
19 #include "llvm/Support/ErrorHandling.h"
20 #include "llvm/Support/raw_ostream.h"
21 #include "llvm/Target/TargetInstrItineraries.h"
22
23 using namespace llvm;
24
25 ScoreboardHazardRecognizer::
26 ScoreboardHazardRecognizer(const InstrItineraryData *LItinData) :
27 ScheduleHazardRecognizer(), ItinData(LItinData) {
28 // Determine the maximum depth of any itinerary. This determines the
29 // depth of the scoreboard. We always make the scoreboard at least 1
30 // cycle deep to avoid dealing with the boundary condition.
31 unsigned ScoreboardDepth = 1;
32 if (ItinData && !ItinData->isEmpty()) {
33 for (unsigned idx = 0; ; ++idx) {
34 if (ItinData->isEndMarker(idx))
35 break;
36
37 const InstrStage *IS = ItinData->beginStage(idx);
38 const InstrStage *E = ItinData->endStage(idx);
39 unsigned ItinDepth = 0;
40 for (; IS != E; ++IS)
41 ItinDepth += IS->getCycles();
42
43 // Find the next power-of-2 >= ItinDepth
44 while (ItinDepth > ScoreboardDepth) {
45 ScoreboardDepth *= 2;
46 }
47 }
48 }
49
50 ReservedScoreboard.reset(ScoreboardDepth);
51 RequiredScoreboard.reset(ScoreboardDepth);
52
53 DEBUG(dbgs() << "Using scoreboard hazard recognizer: Depth = "
54 << ScoreboardDepth << '\n');
55 }
56
57 void ScoreboardHazardRecognizer::Reset() {
58 RequiredScoreboard.reset();
59 ReservedScoreboard.reset();
60 }
61
62 void ScoreboardHazardRecognizer::Scoreboard::dump() const {
63 dbgs() << "Scoreboard:\n";
64
65 unsigned last = Depth - 1;
66 while ((last > 0) && ((*this)[last] == 0))
67 last--;
68
69 for (unsigned i = 0; i <= last; i++) {
70 unsigned FUs = (*this)[i];
71 dbgs() << "\t";
72 for (int j = 31; j >= 0; j--)
73 dbgs() << ((FUs & (1 << j)) ? '1' : '0');
74 dbgs() << '\n';
75 }
76 }
77
78 ScheduleHazardRecognizer::HazardType
79 ScoreboardHazardRecognizer::getHazardType(SUnit *SU) {
80 if (!ItinData || ItinData->isEmpty())
81 return NoHazard;
82
83 unsigned cycle = 0;
84
85 // Use the itinerary for the underlying instruction to check for
86 // free FU's in the scoreboard at the appropriate future cycles.
87 unsigned idx = SU->getInstr()->getDesc().getSchedClass();
88 for (const InstrStage *IS = ItinData->beginStage(idx),
89 *E = ItinData->endStage(idx); IS != E; ++IS) {
90 // We must find one of the stage's units free for every cycle the
91 // stage is occupied. FIXME it would be more accurate to find the
92 // same unit free in all the cycles.
93 for (unsigned int i = 0; i < IS->getCycles(); ++i) {
94 assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
95 "Scoreboard depth exceeded!");
96
97 unsigned freeUnits = IS->getUnits();
98 switch (IS->getReservationKind()) {
99 default:
100 assert(0 && "Invalid FU reservation");
101 case InstrStage::Required:
102 // Required FUs conflict with both reserved and required ones
103 freeUnits &= ~ReservedScoreboard[cycle + i];
104 // FALLTHROUGH
105 case InstrStage::Reserved:
106 // Reserved FUs can conflict only with required ones.
107 freeUnits &= ~RequiredScoreboard[cycle + i];
108 break;
109 }
110
111 if (!freeUnits) {
112 DEBUG(dbgs() << "*** Hazard in cycle " << (cycle + i) << ", ");
113 DEBUG(dbgs() << "SU(" << SU->NodeNum << "): ");
114 DEBUG(SU->getInstr()->dump());
115 return Hazard;
116 }
117 }
118
119 // Advance the cycle to the next stage.
120 cycle += IS->getNextCycles();
121 }
122
123 return NoHazard;
124 }
125
126 void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
127 if (!ItinData || ItinData->isEmpty())
128 return;
129
130 unsigned cycle = 0;
131
132 // Use the itinerary for the underlying instruction to reserve FU's
133 // in the scoreboard at the appropriate future cycles.
134 unsigned idx = SU->getInstr()->getDesc().getSchedClass();
135 for (const InstrStage *IS = ItinData->beginStage(idx),
136 *E = ItinData->endStage(idx); IS != E; ++IS) {
137 // We must reserve one of the stage's units for every cycle the
138 // stage is occupied. FIXME it would be more accurate to reserve
139 // the same unit free in all the cycles.
140 for (unsigned int i = 0; i < IS->getCycles(); ++i) {
141 assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
142 "Scoreboard depth exceeded!");
143
144 unsigned freeUnits = IS->getUnits();
145 switch (IS->getReservationKind()) {
146 default:
147 assert(0 && "Invalid FU reservation");
148 case InstrStage::Required:
149 // Required FUs conflict with both reserved and required ones
150 freeUnits &= ~ReservedScoreboard[cycle + i];
151 // FALLTHROUGH
152 case InstrStage::Reserved:
153 // Reserved FUs can conflict only with required ones.
154 freeUnits &= ~RequiredScoreboard[cycle + i];
155 break;
156 }
157
158 // reduce to a single unit
159 unsigned freeUnit = 0;
160 do {
161 freeUnit = freeUnits;
162 freeUnits = freeUnit & (freeUnit - 1);
163 } while (freeUnits);
164
165 assert(freeUnit && "No function unit available!");
166 if (IS->getReservationKind() == InstrStage::Required)
167 RequiredScoreboard[cycle + i] |= freeUnit;
168 else
169 ReservedScoreboard[cycle + i] |= freeUnit;
170 }
171
172 // Advance the cycle to the next stage.
173 cycle += IS->getNextCycles();
174 }
175
176 DEBUG(ReservedScoreboard.dump());
177 DEBUG(RequiredScoreboard.dump());
178 }
179
180 void ScoreboardHazardRecognizer::AdvanceCycle() {
181 ReservedScoreboard[0] = 0; ReservedScoreboard.advance();
182 RequiredScoreboard[0] = 0; RequiredScoreboard.advance();
183 }
184
185 void ScoreboardHazardRecognizer::RecedeCycle() {
186 ReservedScoreboard[ReservedScoreboard.getDepth()-1] = 0;
187 ReservedScoreboard.recede();
188 RequiredScoreboard[RequiredScoreboard.getDepth()-1] = 0;
189 RequiredScoreboard.recede();
190 }
2121 #include "llvm/CodeGen/MachineInstrBuilder.h"
2222 #include "llvm/CodeGen/MachineMemOperand.h"
2323 #include "llvm/CodeGen/MachineRegisterInfo.h"
24 #include "llvm/CodeGen/PostRAHazardRecognizer.h"
24 #include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
2525 #include "llvm/CodeGen/PseudoSourceValue.h"
2626 #include "llvm/Support/Debug.h"
2727 #include "llvm/Support/ErrorHandling.h"
134134 const TargetInstrDesc &TID = MI->getDesc();
135135 if (!TID.isPredicable())
136136 return false;
137
137
138138 for (unsigned j = 0, i = 0, e = MI->getNumOperands(); i != e; ++i) {
139139 if (TID.OpInfo[i].isPredicate()) {
140140 MachineOperand &MO = MI->getOperand(i);
416416 // Default implementation of CreateTargetPostRAHazardRecognizer.
417417 ScheduleHazardRecognizer *TargetInstrInfoImpl::
418418 CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II) const {
419 return (ScheduleHazardRecognizer *)new PostRAHazardRecognizer(II);
420 }
419 return (ScheduleHazardRecognizer *)new ScoreboardHazardRecognizer(II);
420 }
6767 }
6868 }
6969
70 return PostRAHazardRecognizer::getHazardType(SU);
70 return ScoreboardHazardRecognizer::getHazardType(SU);
7171 }
7272
7373 void ARMHazardRecognizer::Reset() {
7474 LastMI = 0;
7575 Stalls = 0;
7676 ITBlockSize = 0;
77 PostRAHazardRecognizer::Reset();
77 ScoreboardHazardRecognizer::Reset();
7878 }
7979
8080 void ARMHazardRecognizer::EmitInstruction(SUnit *SU) {
102102 Stalls = 0;
103103 }
104104
105 PostRAHazardRecognizer::EmitInstruction(SU);
105 ScoreboardHazardRecognizer::EmitInstruction(SU);
106106 }
107107
108108 void ARMHazardRecognizer::AdvanceCycle() {
109109 if (Stalls && --Stalls == 0)
110110 // Stalled for 4 cycles but still can't schedule any other instructions.
111111 LastMI = 0;
112 PostRAHazardRecognizer::AdvanceCycle();
112 ScoreboardHazardRecognizer::AdvanceCycle();
113113 }
114
115 void ARMHazardRecognizer::RecedeCycle() {
116 llvm_unreachable("reverse ARM hazard checking unsupported");
117 }
1313 #ifndef ARMHAZARDRECOGNIZER_H
1414 #define ARMHAZARDRECOGNIZER_H
1515
16 #include "llvm/CodeGen/PostRAHazardRecognizer.h"
16 #include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
1717
1818 namespace llvm {
1919
2222 class ARMSubtarget;
2323 class MachineInstr;
2424
25 class ARMHazardRecognizer : public PostRAHazardRecognizer {
25 class ARMHazardRecognizer : public ScoreboardHazardRecognizer {
2626 const ARMBaseInstrInfo &TII;
2727 const ARMBaseRegisterInfo &TRI;
2828 const ARMSubtarget &STI;
3737 const ARMBaseInstrInfo &tii,
3838 const ARMBaseRegisterInfo &tri,
3939 const ARMSubtarget &sti) :
40 PostRAHazardRecognizer(ItinData), TII(tii), TRI(tri), STI(sti),
40 ScoreboardHazardRecognizer(ItinData), TII(tii), TRI(tri), STI(sti),
4141 LastMI(0), ITBlockSize(0) {}
4242
4343 virtual HazardType getHazardType(SUnit *SU);
4444 virtual void Reset();
4545 virtual void EmitInstruction(SUnit *SU);
4646 virtual void AdvanceCycle();
47 virtual void RecedeCycle();
4748 };
48
4949
5050 } // end namespace llvm
5151