mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-30 05:29:47 +00:00
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
This commit is contained in:
parent
68c6e8998b
commit
247fb4ebd3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user