forked from OSchip/llvm-project
Move HexagonMachineScheduler to use the subtarget off of the
MachineFunction and update all uses accordingly including VLIWResourceModel. llvm-svn: 227872
This commit is contained in:
parent
d737b76b63
commit
f8b8e4a3fb
|
@ -205,20 +205,17 @@ void ConvergingVLIWScheduler::initialize(ScheduleDAGMI *dag) {
|
||||||
// Initialize the HazardRecognizers. If itineraries don't exist, are empty, or
|
// Initialize the HazardRecognizers. If itineraries don't exist, are empty, or
|
||||||
// are disabled, then these HazardRecs will be disabled.
|
// are disabled, then these HazardRecs will be disabled.
|
||||||
const InstrItineraryData *Itin = DAG->getSchedModel()->getInstrItineraries();
|
const InstrItineraryData *Itin = DAG->getSchedModel()->getInstrItineraries();
|
||||||
const TargetMachine &TM = DAG->MF.getTarget();
|
const TargetSubtargetInfo &STI = DAG->MF.getSubtarget();
|
||||||
|
const TargetInstrInfo *TII = STI.getInstrInfo();
|
||||||
delete Top.HazardRec;
|
delete Top.HazardRec;
|
||||||
delete Bot.HazardRec;
|
delete Bot.HazardRec;
|
||||||
Top.HazardRec =
|
Top.HazardRec = TII->CreateTargetMIHazardRecognizer(Itin, DAG);
|
||||||
TM.getSubtargetImpl()->getInstrInfo()->CreateTargetMIHazardRecognizer(
|
Bot.HazardRec = TII->CreateTargetMIHazardRecognizer(Itin, DAG);
|
||||||
Itin, DAG);
|
|
||||||
Bot.HazardRec =
|
|
||||||
TM.getSubtargetImpl()->getInstrInfo()->CreateTargetMIHazardRecognizer(
|
|
||||||
Itin, DAG);
|
|
||||||
|
|
||||||
delete Top.ResourceModel;
|
delete Top.ResourceModel;
|
||||||
delete Bot.ResourceModel;
|
delete Bot.ResourceModel;
|
||||||
Top.ResourceModel = new VLIWResourceModel(TM, DAG->getSchedModel());
|
Top.ResourceModel = new VLIWResourceModel(STI, DAG->getSchedModel());
|
||||||
Bot.ResourceModel = new VLIWResourceModel(TM, DAG->getSchedModel());
|
Bot.ResourceModel = new VLIWResourceModel(STI, DAG->getSchedModel());
|
||||||
|
|
||||||
assert((!llvm::ForceTopDown || !llvm::ForceBottomUp) &&
|
assert((!llvm::ForceTopDown || !llvm::ForceBottomUp) &&
|
||||||
"-misched-topdown incompatible with -misched-bottomup");
|
"-misched-topdown incompatible with -misched-bottomup");
|
||||||
|
|
|
@ -54,11 +54,9 @@ class VLIWResourceModel {
|
||||||
unsigned TotalPackets;
|
unsigned TotalPackets;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VLIWResourceModel(const TargetMachine &TM, const TargetSchedModel *SM) :
|
VLIWResourceModel(const TargetSubtargetInfo &STI, const TargetSchedModel *SM)
|
||||||
SchedModel(SM), TotalPackets(0) {
|
: SchedModel(SM), TotalPackets(0) {
|
||||||
ResourcesModel =
|
ResourcesModel = STI.getInstrInfo()->CreateTargetScheduleState(STI);
|
||||||
TM.getSubtargetImpl()->getInstrInfo()->CreateTargetScheduleState(
|
|
||||||
*TM.getSubtargetImpl());
|
|
||||||
|
|
||||||
// This hard requirement could be relaxed,
|
// This hard requirement could be relaxed,
|
||||||
// but for now do not let it proceed.
|
// but for now do not let it proceed.
|
||||||
|
|
Loading…
Reference in New Issue