Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
4.3 KiB

  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. #ifndef LLVM_CODEGEN_SCHEDULERREGISTRY_H
  15. #define LLVM_CODEGEN_SCHEDULERREGISTRY_H
  16. #include "llvm/CodeGen/MachinePassRegistry.h"
  17. #include "llvm/Target/TargetMachine.h"
  18. namespace llvm {
  19. //===----------------------------------------------------------------------===//
  20. ///
  21. /// RegisterScheduler class - Track the registration of instruction schedulers.
  22. ///
  23. //===----------------------------------------------------------------------===//
  24. class SelectionDAGISel;
  25. class ScheduleDAGSDNodes;
  26. class SelectionDAG;
  27. class MachineBasicBlock;
  28. class RegisterScheduler : public MachinePassRegistryNode {
  29. public:
  30. typedef ScheduleDAGSDNodes *(*FunctionPassCtor)(SelectionDAGISel*,
  31. CodeGenOpt::Level);
  32. static MachinePassRegistry Registry;
  33. RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
  34. : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
  35. { Registry.Add(this); }
  36. ~RegisterScheduler() { Registry.Remove(this); }
  37. // Accessors.
  38. //
  39. RegisterScheduler *getNext() const {
  40. return (RegisterScheduler *)MachinePassRegistryNode::getNext();
  41. }
  42. static RegisterScheduler *getList() {
  43. return (RegisterScheduler *)Registry.getList();
  44. }
  45. static FunctionPassCtor getDefault() {
  46. return (FunctionPassCtor)Registry.getDefault();
  47. }
  48. static void setDefault(FunctionPassCtor C) {
  49. Registry.setDefault((MachinePassCtor)C);
  50. }
  51. static void setListener(MachinePassRegistryListener *L) {
  52. Registry.setListener(L);
  53. }
  54. };
  55. /// createBURRListDAGScheduler - This creates a bottom up register usage
  56. /// reduction list scheduler.
  57. ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
  58. CodeGenOpt::Level OptLevel);
  59. /// createBURRListDAGScheduler - This creates a bottom up list scheduler that
  60. /// schedules nodes in source code order when possible.
  61. ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
  62. CodeGenOpt::Level OptLevel);
  63. /// createHybridListDAGScheduler - This creates a bottom up register pressure
  64. /// aware list scheduler that make use of latency information to avoid stalls
  65. /// for long latency instructions in low register pressure mode. In high
  66. /// register pressure mode it schedules to reduce register pressure.
  67. ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
  68. CodeGenOpt::Level);
  69. /// createILPListDAGScheduler - This creates a bottom up register pressure
  70. /// aware list scheduler that tries to increase instruction level parallelism
  71. /// in low register pressure mode. In high register pressure mode it schedules
  72. /// to reduce register pressure.
  73. ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
  74. CodeGenOpt::Level);
  75. /// createFastDAGScheduler - This creates a "fast" scheduler.
  76. ///
  77. ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
  78. CodeGenOpt::Level OptLevel);
  79. /// createVLIWDAGScheduler - Scheduler for VLIW targets. This creates top down
  80. /// DFA driven list scheduler with clustering heuristic to control
  81. /// register pressure.
  82. ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
  83. CodeGenOpt::Level OptLevel);
  84. /// createDefaultScheduler - This creates an instruction scheduler appropriate
  85. /// for the target.
  86. ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
  87. CodeGenOpt::Level OptLevel);
  88. /// createDAGLinearizer - This creates a "no-scheduling" scheduler which
  89. /// linearize the DAG using topological order.
  90. ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
  91. CodeGenOpt::Level OptLevel);
  92. } // end namespace llvm
  93. #endif