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 | 0a7056fe52724d9da0ee691e770e5500ac2bb584 (patch) | |
tree | 0de597e9ea58ed9862c0e2b1a2228761fb0382a9 /llvm/lib/CodeGen/SelectionDAG | |
parent | 1be1c636341381eb5d919550b54784c5a73f517c (diff) | |
download | bcm5719-llvm-0a7056fe52724d9da0ee691e770e5500ac2bb584.tar.gz bcm5719-llvm-0a7056fe52724d9da0ee691e770e5500ac2bb584.zip |
Add a semi-primitive form of scheduling via the "SDNode ordering" to the
bottom-up scheduler. We prefer the lower order number.
llvm-svn: 92806
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 0727bf978db..1ad7919962b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/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) |