LLVM  8.0.1
SchedulerRegistry.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/SchedulerRegistry.h -------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the implementation for instruction scheduler function
11 // pass registry (RegisterScheduler).
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_SCHEDULERREGISTRY_H
16 #define LLVM_CODEGEN_SCHEDULERREGISTRY_H
17 
19 #include "llvm/Support/CodeGen.h"
20 
21 namespace llvm {
22 
23 //===----------------------------------------------------------------------===//
24 ///
25 /// RegisterScheduler class - Track the registration of instruction schedulers.
26 ///
27 //===----------------------------------------------------------------------===//
28 
29 class ScheduleDAGSDNodes;
30 class SelectionDAGISel;
31 
33  : public MachinePassRegistryNode<
34  ScheduleDAGSDNodes *(*)(SelectionDAGISel *, CodeGenOpt::Level)> {
35 public:
38 
40 
41  RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
42  : MachinePassRegistryNode(N, D, C) {
43  Registry.Add(this);
44  }
45  ~RegisterScheduler() { Registry.Remove(this); }
46 
47 
48  // Accessors.
51  }
52 
54  return (RegisterScheduler *)Registry.getList();
55  }
56 
58  Registry.setListener(L);
59  }
60 };
61 
62 /// createBURRListDAGScheduler - This creates a bottom up register usage
63 /// reduction list scheduler.
65  CodeGenOpt::Level OptLevel);
66 
67 /// createBURRListDAGScheduler - This creates a bottom up list scheduler that
68 /// schedules nodes in source code order when possible.
70  CodeGenOpt::Level OptLevel);
71 
72 /// createHybridListDAGScheduler - This creates a bottom up register pressure
73 /// aware list scheduler that make use of latency information to avoid stalls
74 /// for long latency instructions in low register pressure mode. In high
75 /// register pressure mode it schedules to reduce register pressure.
78 
79 /// createILPListDAGScheduler - This creates a bottom up register pressure
80 /// aware list scheduler that tries to increase instruction level parallelism
81 /// in low register pressure mode. In high register pressure mode it schedules
82 /// to reduce register pressure.
85 
86 /// createFastDAGScheduler - This creates a "fast" scheduler.
87 ///
89  CodeGenOpt::Level OptLevel);
90 
91 /// createVLIWDAGScheduler - Scheduler for VLIW targets. This creates top down
92 /// DFA driven list scheduler with clustering heuristic to control
93 /// register pressure.
95  CodeGenOpt::Level OptLevel);
96 /// createDefaultScheduler - This creates an instruction scheduler appropriate
97 /// for the target.
99  CodeGenOpt::Level OptLevel);
100 
101 /// createDAGLinearizer - This creates a "no-scheduling" scheduler which
102 /// linearize the DAG using topological order.
104  CodeGenOpt::Level OptLevel);
105 
106 } // end namespace llvm
107 
108 #endif // LLVM_CODEGEN_SCHEDULERREGISTRY_H
uint64_t CallInst * C
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void Remove(MachinePassRegistryNode< PassCtorTy > *Node)
Remove - Removes a function pass from the registration list.
RegisterScheduler * getNext() const
ScheduleDAGSDNodes * createHybridListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level)
createHybridListDAGScheduler - This creates a bottom up register pressure aware list scheduler that m...
ScheduleDAGSDNodes *(*)(SelectionDAGISel *, CodeGenOpt::Level) FunctionPassCtor
RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
void setListener(MachinePassRegistryListener< PassCtorTy > *L)
ScheduleDAGSDNodes * createDAGLinearizer(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createDAGLinearizer - This creates a "no-scheduling" scheduler which linearize the DAG using topologi...
ScheduleDAGSDNodes * createBURRListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createBURRListDAGScheduler - This creates a bottom up register usage reduction list scheduler...
static MachinePassRegistry< FunctionPassCtor > Registry
RegisterScheduler class - Track the registration of instruction schedulers.
ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs.
ScheduleDAGSDNodes * createVLIWDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createVLIWDAGScheduler - Scheduler for VLIW targets.
ScheduleDAGSDNodes * createDefaultScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createDefaultScheduler - This creates an instruction scheduler appropriate for the target...
ScheduleDAGSDNodes * createILPListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level)
createILPListDAGScheduler - This creates a bottom up register pressure aware list scheduler that trie...
static RegisterScheduler * getList()
void Add(MachinePassRegistryNode< PassCtorTy > *Node)
Add - Adds a function pass to the registration list.
MachinePassRegistryNode< PassCtorTy > * getList()
ScheduleDAGSDNodes * createSourceListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createBURRListDAGScheduler - This creates a bottom up list scheduler that schedules nodes in source c...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
static void setListener(MachinePassRegistryListener< FunctionPassCtor > *L)
MachinePassRegistryNode * getNext() const
#define N
MachinePassRegistryNode - Machine pass node stored in registration list.
ScheduleDAGSDNodes * createFastDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createFastDAGScheduler - This creates a "fast" scheduler.