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; 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; }