diff options
Diffstat (limited to 'include/llvm/CodeGen/MachineScheduler.h')
| -rw-r--r-- | include/llvm/CodeGen/MachineScheduler.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineScheduler.h b/include/llvm/CodeGen/MachineScheduler.h index 8590b7a348cf..e327881de13a 100644 --- a/include/llvm/CodeGen/MachineScheduler.h +++ b/include/llvm/CodeGen/MachineScheduler.h @@ -26,7 +26,7 @@ // The default scheduler, ScheduleDAGMILive, builds the DAG and drives list // scheduling while updating the instruction stream, register pressure, and live // intervals. Most targets don't need to override the DAG builder and list -// schedulier, but subtargets that require custom scheduling heuristics may +// scheduler, but subtargets that require custom scheduling heuristics may // plugin an alternate MachineSchedStrategy. The strategy is responsible for // selecting the highest priority node from the list: // @@ -214,9 +214,20 @@ public: /// This has to be enabled in combination with shouldTrackPressure(). virtual bool shouldTrackLaneMasks() const { return false; } + // If this method returns true, handling of the scheduling regions + // themselves (in case of a scheduling boundary in MBB) will be done + // beginning with the topmost region of MBB. + virtual bool doMBBSchedRegionsTopDown() const { return false; } + /// Initialize the strategy after building the DAG for a new region. virtual void initialize(ScheduleDAGMI *DAG) = 0; + /// Tell the strategy that MBB is about to be processed. + virtual void enterMBB(MachineBasicBlock *MBB) {}; + + /// Tell the strategy that current MBB is done. + virtual void leaveMBB() {}; + /// Notify this strategy that all roots have been released (including those /// that depend on EntrySU or ExitSU). virtual void registerRoots() {} @@ -284,6 +295,13 @@ public: // Provide a vtable anchor ~ScheduleDAGMI() override; + /// If this method returns true, handling of the scheduling regions + /// themselves (in case of a scheduling boundary in MBB) will be done + /// beginning with the topmost region of MBB. + bool doMBBSchedRegionsTopDown() const override { + return SchedImpl->doMBBSchedRegionsTopDown(); + } + // Returns LiveIntervals instance for use in DAG mutators and such. LiveIntervals *getLIS() const { return LIS; } @@ -326,6 +344,9 @@ public: /// reorderable instructions. void schedule() override; + void startBlock(MachineBasicBlock *bb) override; + void finishBlock() override; + /// Change the position of an instruction within the basic block and update /// live ranges and region boundary iterators. void moveInstruction(MachineInstr *MI, MachineBasicBlock::iterator InsertPos); @@ -755,9 +776,7 @@ public: /// available instruction, or NULL if there are multiple candidates. SUnit *pickOnlyChoice(); -#ifndef NDEBUG void dumpScheduledState() const; -#endif }; /// Base class for GenericScheduler. This class maintains information about |
