1 /*===-- IPO.h - Interprocedural Transformations C Interface -----*- C++ -*-===*\
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
8 |*===----------------------------------------------------------------------===*|
10 |* This header declares the C interface to libLLVMIPO.a, which implements *|
11 |* various interprocedural transformations of the LLVM IR. *|
13 \*===----------------------------------------------------------------------===*/
15 #ifndef LLVM_C_TRANSFORMS_IPO_H
16 #define LLVM_C_TRANSFORMS_IPO_H
18 #include "llvm-c/ExternC.h"
19 #include "llvm-c/Types.h"
24 * @defgroup LLVMCTransformsIPO Interprocedural transformations
25 * @ingroup LLVMCTransforms
30 /** See llvm::createArgumentPromotionPass function. */
31 void LLVMAddArgumentPromotionPass(LLVMPassManagerRef PM);
33 /** See llvm::createConstantMergePass function. */
34 void LLVMAddConstantMergePass(LLVMPassManagerRef PM);
36 /** See llvm::createMergeFunctionsPass function. */
37 void LLVMAddMergeFunctionsPass(LLVMPassManagerRef PM);
39 /** See llvm::createCalledValuePropagationPass function. */
40 void LLVMAddCalledValuePropagationPass(LLVMPassManagerRef PM);
42 /** See llvm::createDeadArgEliminationPass function. */
43 void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM);
45 /** See llvm::createFunctionAttrsPass function. */
46 void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM);
48 /** See llvm::createFunctionInliningPass function. */
49 void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM);
51 /** See llvm::createAlwaysInlinerPass function. */
52 void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM);
54 /** See llvm::createGlobalDCEPass function. */
55 void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);
57 /** See llvm::createGlobalOptimizerPass function. */
58 void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);
60 /** See llvm::createIPConstantPropagationPass function. */
61 void LLVMAddIPConstantPropagationPass(LLVMPassManagerRef PM);
63 /** See llvm::createPruneEHPass function. */
64 void LLVMAddPruneEHPass(LLVMPassManagerRef PM);
66 /** See llvm::createIPSCCPPass function. */
67 void LLVMAddIPSCCPPass(LLVMPassManagerRef PM);
69 /** See llvm::createInternalizePass function. */
70 void LLVMAddInternalizePass(LLVMPassManagerRef, unsigned AllButMain);
73 * Create and add the internalize pass to the given pass manager with the
74 * provided preservation callback.
76 * The context parameter is forwarded to the callback on each invocation.
77 * As such, it is the responsibility of the caller to extend its lifetime
78 * until execution of this pass has finished.
80 * @see llvm::createInternalizePass function.
82 void LLVMAddInternalizePassWithMustPreservePredicate(
83 LLVMPassManagerRef PM,
85 LLVMBool (*MustPreserve)(LLVMValueRef, void *));
87 /** See llvm::createStripDeadPrototypesPass function. */
88 void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM);
90 /** See llvm::createStripSymbolsPass function. */
91 void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM);