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:
Eric Christopher 2015-02-02 22:11:40 +00:00
parent d737b76b63
commit f8b8e4a3fb
2 changed files with 9 additions and 14 deletions

View File

@ -205,20 +205,17 @@ void ConvergingVLIWScheduler::initialize(ScheduleDAGMI *dag) {
// Initialize the HazardRecognizers. If itineraries don't exist, are empty, or
// are disabled, then these HazardRecs will be disabled.
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 Bot.HazardRec;
Top.HazardRec =
TM.getSubtargetImpl()->getInstrInfo()->CreateTargetMIHazardRecognizer(
Itin, DAG);
Bot.HazardRec =
TM.getSubtargetImpl()->getInstrInfo()->CreateTargetMIHazardRecognizer(
Itin, DAG);
Top.HazardRec = TII->CreateTargetMIHazardRecognizer(Itin, DAG);
Bot.HazardRec = TII->CreateTargetMIHazardRecognizer(Itin, DAG);
delete Top.ResourceModel;
delete Bot.ResourceModel;
Top.ResourceModel = new VLIWResourceModel(TM, DAG->getSchedModel());
Bot.ResourceModel = new VLIWResourceModel(TM, DAG->getSchedModel());
Top.ResourceModel = new VLIWResourceModel(STI, DAG->getSchedModel());
Bot.ResourceModel = new VLIWResourceModel(STI, DAG->getSchedModel());
assert((!llvm::ForceTopDown || !llvm::ForceBottomUp) &&
"-misched-topdown incompatible with -misched-bottomup");

View File

@ -54,11 +54,9 @@ class VLIWResourceModel {
unsigned TotalPackets;
public:
VLIWResourceModel(const TargetMachine &TM, const TargetSchedModel *SM) :
SchedModel(SM), TotalPackets(0) {
ResourcesModel =
TM.getSubtargetImpl()->getInstrInfo()->CreateTargetScheduleState(
*TM.getSubtargetImpl());
VLIWResourceModel(const TargetSubtargetInfo &STI, const TargetSchedModel *SM)
: SchedModel(SM), TotalPackets(0) {
ResourcesModel = STI.getInstrInfo()->CreateTargetScheduleState(STI);
// This hard requirement could be relaxed,
// but for now do not let it proceed.