diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-01-05 23:48:12 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-01-05 23:48:12 +0000 |
commit | 247fb4ebd363323b6642ce2bb08e53db705ca094 (patch) | |
tree | 8bd7bd42effd493d74c1835fc8078613ce328716 | |
parent | 68c6e8998b88339abadb0b8f3938a87f662beb35 (diff) | |
download | external_llvm-247fb4ebd363323b6642ce2bb08e53db705ca094.zip external_llvm-247fb4ebd363323b6642ce2bb08e53db705ca094.tar.gz external_llvm-247fb4ebd363323b6642ce2bb08e53db705ca094.tar.bz2 |
Add a semi-primitive form of scheduling via the "SDNode ordering" to the
bottom-up scheduler. We prefer the lower order number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92806 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 0727bf9..1ad7919 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1038,6 +1038,10 @@ namespace { return 0; return SethiUllmanNumbers[SU->NodeNum]; } + + unsigned getNodeOrdering(const SUnit *SU) const { + return scheduleDAG->DAG->GetOrdering(SU->getNode()); + } unsigned size() const { return Queue.size(); } @@ -1120,6 +1124,14 @@ static unsigned calcMaxScratches(const SUnit *SU) { // Bottom up bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { + unsigned LOrder = SPQ->getNodeOrdering(left); + unsigned ROrder = SPQ->getNodeOrdering(right); + + // Prefer an ordering where the lower the non-zero order number, the higher + // the preference. + if ((LOrder || ROrder) && LOrder != ROrder) + return LOrder != 0 && (LOrder < ROrder || ROrder == 0); + unsigned LPriority = SPQ->getNodePriority(left); unsigned RPriority = SPQ->getNodePriority(right); if (LPriority != RPriority) |