diff options
author | Andrew Trick <atrick@apple.com> | 2013-09-20 05:14:41 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-09-20 05:14:41 +0000 |
commit | f45edcc3818757234c20d4d5975c0b992bf1f95e (patch) | |
tree | 4f62dfd90f52ba9e575d802aaf4c977a38c8012b /include/llvm/CodeGen/Passes.h | |
parent | c87f9488b851335fc92b48e9a15ee98df29b0def (diff) | |
download | external_llvm-f45edcc3818757234c20d4d5975c0b992bf1f95e.zip external_llvm-f45edcc3818757234c20d4d5975c0b992bf1f95e.tar.gz external_llvm-f45edcc3818757234c20d4d5975c0b992bf1f95e.tar.bz2 |
Allow subtarget selection of the default MachineScheduler and document the interface.
The global registry is used to allow command line override of the
scheduler selection, but does not work well as the normal selection
API. For example, the same LLVM process should be able to target
multiple targets or subtargets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/Passes.h')
-rw-r--r-- | include/llvm/CodeGen/Passes.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h index 9b6f61e..4e9180c 100644 --- a/include/llvm/CodeGen/Passes.h +++ b/include/llvm/CodeGen/Passes.h @@ -23,8 +23,10 @@ namespace llvm { class FunctionPass; class MachineFunctionPass; + struct MachineSchedContext; class PassInfo; class PassManagerBase; + class ScheduleDAGInstrs; class TargetLoweringBase; class TargetLowering; class TargetRegisterClass; @@ -204,6 +206,20 @@ public: /// Fully developed targets will not generally override this. virtual void addMachinePasses(); + /// createTargetScheduler - Create an instance of ScheduleDAGInstrs to be run + /// within the standard MachineScheduler pass for this function and target at + /// the current optimization level. + /// + /// This can also be used to plug a new MachineSchedStrategy into an instance + /// of the standard ScheduleDAGMI: + /// return new ScheduleDAGMI(C, new MyStrategy(C)) + /// + /// Return NULL to select the default (generic) machine scheduler. + virtual ScheduleDAGInstrs * + createMachineScheduler(MachineSchedContext *C) const { + return 0; + } + protected: // Helper to verify the analysis is really immutable. void setOpt(bool &Opt, bool Val); |