diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index 9b2862d..757f492 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -460,14 +460,6 @@ bool MachineScheduler::runOnMachineFunction(MachineFunction &mf) { // Instantiate the selected scheduler for this target, function, and // optimization level. std::unique_ptr<ScheduleDAGInstrs> Scheduler(createMachineScheduler()); - ScheduleDAGMI::DumpDirection D; - if (ForceTopDown) - D = ScheduleDAGMI::DumpDirection::TopDown; - else if (ForceBottomUp) - D = ScheduleDAGMI::DumpDirection::BottomUp; - else - D = ScheduleDAGMI::DumpDirection::Bidirectional; - Scheduler->setDumpDirection(D); scheduleRegions(*Scheduler, false); LLVM_DEBUG(LIS->dump()); @@ -501,14 +493,6 @@ bool PostMachineScheduler::runOnMachineFunction(MachineFunction &mf) { // Instantiate the selected scheduler for this target, function, and // optimization level. std::unique_ptr<ScheduleDAGInstrs> Scheduler(createPostMachineScheduler()); - ScheduleDAGMI::DumpDirection D; - if (PostRADirection == MISchedPostRASched::TopDown) - D = ScheduleDAGMI::DumpDirection::TopDown; - else if (PostRADirection == MISchedPostRASched::BottomUp) - D = ScheduleDAGMI::DumpDirection::BottomUp; - else - D = ScheduleDAGMI::DumpDirection::Bidirectional; - Scheduler->setDumpDirection(D); scheduleRegions(*Scheduler, true); if (VerifyScheduling) @@ -796,6 +780,16 @@ void ScheduleDAGMI::enterRegion(MachineBasicBlock *bb, ScheduleDAGInstrs::enterRegion(bb, begin, end, regioninstrs); SchedImpl->initPolicy(begin, end, regioninstrs); + + // Set dump direction after initializing sched policy. + ScheduleDAGMI::DumpDirection D; + if (SchedImpl->getPolicy().OnlyTopDown) + D = ScheduleDAGMI::DumpDirection::TopDown; + else if (SchedImpl->getPolicy().OnlyBottomUp) + D = ScheduleDAGMI::DumpDirection::BottomUp; + else + D = ScheduleDAGMI::DumpDirection::Bidirectional; + setDumpDirection(D); } /// This is normally called from the main scheduler loop but may also be invoked |