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.

199 lines
7.8 KiB

  1. //===- llvm/Transforms/IPO.h - Interprocedural Transformations --*- 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 header file defines prototypes for accessor functions that expose passes
  11. // in the IPO transformations library.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_TRANSFORMS_IPO_H
  15. #define LLVM_TRANSFORMS_IPO_H
  16. #include "llvm/ADT/ArrayRef.h"
  17. namespace llvm {
  18. class ModulePass;
  19. class Pass;
  20. class Function;
  21. class BasicBlock;
  22. class GlobalValue;
  23. //===----------------------------------------------------------------------===//
  24. //
  25. // These functions removes symbols from functions and modules. If OnlyDebugInfo
  26. // is true, only debugging information is removed from the module.
  27. //
  28. ModulePass *createStripSymbolsPass(bool OnlyDebugInfo = false);
  29. //===----------------------------------------------------------------------===//
  30. //
  31. // These functions strips symbols from functions and modules.
  32. // Only debugging information is not stripped.
  33. //
  34. ModulePass *createStripNonDebugSymbolsPass();
  35. //===----------------------------------------------------------------------===//
  36. //
  37. // These pass removes llvm.dbg.declare intrinsics.
  38. ModulePass *createStripDebugDeclarePass();
  39. //===----------------------------------------------------------------------===//
  40. //
  41. // These pass removes unused symbols' debug info.
  42. ModulePass *createStripDeadDebugInfoPass();
  43. //===----------------------------------------------------------------------===//
  44. /// createConstantMergePass - This function returns a new pass that merges
  45. /// duplicate global constants together into a single constant that is shared.
  46. /// This is useful because some passes (ie TraceValues) insert a lot of string
  47. /// constants into the program, regardless of whether or not they duplicate an
  48. /// existing string.
  49. ///
  50. ModulePass *createConstantMergePass();
  51. //===----------------------------------------------------------------------===//
  52. /// createGlobalOptimizerPass - This function returns a new pass that optimizes
  53. /// non-address taken internal globals.
  54. ///
  55. ModulePass *createGlobalOptimizerPass();
  56. //===----------------------------------------------------------------------===//
  57. /// createGlobalDCEPass - This transform is designed to eliminate unreachable
  58. /// internal globals (functions or global variables)
  59. ///
  60. ModulePass *createGlobalDCEPass();
  61. //===----------------------------------------------------------------------===//
  62. /// createGVExtractionPass - If deleteFn is true, this pass deletes
  63. /// the specified global values. Otherwise, it deletes as much of the module as
  64. /// possible, except for the global values specified.
  65. ///
  66. ModulePass *createGVExtractionPass(std::vector<GlobalValue*>& GVs, bool
  67. deleteFn = false);
  68. //===----------------------------------------------------------------------===//
  69. /// createFunctionInliningPass - Return a new pass object that uses a heuristic
  70. /// to inline direct function calls to small functions.
  71. ///
  72. /// The -inline-threshold command line option takes precedence over the
  73. /// threshold given here.
  74. Pass *createFunctionInliningPass();
  75. Pass *createFunctionInliningPass(int Threshold);
  76. //===----------------------------------------------------------------------===//
  77. /// createAlwaysInlinerPass - Return a new pass object that inlines only
  78. /// functions that are marked as "always_inline".
  79. Pass *createAlwaysInlinerPass();
  80. Pass *createAlwaysInlinerPass(bool InsertLifetime);
  81. //===----------------------------------------------------------------------===//
  82. /// createPruneEHPass - Return a new pass object which transforms invoke
  83. /// instructions into calls, if the callee can _not_ unwind the stack.
  84. ///
  85. Pass *createPruneEHPass();
  86. //===----------------------------------------------------------------------===//
  87. /// createInternalizePass - This pass loops over all of the functions in the
  88. /// input module, internalizing all globals (functions and variables) not in the
  89. /// given exportList.
  90. ///
  91. /// Note that commandline options that are used with the above function are not
  92. /// used now!
  93. ModulePass *createInternalizePass(ArrayRef<const char *> exportList);
  94. /// createInternalizePass - Same as above, but with an empty exportList.
  95. ModulePass *createInternalizePass();
  96. //===----------------------------------------------------------------------===//
  97. /// createDeadArgEliminationPass - This pass removes arguments from functions
  98. /// which are not used by the body of the function.
  99. ///
  100. ModulePass *createDeadArgEliminationPass();
  101. /// DeadArgHacking pass - Same as DAE, but delete arguments of external
  102. /// functions as well. This is definitely not safe, and should only be used by
  103. /// bugpoint.
  104. ModulePass *createDeadArgHackingPass();
  105. //===----------------------------------------------------------------------===//
  106. /// createArgumentPromotionPass - This pass promotes "by reference" arguments to
  107. /// be passed by value if the number of elements passed is smaller or
  108. /// equal to maxElements (maxElements == 0 means always promote).
  109. ///
  110. Pass *createArgumentPromotionPass(unsigned maxElements = 3);
  111. //===----------------------------------------------------------------------===//
  112. /// createIPConstantPropagationPass - This pass propagates constants from call
  113. /// sites into the bodies of functions.
  114. ///
  115. ModulePass *createIPConstantPropagationPass();
  116. //===----------------------------------------------------------------------===//
  117. /// createIPSCCPPass - This pass propagates constants from call sites into the
  118. /// bodies of functions, and keeps track of whether basic blocks are executable
  119. /// in the process.
  120. ///
  121. ModulePass *createIPSCCPPass();
  122. //===----------------------------------------------------------------------===//
  123. //
  124. /// createLoopExtractorPass - This pass extracts all natural loops from the
  125. /// program into a function if it can.
  126. ///
  127. Pass *createLoopExtractorPass();
  128. /// createSingleLoopExtractorPass - This pass extracts one natural loop from the
  129. /// program into a function if it can. This is used by bugpoint.
  130. ///
  131. Pass *createSingleLoopExtractorPass();
  132. /// createBlockExtractorPass - This pass extracts all blocks (except those
  133. /// specified in the argument list) from the functions in the module.
  134. ///
  135. ModulePass *createBlockExtractorPass();
  136. /// createStripDeadPrototypesPass - This pass removes any function declarations
  137. /// (prototypes) that are not used.
  138. ModulePass *createStripDeadPrototypesPass();
  139. //===----------------------------------------------------------------------===//
  140. /// createFunctionAttrsPass - This pass discovers functions that do not access
  141. /// memory, or only read memory, and gives them the readnone/readonly attribute.
  142. /// It also discovers function arguments that are not captured by the function
  143. /// and marks them with the nocapture attribute.
  144. ///
  145. Pass *createFunctionAttrsPass();
  146. //===----------------------------------------------------------------------===//
  147. /// createMergeFunctionsPass - This pass discovers identical functions and
  148. /// collapses them.
  149. ///
  150. ModulePass *createMergeFunctionsPass();
  151. //===----------------------------------------------------------------------===//
  152. /// createPartialInliningPass - This pass inlines parts of functions.
  153. ///
  154. ModulePass *createPartialInliningPass();
  155. //===----------------------------------------------------------------------===//
  156. // createMetaRenamerPass - Rename everything with metasyntatic names.
  157. //
  158. ModulePass *createMetaRenamerPass();
  159. //===----------------------------------------------------------------------===//
  160. /// createBarrierNoopPass - This pass is purely a module pass barrier in a pass
  161. /// manager.
  162. ModulePass *createBarrierNoopPass();
  163. } // End llvm namespace
  164. #endif