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.

84 lines
3.3 KiB

  1. //==-- llvm/Target/TargetSubtargetInfo.h - Target Information ----*- 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 describes the subtarget options of a Target machine.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_TARGET_TARGETSUBTARGETINFO_H
  14. #define LLVM_TARGET_TARGETSUBTARGETINFO_H
  15. #include "llvm/MC/MCSubtargetInfo.h"
  16. #include "llvm/Support/CodeGen.h"
  17. namespace llvm {
  18. class MachineFunction;
  19. class MachineInstr;
  20. class SDep;
  21. class SUnit;
  22. class TargetRegisterClass;
  23. class TargetSchedModel;
  24. template <typename T> class SmallVectorImpl;
  25. //===----------------------------------------------------------------------===//
  26. ///
  27. /// TargetSubtargetInfo - Generic base class for all target subtargets. All
  28. /// Target-specific options that control code generation and printing should
  29. /// be exposed through a TargetSubtargetInfo-derived class.
  30. ///
  31. class TargetSubtargetInfo : public MCSubtargetInfo {
  32. TargetSubtargetInfo(const TargetSubtargetInfo&) LLVM_DELETED_FUNCTION;
  33. void operator=(const TargetSubtargetInfo&) LLVM_DELETED_FUNCTION;
  34. protected: // Can only create subclasses...
  35. TargetSubtargetInfo();
  36. public:
  37. // AntiDepBreakMode - Type of anti-dependence breaking that should
  38. // be performed before post-RA scheduling.
  39. typedef enum { ANTIDEP_NONE, ANTIDEP_CRITICAL, ANTIDEP_ALL } AntiDepBreakMode;
  40. typedef SmallVectorImpl<const TargetRegisterClass*> RegClassVector;
  41. virtual ~TargetSubtargetInfo();
  42. /// Resolve a SchedClass at runtime, where SchedClass identifies an
  43. /// MCSchedClassDesc with the isVariant property. This may return the ID of
  44. /// another variant SchedClass, but repeated invocation must quickly terminate
  45. /// in a nonvariant SchedClass.
  46. virtual unsigned resolveSchedClass(unsigned SchedClass, const MachineInstr *MI,
  47. const TargetSchedModel* SchedModel) const {
  48. return 0;
  49. }
  50. /// \brief True if the subtarget should run MachineScheduler after aggressive
  51. /// coalescing.
  52. ///
  53. /// This currently replaces the SelectionDAG scheduler with the "source" order
  54. /// scheduler. It does not yet disable the postRA scheduler.
  55. virtual bool enableMachineScheduler() const;
  56. // enablePostRAScheduler - If the target can benefit from post-regalloc
  57. // scheduling and the specified optimization level meets the requirement
  58. // return true to enable post-register-allocation scheduling. In
  59. // CriticalPathRCs return any register classes that should only be broken
  60. // if on the critical path.
  61. virtual bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
  62. AntiDepBreakMode& Mode,
  63. RegClassVector& CriticalPathRCs) const;
  64. // adjustSchedDependency - Perform target specific adjustments to
  65. // the latency of a schedule dependency.
  66. virtual void adjustSchedDependency(SUnit *def, SUnit *use,
  67. SDep& dep) const { }
  68. /// \brief Reset the features for the subtarget.
  69. virtual void resetSubtargetFeatures(const MachineFunction *MF) { }
  70. };
  71. } // End llvm namespace
  72. #endif