LLVM  14.0.0git
SchedulerRegistry.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/SchedulerRegistry.h -------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the implementation for instruction scheduler function
10 // pass registry (RegisterScheduler).
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_SCHEDULERREGISTRY_H
15 #define LLVM_CODEGEN_SCHEDULERREGISTRY_H
16 
18 #include "llvm/Support/CodeGen.h"
19 
20 namespace llvm {
21 
22 //===----------------------------------------------------------------------===//
23 ///
24 /// RegisterScheduler class - Track the registration of instruction schedulers.
25 ///
26 //===----------------------------------------------------------------------===//
27 
28 class ScheduleDAGSDNodes;
29 class SelectionDAGISel;
30 
32  : public MachinePassRegistryNode<
33  ScheduleDAGSDNodes *(*)(SelectionDAGISel *, CodeGenOpt::Level)> {
34 public:
37 
39 
40  RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
42  Registry.Add(this);
43  }
44  ~RegisterScheduler() { Registry.Remove(this); }
45 
46 
47  // Accessors.
50  }
51 
53  return (RegisterScheduler *)Registry.getList();
54  }
55 
57  Registry.setListener(L);
58  }
59 };
60 
61 /// createBURRListDAGScheduler - This creates a bottom up register usage
62 /// reduction list scheduler.
63 ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
64  CodeGenOpt::Level OptLevel);
65 
66 /// createBURRListDAGScheduler - This creates a bottom up list scheduler that
67 /// schedules nodes in source code order when possible.
68 ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
69  CodeGenOpt::Level OptLevel);
70 
71 /// createHybridListDAGScheduler - This creates a bottom up register pressure
72 /// aware list scheduler that make use of latency information to avoid stalls
73 /// for long latency instructions in low register pressure mode. In high
74 /// register pressure mode it schedules to reduce register pressure.
75 ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
77 
78 /// createILPListDAGScheduler - This creates a bottom up register pressure
79 /// aware list scheduler that tries to increase instruction level parallelism
80 /// in low register pressure mode. In high register pressure mode it schedules
81 /// to reduce register pressure.
82 ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
84 
85 /// createFastDAGScheduler - This creates a "fast" scheduler.
86 ///
87 ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
88  CodeGenOpt::Level OptLevel);
89 
90 /// createVLIWDAGScheduler - Scheduler for VLIW targets. This creates top down
91 /// DFA driven list scheduler with clustering heuristic to control
92 /// register pressure.
93 ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
94  CodeGenOpt::Level OptLevel);
95 /// createDefaultScheduler - This creates an instruction scheduler appropriate
96 /// for the target.
97 ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
98  CodeGenOpt::Level OptLevel);
99 
100 /// createDAGLinearizer - This creates a "no-scheduling" scheduler which
101 /// linearize the DAG using topological order.
102 ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
103  CodeGenOpt::Level OptLevel);
104 
105 } // end namespace llvm
106 
107 #endif // LLVM_CODEGEN_SCHEDULERREGISTRY_H
llvm::createDAGLinearizer
ScheduleDAGSDNodes * createDAGLinearizer(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createDAGLinearizer - This creates a "no-scheduling" scheduler which linearize the DAG using topologi...
Definition: ScheduleDAGFast.cpp:800
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::ScheduleDAGSDNodes
ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs.
Definition: ScheduleDAGSDNodes.h:46
MachinePassRegistry.h
llvm::createDefaultScheduler
ScheduleDAGSDNodes * createDefaultScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createDefaultScheduler - This creates an instruction scheduler appropriate for the target.
Definition: SelectionDAGISel.cpp:253
llvm::createFastDAGScheduler
ScheduleDAGSDNodes * createFastDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createFastDAGScheduler - This creates a "fast" scheduler.
Definition: ScheduleDAGFast.cpp:795
llvm::MachinePassRegistryListener< FunctionPassCtor >
llvm::RegisterScheduler::Registry
static MachinePassRegistry< FunctionPassCtor > Registry
RegisterScheduler class - Track the registration of instruction schedulers.
Definition: SchedulerRegistry.h:38
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::RegisterScheduler::getList
static RegisterScheduler * getList()
Definition: SchedulerRegistry.h:52
llvm::createILPListDAGScheduler
ScheduleDAGSDNodes * createILPListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level)
createILPListDAGScheduler - This creates a bottom up register pressure aware list scheduler that trie...
Definition: ScheduleDAGRRList.cpp:3179
llvm::createSourceListDAGScheduler
ScheduleDAGSDNodes * createSourceListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createBURRListDAGScheduler - This creates a bottom up list scheduler that schedules nodes in source c...
Definition: ScheduleDAGRRList.cpp:3149
llvm::RegisterScheduler::~RegisterScheduler
~RegisterScheduler()
Definition: SchedulerRegistry.h:44
llvm::RegisterScheduler::FunctionPassCtor
ScheduleDAGSDNodes *(*)(SelectionDAGISel *, CodeGenOpt::Level) FunctionPassCtor
Definition: SchedulerRegistry.h:36
llvm::MachinePassRegistryNode
MachinePassRegistryNode - Machine pass node stored in registration list.
Definition: MachinePassRegistry.h:48
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::createVLIWDAGScheduler
ScheduleDAGSDNodes * createVLIWDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createVLIWDAGScheduler - Scheduler for VLIW targets.
Definition: ScheduleDAGVLIW.cpp:273
llvm::RegisterScheduler::setListener
static void setListener(MachinePassRegistryListener< FunctionPassCtor > *L)
Definition: SchedulerRegistry.h:56
llvm::RegisterScheduler::getNext
RegisterScheduler * getNext() const
Definition: SchedulerRegistry.h:48
llvm::createHybridListDAGScheduler
ScheduleDAGSDNodes * createHybridListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level)
createHybridListDAGScheduler - This creates a bottom up register pressure aware list scheduler that m...
Definition: ScheduleDAGRRList.cpp:3163
llvm::MachinePassRegistry< FunctionPassCtor >
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::RegisterScheduler::RegisterScheduler
RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
Definition: SchedulerRegistry.h:40
llvm::RegisterScheduler
Definition: SchedulerRegistry.h:31
CodeGen.h
llvm::Registry
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:44
llvm::SelectionDAGISel
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
Definition: SelectionDAGISel.h:39
N
#define N
llvm::Registry::Add
A static registration template.
Definition: Registry.h:114
llvm::MachinePassRegistryNode::getNext
MachinePassRegistryNode * getNext() const
Definition: MachinePassRegistry.h:60
llvm::createBURRListDAGScheduler
ScheduleDAGSDNodes * createBURRListDAGScheduler(SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
createBURRListDAGScheduler - This creates a bottom up register usage reduction list scheduler.
Definition: ScheduleDAGRRList.cpp:3135