LLVM API Documentation

SchedulerRegistry.h
Go to the documentation of this file.
00001 //===-- llvm/CodeGen/SchedulerRegistry.h ------------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the implementation for instruction scheduler function
00011 // pass registry (RegisterScheduler).
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_CODEGEN_SCHEDULERREGISTRY_H
00016 #define LLVM_CODEGEN_SCHEDULERREGISTRY_H
00017 
00018 #include "llvm/CodeGen/MachinePassRegistry.h"
00019 #include "llvm/Target/TargetMachine.h"
00020 
00021 namespace llvm {
00022 
00023 //===----------------------------------------------------------------------===//
00024 ///
00025 /// RegisterScheduler class - Track the registration of instruction schedulers.
00026 ///
00027 //===----------------------------------------------------------------------===//
00028 
00029 class SelectionDAGISel;
00030 class ScheduleDAGSDNodes;
00031 class SelectionDAG;
00032 class MachineBasicBlock;
00033 
00034 class RegisterScheduler : public MachinePassRegistryNode {
00035 public:
00036   typedef ScheduleDAGSDNodes *(*FunctionPassCtor)(SelectionDAGISel*,
00037                                                   CodeGenOpt::Level);
00038 
00039   static MachinePassRegistry Registry;
00040 
00041   RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
00042   : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
00043   { Registry.Add(this); }
00044   ~RegisterScheduler() { Registry.Remove(this); }
00045 
00046 
00047   // Accessors.
00048   //
00049   RegisterScheduler *getNext() const {
00050     return (RegisterScheduler *)MachinePassRegistryNode::getNext();
00051   }
00052   static RegisterScheduler *getList() {
00053     return (RegisterScheduler *)Registry.getList();
00054   }
00055   static FunctionPassCtor getDefault() {
00056     return (FunctionPassCtor)Registry.getDefault();
00057   }
00058   static void setDefault(FunctionPassCtor C) {
00059     Registry.setDefault((MachinePassCtor)C);
00060   }
00061   static void setListener(MachinePassRegistryListener *L) {
00062     Registry.setListener(L);
00063   }
00064 };
00065 
00066 /// createBURRListDAGScheduler - This creates a bottom up register usage
00067 /// reduction list scheduler.
00068 ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
00069                                                CodeGenOpt::Level OptLevel);
00070 
00071 /// createBURRListDAGScheduler - This creates a bottom up list scheduler that
00072 /// schedules nodes in source code order when possible.
00073 ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
00074                                                  CodeGenOpt::Level OptLevel);
00075 
00076 /// createHybridListDAGScheduler - This creates a bottom up register pressure
00077 /// aware list scheduler that make use of latency information to avoid stalls
00078 /// for long latency instructions in low register pressure mode. In high
00079 /// register pressure mode it schedules to reduce register pressure.
00080 ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
00081                                                  CodeGenOpt::Level);
00082 
00083 /// createILPListDAGScheduler - This creates a bottom up register pressure
00084 /// aware list scheduler that tries to increase instruction level parallelism
00085 /// in low register pressure mode. In high register pressure mode it schedules
00086 /// to reduce register pressure.
00087 ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
00088                                               CodeGenOpt::Level);
00089 
00090 /// createFastDAGScheduler - This creates a "fast" scheduler.
00091 ///
00092 ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
00093                                            CodeGenOpt::Level OptLevel);
00094 
00095 /// createVLIWDAGScheduler - Scheduler for VLIW targets. This creates top down
00096 /// DFA driven list scheduler with clustering heuristic to control
00097 /// register pressure.
00098 ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
00099                                            CodeGenOpt::Level OptLevel);
00100 /// createDefaultScheduler - This creates an instruction scheduler appropriate
00101 /// for the target.
00102 ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
00103                                            CodeGenOpt::Level OptLevel);
00104 
00105 /// createDAGLinearizer - This creates a "no-scheduling" scheduler which
00106 /// linearize the DAG using topological order.
00107 ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
00108                                         CodeGenOpt::Level OptLevel);
00109 
00110 } // end namespace llvm
00111 
00112 #endif