[PATCH] D78432: Add a policy to enable computing SchedDFSResult.

Mark Lacey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 18 11:17:54 PDT 2020


rudkx created this revision.
Herald added subscribers: llvm-commits, javed.absar, hiraditya, MatzeB.
Herald added a project: LLVM.
rudkx added a reviewer: MatzeB.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78432

Files:
  llvm/include/llvm/CodeGen/MachineScheduler.h
  llvm/lib/CodeGen/MachineScheduler.cpp


Index: llvm/lib/CodeGen/MachineScheduler.cpp
===================================================================
--- llvm/lib/CodeGen/MachineScheduler.cpp
+++ llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2733,6 +2733,9 @@
   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);
Index: llvm/include/llvm/CodeGen/MachineScheduler.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineScheduler.h
+++ llvm/include/llvm/CodeGen/MachineScheduler.h
@@ -186,6 +186,9 @@
   // first.
   bool DisableLatencyHeuristic = false;
 
+  // Compute DFSResult for use in scheduling heuristics.
+  bool ComputeDFSResult = false;
+
   MachineSchedPolicy() = default;
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78432.258532.patch
Type: text/x-patch
Size: 879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200418/e8313cf5/attachment.bin>


More information about the llvm-commits mailing list