Skip to content

Commit b891490

Browse files
committed
[Scheduler] Adjust interface of CreateTargetMIHazardRecognizer to use ScheduleDAGMI. NFC
All the callers of this function will be ScheduleDAGMI from the MachineScheduler. This allows us to use the extra info available in ScheduleDAGMI without resorting to awkward casts.
1 parent 914b551 commit b891490

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

llvm/include/llvm/CodeGen/TargetInstrInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class MCInst;
5252
struct MCSchedModel;
5353
class Module;
5454
class ScheduleDAG;
55+
class ScheduleDAGMI;
5556
class ScheduleHazardRecognizer;
5657
class SDNode;
5758
class SelectionDAG;
@@ -1370,7 +1371,7 @@ class TargetInstrInfo : public MCInstrInfo {
13701371
/// scheduling the machine instructions before register allocation.
13711372
virtual ScheduleHazardRecognizer *
13721373
CreateTargetMIHazardRecognizer(const InstrItineraryData *,
1373-
const ScheduleDAG *DAG) const;
1374+
const ScheduleDAGMI *DAG) const;
13741375

13751376
/// Allocate and return a hazard recognizer to use for this target when
13761377
/// scheduling the machine instructions after register allocation.

llvm/lib/CodeGen/TargetInstrInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "llvm/CodeGen/MachineInstrBuilder.h"
1616
#include "llvm/CodeGen/MachineMemOperand.h"
1717
#include "llvm/CodeGen/MachineRegisterInfo.h"
18+
#include "llvm/CodeGen/MachineScheduler.h"
1819
#include "llvm/CodeGen/PseudoSourceValue.h"
1920
#include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
2021
#include "llvm/CodeGen/StackMaps.h"
@@ -1015,9 +1016,8 @@ CreateTargetHazardRecognizer(const TargetSubtargetInfo *STI,
10151016
}
10161017

10171018
// Default implementation of CreateTargetMIHazardRecognizer.
1018-
ScheduleHazardRecognizer *TargetInstrInfo::
1019-
CreateTargetMIHazardRecognizer(const InstrItineraryData *II,
1020-
const ScheduleDAG *DAG) const {
1019+
ScheduleHazardRecognizer *TargetInstrInfo::CreateTargetMIHazardRecognizer(
1020+
const InstrItineraryData *II, const ScheduleDAGMI *DAG) const {
10211021
return new ScoreboardHazardRecognizer(II, DAG, "machine-scheduler");
10221022
}
10231023

0 commit comments

Comments
 (0)