blob: 3f2cadf32366b467e1d0fa0be01f9abf0c168acb [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001/*===-- IPO.h - Interprocedural Transformations C Interface -----*- C++ -*-===*\
2|* *|
Andrew Walbran16937d02019-10-22 13:54:20 +01003|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4|* Exceptions. *|
5|* See https://llvm.org/LICENSE.txt for license information. *|
6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01007|* *|
8|*===----------------------------------------------------------------------===*|
9|* *|
10|* This header declares the C interface to libLLVMIPO.a, which implements *|
11|* various interprocedural transformations of the LLVM IR. *|
12|* *|
13\*===----------------------------------------------------------------------===*/
14
15#ifndef LLVM_C_TRANSFORMS_IPO_H
16#define LLVM_C_TRANSFORMS_IPO_H
17
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020018#include "llvm-c/ExternC.h"
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010019#include "llvm-c/Types.h"
20
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020021LLVM_C_EXTERN_C_BEGIN
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010022
23/**
24 * @defgroup LLVMCTransformsIPO Interprocedural transformations
25 * @ingroup LLVMCTransforms
26 *
27 * @{
28 */
29
30/** See llvm::createArgumentPromotionPass function. */
31void LLVMAddArgumentPromotionPass(LLVMPassManagerRef PM);
32
33/** See llvm::createConstantMergePass function. */
34void LLVMAddConstantMergePass(LLVMPassManagerRef PM);
35
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020036/** See llvm::createMergeFunctionsPass function. */
37void LLVMAddMergeFunctionsPass(LLVMPassManagerRef PM);
38
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010039/** See llvm::createCalledValuePropagationPass function. */
40void LLVMAddCalledValuePropagationPass(LLVMPassManagerRef PM);
41
42/** See llvm::createDeadArgEliminationPass function. */
43void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM);
44
45/** See llvm::createFunctionAttrsPass function. */
46void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM);
47
48/** See llvm::createFunctionInliningPass function. */
49void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM);
50
51/** See llvm::createAlwaysInlinerPass function. */
52void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM);
53
54/** See llvm::createGlobalDCEPass function. */
55void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);
56
57/** See llvm::createGlobalOptimizerPass function. */
58void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);
59
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010060/** See llvm::createPruneEHPass function. */
61void LLVMAddPruneEHPass(LLVMPassManagerRef PM);
62
63/** See llvm::createIPSCCPPass function. */
64void LLVMAddIPSCCPPass(LLVMPassManagerRef PM);
65
66/** See llvm::createInternalizePass function. */
67void LLVMAddInternalizePass(LLVMPassManagerRef, unsigned AllButMain);
68
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020069/**
70 * Create and add the internalize pass to the given pass manager with the
71 * provided preservation callback.
72 *
73 * The context parameter is forwarded to the callback on each invocation.
74 * As such, it is the responsibility of the caller to extend its lifetime
75 * until execution of this pass has finished.
76 *
77 * @see llvm::createInternalizePass function.
78 */
79void LLVMAddInternalizePassWithMustPreservePredicate(
80 LLVMPassManagerRef PM,
81 void *Context,
82 LLVMBool (*MustPreserve)(LLVMValueRef, void *));
83
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010084/** See llvm::createStripDeadPrototypesPass function. */
85void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM);
86
87/** See llvm::createStripSymbolsPass function. */
88void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM);
89
90/**
91 * @}
92 */
93
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020094LLVM_C_EXTERN_C_END
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010095
96#endif