Add a policy to enable computing SchedDFSResult.

Summary:
Make GenericScheduler compute SchedDFSResult on initialization if
the policy is set. This makes it possible to create classes
that extend GenericScheduler and rely on the results of SchedDFSResult,
e.g. to perform subtree scheduling.

NFC unless the policy is set.

Subscribers: MatzeB, hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78432
This commit is contained in:
Mark Lacey
2020-03-30 12:52:14 -07:00
parent aca335955c
commit 328bb446dd
2 changed files with 6 additions and 0 deletions

View File

@@ -186,6 +186,9 @@ struct MachineSchedPolicy {
// first.
bool DisableLatencyHeuristic = false;
// Compute DFSResult for use in scheduling heuristics.
bool ComputeDFSResult = false;
MachineSchedPolicy() = default;
};

View File

@@ -2733,6 +2733,9 @@ void GenericScheduler::initialize(ScheduleDAGMI *dag) {
SchedModel = DAG->getSchedModel();
TRI = DAG->TRI;
if (RegionPolicy.ComputeDFSResult)
DAG->computeDFSResult();
Rem.init(DAG, SchedModel);
Top.init(DAG, SchedModel, &Rem);
Bot.init(DAG, SchedModel, &Rem);