Scalar.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- Scalar.h - Scalar Transformation Library C Interface ----*- C++ -*-===*\
  7. |* *|
  8. |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
  9. |* Exceptions. *|
  10. |* See https://llvm.org/LICENSE.txt for license information. *|
  11. |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
  12. |* *|
  13. |*===----------------------------------------------------------------------===*|
  14. |* *|
  15. |* This header declares the C interface to libLLVMScalarOpts.a, which *|
  16. |* implements various scalar transformations of the LLVM IR. *|
  17. |* *|
  18. |* Many exotic languages can interoperate with C code but have a harder time *|
  19. |* with C++ due to name mangling. So in addition to C, this interface enables *|
  20. |* tools written in such languages. *|
  21. |* *|
  22. \*===----------------------------------------------------------------------===*/
  23. #ifndef LLVM_C_TRANSFORMS_SCALAR_H
  24. #define LLVM_C_TRANSFORMS_SCALAR_H
  25. #include "llvm-c/ExternC.h"
  26. #include "llvm-c/Types.h"
  27. LLVM_C_EXTERN_C_BEGIN
  28. /**
  29. * @defgroup LLVMCTransformsScalar Scalar transformations
  30. * @ingroup LLVMCTransforms
  31. *
  32. * @{
  33. */
  34. /** See llvm::createAggressiveDCEPass function. */
  35. void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
  36. /** See llvm::createDeadCodeEliminationPass function. */
  37. void LLVMAddDCEPass(LLVMPassManagerRef PM);
  38. /** See llvm::createBitTrackingDCEPass function. */
  39. void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM);
  40. /** See llvm::createAlignmentFromAssumptionsPass function. */
  41. void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);
  42. /** See llvm::createCFGSimplificationPass function. */
  43. void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
  44. /** See llvm::createDeadStoreEliminationPass function. */
  45. void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);
  46. /** See llvm::createScalarizerPass function. */
  47. void LLVMAddScalarizerPass(LLVMPassManagerRef PM);
  48. /** See llvm::createMergedLoadStoreMotionPass function. */
  49. void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);
  50. /** See llvm::createGVNPass function. */
  51. void LLVMAddGVNPass(LLVMPassManagerRef PM);
  52. /** See llvm::createGVNPass function. */
  53. void LLVMAddNewGVNPass(LLVMPassManagerRef PM);
  54. /** See llvm::createIndVarSimplifyPass function. */
  55. void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
  56. /** See llvm::createInstructionCombiningPass function. */
  57. void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
  58. /** See llvm::createInstSimplifyLegacyPass function. */
  59. void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM);
  60. /** See llvm::createJumpThreadingPass function. */
  61. void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
  62. /** See llvm::createLICMPass function. */
  63. void LLVMAddLICMPass(LLVMPassManagerRef PM);
  64. /** See llvm::createLoopDeletionPass function. */
  65. void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
  66. /** See llvm::createLoopIdiomPass function */
  67. void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
  68. /** See llvm::createLoopRotatePass function. */
  69. void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
  70. /** See llvm::createLoopRerollPass function. */
  71. void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
  72. /** See llvm::createLoopUnrollPass function. */
  73. void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
  74. /** See llvm::createLoopUnrollAndJamPass function. */
  75. void LLVMAddLoopUnrollAndJamPass(LLVMPassManagerRef PM);
  76. /** See llvm::createLowerAtomicPass function. */
  77. void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);
  78. /** See llvm::createMemCpyOptPass function. */
  79. void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
  80. /** See llvm::createPartiallyInlineLibCallsPass function. */
  81. void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
  82. /** See llvm::createReassociatePass function. */
  83. void LLVMAddReassociatePass(LLVMPassManagerRef PM);
  84. /** See llvm::createSCCPPass function. */
  85. void LLVMAddSCCPPass(LLVMPassManagerRef PM);
  86. /** See llvm::createSROAPass function. */
  87. void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
  88. /** See llvm::createSROAPass function. */
  89. void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);
  90. /** See llvm::createSROAPass function. */
  91. void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
  92. int Threshold);
  93. /** See llvm::createSimplifyLibCallsPass function. */
  94. void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
  95. /** See llvm::createTailCallEliminationPass function. */
  96. void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
  97. /** See llvm::demotePromoteMemoryToRegisterPass function. */
  98. void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
  99. /** See llvm::createVerifierPass function. */
  100. void LLVMAddVerifierPass(LLVMPassManagerRef PM);
  101. /** See llvm::createCorrelatedValuePropagationPass function */
  102. void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);
  103. /** See llvm::createEarlyCSEPass function */
  104. void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);
  105. /** See llvm::createEarlyCSEPass function */
  106. void LLVMAddEarlyCSEMemSSAPass(LLVMPassManagerRef PM);
  107. /** See llvm::createLowerExpectIntrinsicPass function */
  108. void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);
  109. /** See llvm::createLowerConstantIntrinsicsPass function */
  110. void LLVMAddLowerConstantIntrinsicsPass(LLVMPassManagerRef PM);
  111. /** See llvm::createTypeBasedAliasAnalysisPass function */
  112. void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
  113. /** See llvm::createScopedNoAliasAAPass function */
  114. void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM);
  115. /** See llvm::createBasicAliasAnalysisPass function */
  116. void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
  117. /** See llvm::createUnifyFunctionExitNodesPass function */
  118. void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM);
  119. /**
  120. * @}
  121. */
  122. LLVM_C_EXTERN_C_END
  123. #endif
  124. #ifdef __GNUC__
  125. #pragma GCC diagnostic pop
  126. #endif