diff options
author | Andrew Trick <atrick@apple.com> | 2013-01-25 06:33:57 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-01-25 06:33:57 +0000 |
commit | 4e1fb1894048455d49d62543b3f83672b27b0000 (patch) | |
tree | f5ea7b8bbf85ae1eb6c83753e07836868f292793 /include | |
parent | 827de0520ee986fcda5f0d3290a3746249fa5847 (diff) | |
download | external_llvm-4e1fb1894048455d49d62543b3f83672b27b0000.zip external_llvm-4e1fb1894048455d49d62543b3f83672b27b0000.tar.gz external_llvm-4e1fb1894048455d49d62543b3f83672b27b0000.tar.bz2 |
MIsched: Improve the interface to SchedDFS analysis (subtrees).
Allow the strategy to select SchedDFS. Allow the results of SchedDFS
to affect initialization of the scheduler state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineScheduler.h | 14 | ||||
-rw-r--r-- | include/llvm/CodeGen/ScheduleDFS.h | 7 |
2 files changed, 12 insertions, 9 deletions
diff --git a/include/llvm/CodeGen/MachineScheduler.h b/include/llvm/CodeGen/MachineScheduler.h index cc697a5..aa78f52 100644 --- a/include/llvm/CodeGen/MachineScheduler.h +++ b/include/llvm/CodeGen/MachineScheduler.h @@ -316,12 +316,9 @@ public: const SUnit *getNextClusterSucc() const { return NextClusterSucc; } - /// Initialize a DFSResult after DAG building is complete, and before any + /// Compute a DFSResult after DAG building is complete, and before any /// queue comparisons. - void initDFSResult(); - - /// Compute DFS result once all interesting roots are discovered. - void computeDFSResult(ArrayRef<SUnit*> Roots); + void computeDFSResult(); /// Return a non-null DFS result if the scheduling strategy initialized it. const SchedDFSResult *getDFSResult() const { return DFSResult; } @@ -341,8 +338,8 @@ protected: /// instances of ScheduleDAGMI to perform custom DAG postprocessing. void postprocessDAG(); - /// Identify DAG roots and setup scheduler queues. - void initQueues(); + /// Release ExitSU predecessors and setup scheduler queues. + void initQueues(ArrayRef<SUnit*> TopRoots, ArrayRef<SUnit*> BotRoots); /// Move an instruction and update register pressure. void scheduleMI(SUnit *SU, bool IsTopNode); @@ -365,7 +362,8 @@ protected: void moveInstruction(MachineInstr *MI, MachineBasicBlock::iterator InsertPos); bool checkSchedLimit(); - void releaseRoots(); + void findRootsAndBiasEdges(SmallVectorImpl<SUnit*> &TopRoots, + SmallVectorImpl<SUnit*> &BotRoots); void releaseSucc(SUnit *SU, SDep *SuccEdge); void releaseSuccessors(SUnit *SU); diff --git a/include/llvm/CodeGen/ScheduleDFS.h b/include/llvm/CodeGen/ScheduleDFS.h index 54b2232..e079292 100644 --- a/include/llvm/CodeGen/ScheduleDFS.h +++ b/include/llvm/CodeGen/ScheduleDFS.h @@ -127,7 +127,7 @@ public: } /// \brief Compute various metrics for the DAG with given roots. - void compute(ArrayRef<SUnit *> Roots); + void compute(ArrayRef<SUnit> SUnits); /// \brief Get the ILP value for a DAG node. /// @@ -140,7 +140,12 @@ public: unsigned getNumSubtrees() const { return SubtreeConnectLevels.size(); } /// \brief Get the ID of the subtree the given DAG node belongs to. + /// + /// For convenience, if DFSResults have not been computed yet, give everything + /// tree ID 0. unsigned getSubtreeID(const SUnit *SU) const { + if (empty()) + return 0; assert(SU->NodeNum < DFSData.size() && "New Node"); return DFSData[SU->NodeNum].SubtreeID; } |