[PATCH] D14928: [PostRA scheduling] Allow a subtarget to do scheduling when it wants post RA

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 08:13:28 PST 2015


jonpa retitled this revision from "[PostRA scheduling] Allow a subtarget to do scheduling when  it wants post RA" to "[PostRA scheduling] Allow a subtarget to do scheduling when it wants post RA".
jonpa updated this revision to Diff 41051.
jonpa added a comment.

You are right - the check in PostrAScheduler is not needed as this is actually done already a few lines down. A bit confusing that this pass is loaded into the pass manager even though the subtarget has it disabled...
Removed.

What is left is the new customPostRAScheduling() hook, which just tells PostMachineScheduler to keep
running even if post-ra scheduling is disabled by subtarget. This is so that the target can use PostMachineScheduler anywhere it wants.


http://reviews.llvm.org/D14928

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

Index: lib/CodeGen/MachineScheduler.cpp
===================================================================
--- lib/CodeGen/MachineScheduler.cpp
+++ lib/CodeGen/MachineScheduler.cpp
@@ -352,7 +352,8 @@
   if (skipOptnoneFunction(*mf.getFunction()))
     return false;
 
-  if (!mf.getSubtarget().enablePostRAScheduler()) {
+  if (!mf.getSubtarget().enablePostRAScheduler() &&
+      !mf.getSubtarget().customPostRAScheduling()) {
     DEBUG(dbgs() << "Subtarget disables post-MI-sched.\n");
     return false;
   }
Index: include/llvm/Target/TargetSubtargetInfo.h
===================================================================
--- include/llvm/Target/TargetSubtargetInfo.h
+++ include/llvm/Target/TargetSubtargetInfo.h
@@ -135,6 +135,11 @@
   /// which is the preferred way to influence this.
   virtual bool enablePostRAScheduler() const;
 
+  /// True if subtarget is using the PostMachineScheduler at some
+  /// arbitrary point in the pass sequence while disabling the
+  /// PostRAScheduler.
+  virtual bool customPostRAScheduling() const { return false;};
+
   /// \brief True if the subtarget should run the atomic expansion pass.
   virtual bool enableAtomicExpand() const;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14928.41051.patch
Type: text/x-patch
Size: 1189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151124/528f9a28/attachment.bin>


More information about the llvm-commits mailing list