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.

101 lines
4.2 KiB

  1. //==-- llvm/Target/TargetSelectionDAGInfo.h - SelectionDAG Info --*- 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 declares the TargetSelectionDAGInfo class, which targets can
  11. // subclass to parameterize the SelectionDAG lowering and instruction
  12. // selection process.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #ifndef LLVM_TARGET_TARGETSELECTIONDAGINFO_H
  16. #define LLVM_TARGET_TARGETSELECTIONDAGINFO_H
  17. #include "llvm/CodeGen/SelectionDAGNodes.h"
  18. namespace llvm {
  19. class DataLayout;
  20. class TargetMachine;
  21. //===----------------------------------------------------------------------===//
  22. /// TargetSelectionDAGInfo - Targets can subclass this to parameterize the
  23. /// SelectionDAG lowering and instruction selection process.
  24. ///
  25. class TargetSelectionDAGInfo {
  26. TargetSelectionDAGInfo(const TargetSelectionDAGInfo &) LLVM_DELETED_FUNCTION;
  27. void operator=(const TargetSelectionDAGInfo &) LLVM_DELETED_FUNCTION;
  28. const DataLayout *TD;
  29. protected:
  30. const DataLayout *getDataLayout() const { return TD; }
  31. public:
  32. explicit TargetSelectionDAGInfo(const TargetMachine &TM);
  33. virtual ~TargetSelectionDAGInfo();
  34. /// EmitTargetCodeForMemcpy - Emit target-specific code that performs a
  35. /// memcpy. This can be used by targets to provide code sequences for cases
  36. /// that don't fit the target's parameters for simple loads/stores and can be
  37. /// more efficient than using a library call. This function can return a null
  38. /// SDValue if the target declines to use custom code and a different
  39. /// lowering strategy should be used.
  40. ///
  41. /// If AlwaysInline is true, the size is constant and the target should not
  42. /// emit any calls and is strongly encouraged to attempt to emit inline code
  43. /// even if it is beyond the usual threshold because this intrinsic is being
  44. /// expanded in a place where calls are not feasible (e.g. within the prologue
  45. /// for another call). If the target chooses to decline an AlwaysInline
  46. /// request here, legalize will resort to using simple loads and stores.
  47. virtual SDValue
  48. EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl,
  49. SDValue Chain,
  50. SDValue Op1, SDValue Op2,
  51. SDValue Op3, unsigned Align, bool isVolatile,
  52. bool AlwaysInline,
  53. MachinePointerInfo DstPtrInfo,
  54. MachinePointerInfo SrcPtrInfo) const {
  55. return SDValue();
  56. }
  57. /// EmitTargetCodeForMemmove - Emit target-specific code that performs a
  58. /// memmove. This can be used by targets to provide code sequences for cases
  59. /// that don't fit the target's parameters for simple loads/stores and can be
  60. /// more efficient than using a library call. This function can return a null
  61. /// SDValue if the target declines to use custom code and a different
  62. /// lowering strategy should be used.
  63. virtual SDValue
  64. EmitTargetCodeForMemmove(SelectionDAG &DAG, DebugLoc dl,
  65. SDValue Chain,
  66. SDValue Op1, SDValue Op2,
  67. SDValue Op3, unsigned Align, bool isVolatile,
  68. MachinePointerInfo DstPtrInfo,
  69. MachinePointerInfo SrcPtrInfo) const {
  70. return SDValue();
  71. }
  72. /// EmitTargetCodeForMemset - Emit target-specific code that performs a
  73. /// memset. This can be used by targets to provide code sequences for cases
  74. /// that don't fit the target's parameters for simple stores and can be more
  75. /// efficient than using a library call. This function can return a null
  76. /// SDValue if the target declines to use custom code and a different
  77. /// lowering strategy should be used.
  78. virtual SDValue
  79. EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
  80. SDValue Chain,
  81. SDValue Op1, SDValue Op2,
  82. SDValue Op3, unsigned Align, bool isVolatile,
  83. MachinePointerInfo DstPtrInfo) const {
  84. return SDValue();
  85. }
  86. };
  87. } // end llvm namespace
  88. #endif