xref: /aosp_15_r20/external/llvm/include/llvm-c/Transforms/Scalar.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker /*===-- Scalar.h - Scalar Transformation Library C Interface ----*- C++ -*-===*\
2*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
3*9880d681SAndroid Build Coastguard Worker |*                     The LLVM Compiler Infrastructure                       *|
4*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
5*9880d681SAndroid Build Coastguard Worker |* This file is distributed under the University of Illinois Open Source      *|
6*9880d681SAndroid Build Coastguard Worker |* License. See LICENSE.TXT for details.                                      *|
7*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
8*9880d681SAndroid Build Coastguard Worker |*===----------------------------------------------------------------------===*|
9*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
10*9880d681SAndroid Build Coastguard Worker |* This header declares the C interface to libLLVMScalarOpts.a, which         *|
11*9880d681SAndroid Build Coastguard Worker |* implements various scalar transformations of the LLVM IR.                  *|
12*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
13*9880d681SAndroid Build Coastguard Worker |* Many exotic languages can interoperate with C code but have a harder time  *|
14*9880d681SAndroid Build Coastguard Worker |* with C++ due to name mangling. So in addition to C, this interface enables *|
15*9880d681SAndroid Build Coastguard Worker |* tools written in such languages.                                           *|
16*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
17*9880d681SAndroid Build Coastguard Worker \*===----------------------------------------------------------------------===*/
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_C_TRANSFORMS_SCALAR_H
20*9880d681SAndroid Build Coastguard Worker #define LLVM_C_TRANSFORMS_SCALAR_H
21*9880d681SAndroid Build Coastguard Worker 
22*9880d681SAndroid Build Coastguard Worker #include "llvm-c/Types.h"
23*9880d681SAndroid Build Coastguard Worker 
24*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus
25*9880d681SAndroid Build Coastguard Worker extern "C" {
26*9880d681SAndroid Build Coastguard Worker #endif
27*9880d681SAndroid Build Coastguard Worker 
28*9880d681SAndroid Build Coastguard Worker /**
29*9880d681SAndroid Build Coastguard Worker  * @defgroup LLVMCTransformsScalar Scalar transformations
30*9880d681SAndroid Build Coastguard Worker  * @ingroup LLVMCTransforms
31*9880d681SAndroid Build Coastguard Worker  *
32*9880d681SAndroid Build Coastguard Worker  * @{
33*9880d681SAndroid Build Coastguard Worker  */
34*9880d681SAndroid Build Coastguard Worker 
35*9880d681SAndroid Build Coastguard Worker /** See llvm::createAggressiveDCEPass function. */
36*9880d681SAndroid Build Coastguard Worker void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
37*9880d681SAndroid Build Coastguard Worker 
38*9880d681SAndroid Build Coastguard Worker /** See llvm::createBitTrackingDCEPass function. */
39*9880d681SAndroid Build Coastguard Worker void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM);
40*9880d681SAndroid Build Coastguard Worker 
41*9880d681SAndroid Build Coastguard Worker /** See llvm::createAlignmentFromAssumptionsPass function. */
42*9880d681SAndroid Build Coastguard Worker void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);
43*9880d681SAndroid Build Coastguard Worker 
44*9880d681SAndroid Build Coastguard Worker /** See llvm::createCFGSimplificationPass function. */
45*9880d681SAndroid Build Coastguard Worker void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
46*9880d681SAndroid Build Coastguard Worker 
47*9880d681SAndroid Build Coastguard Worker /** See llvm::createDeadStoreEliminationPass function. */
48*9880d681SAndroid Build Coastguard Worker void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);
49*9880d681SAndroid Build Coastguard Worker 
50*9880d681SAndroid Build Coastguard Worker /** See llvm::createScalarizerPass function. */
51*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarizerPass(LLVMPassManagerRef PM);
52*9880d681SAndroid Build Coastguard Worker 
53*9880d681SAndroid Build Coastguard Worker /** See llvm::createMergedLoadStoreMotionPass function. */
54*9880d681SAndroid Build Coastguard Worker void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);
55*9880d681SAndroid Build Coastguard Worker 
56*9880d681SAndroid Build Coastguard Worker /** See llvm::createGVNPass function. */
57*9880d681SAndroid Build Coastguard Worker void LLVMAddGVNPass(LLVMPassManagerRef PM);
58*9880d681SAndroid Build Coastguard Worker 
59*9880d681SAndroid Build Coastguard Worker /** See llvm::createIndVarSimplifyPass function. */
60*9880d681SAndroid Build Coastguard Worker void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
61*9880d681SAndroid Build Coastguard Worker 
62*9880d681SAndroid Build Coastguard Worker /** See llvm::createInstructionCombiningPass function. */
63*9880d681SAndroid Build Coastguard Worker void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
64*9880d681SAndroid Build Coastguard Worker 
65*9880d681SAndroid Build Coastguard Worker /** See llvm::createJumpThreadingPass function. */
66*9880d681SAndroid Build Coastguard Worker void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
67*9880d681SAndroid Build Coastguard Worker 
68*9880d681SAndroid Build Coastguard Worker /** See llvm::createLICMPass function. */
69*9880d681SAndroid Build Coastguard Worker void LLVMAddLICMPass(LLVMPassManagerRef PM);
70*9880d681SAndroid Build Coastguard Worker 
71*9880d681SAndroid Build Coastguard Worker /** See llvm::createLoopDeletionPass function. */
72*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
73*9880d681SAndroid Build Coastguard Worker 
74*9880d681SAndroid Build Coastguard Worker /** See llvm::createLoopIdiomPass function */
75*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
76*9880d681SAndroid Build Coastguard Worker 
77*9880d681SAndroid Build Coastguard Worker /** See llvm::createLoopRotatePass function. */
78*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
79*9880d681SAndroid Build Coastguard Worker 
80*9880d681SAndroid Build Coastguard Worker /** See llvm::createLoopRerollPass function. */
81*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
82*9880d681SAndroid Build Coastguard Worker 
83*9880d681SAndroid Build Coastguard Worker /** See llvm::createLoopUnrollPass function. */
84*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
85*9880d681SAndroid Build Coastguard Worker 
86*9880d681SAndroid Build Coastguard Worker /** See llvm::createLoopUnswitchPass function. */
87*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM);
88*9880d681SAndroid Build Coastguard Worker 
89*9880d681SAndroid Build Coastguard Worker /** See llvm::createMemCpyOptPass function. */
90*9880d681SAndroid Build Coastguard Worker void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
91*9880d681SAndroid Build Coastguard Worker 
92*9880d681SAndroid Build Coastguard Worker /** See llvm::createPartiallyInlineLibCallsPass function. */
93*9880d681SAndroid Build Coastguard Worker void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
94*9880d681SAndroid Build Coastguard Worker 
95*9880d681SAndroid Build Coastguard Worker /** See llvm::createLowerSwitchPass function. */
96*9880d681SAndroid Build Coastguard Worker void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM);
97*9880d681SAndroid Build Coastguard Worker 
98*9880d681SAndroid Build Coastguard Worker /** See llvm::createPromoteMemoryToRegisterPass function. */
99*9880d681SAndroid Build Coastguard Worker void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
100*9880d681SAndroid Build Coastguard Worker 
101*9880d681SAndroid Build Coastguard Worker /** See llvm::createReassociatePass function. */
102*9880d681SAndroid Build Coastguard Worker void LLVMAddReassociatePass(LLVMPassManagerRef PM);
103*9880d681SAndroid Build Coastguard Worker 
104*9880d681SAndroid Build Coastguard Worker /** See llvm::createSCCPPass function. */
105*9880d681SAndroid Build Coastguard Worker void LLVMAddSCCPPass(LLVMPassManagerRef PM);
106*9880d681SAndroid Build Coastguard Worker 
107*9880d681SAndroid Build Coastguard Worker /** See llvm::createSROAPass function. */
108*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
109*9880d681SAndroid Build Coastguard Worker 
110*9880d681SAndroid Build Coastguard Worker /** See llvm::createSROAPass function. */
111*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);
112*9880d681SAndroid Build Coastguard Worker 
113*9880d681SAndroid Build Coastguard Worker /** See llvm::createSROAPass function. */
114*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
115*9880d681SAndroid Build Coastguard Worker                                                   int Threshold);
116*9880d681SAndroid Build Coastguard Worker 
117*9880d681SAndroid Build Coastguard Worker /** See llvm::createSimplifyLibCallsPass function. */
118*9880d681SAndroid Build Coastguard Worker void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
119*9880d681SAndroid Build Coastguard Worker 
120*9880d681SAndroid Build Coastguard Worker /** See llvm::createTailCallEliminationPass function. */
121*9880d681SAndroid Build Coastguard Worker void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
122*9880d681SAndroid Build Coastguard Worker 
123*9880d681SAndroid Build Coastguard Worker /** See llvm::createConstantPropagationPass function. */
124*9880d681SAndroid Build Coastguard Worker void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
125*9880d681SAndroid Build Coastguard Worker 
126*9880d681SAndroid Build Coastguard Worker /** See llvm::demotePromoteMemoryToRegisterPass function. */
127*9880d681SAndroid Build Coastguard Worker void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
128*9880d681SAndroid Build Coastguard Worker 
129*9880d681SAndroid Build Coastguard Worker /** See llvm::createVerifierPass function. */
130*9880d681SAndroid Build Coastguard Worker void LLVMAddVerifierPass(LLVMPassManagerRef PM);
131*9880d681SAndroid Build Coastguard Worker 
132*9880d681SAndroid Build Coastguard Worker /** See llvm::createCorrelatedValuePropagationPass function */
133*9880d681SAndroid Build Coastguard Worker void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);
134*9880d681SAndroid Build Coastguard Worker 
135*9880d681SAndroid Build Coastguard Worker /** See llvm::createEarlyCSEPass function */
136*9880d681SAndroid Build Coastguard Worker void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);
137*9880d681SAndroid Build Coastguard Worker 
138*9880d681SAndroid Build Coastguard Worker /** See llvm::createLowerExpectIntrinsicPass function */
139*9880d681SAndroid Build Coastguard Worker void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);
140*9880d681SAndroid Build Coastguard Worker 
141*9880d681SAndroid Build Coastguard Worker /** See llvm::createTypeBasedAliasAnalysisPass function */
142*9880d681SAndroid Build Coastguard Worker void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
143*9880d681SAndroid Build Coastguard Worker 
144*9880d681SAndroid Build Coastguard Worker /** See llvm::createScopedNoAliasAAPass function */
145*9880d681SAndroid Build Coastguard Worker void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM);
146*9880d681SAndroid Build Coastguard Worker 
147*9880d681SAndroid Build Coastguard Worker /** See llvm::createBasicAliasAnalysisPass function */
148*9880d681SAndroid Build Coastguard Worker void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
149*9880d681SAndroid Build Coastguard Worker 
150*9880d681SAndroid Build Coastguard Worker /**
151*9880d681SAndroid Build Coastguard Worker  * @}
152*9880d681SAndroid Build Coastguard Worker  */
153*9880d681SAndroid Build Coastguard Worker 
154*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus
155*9880d681SAndroid Build Coastguard Worker }
156*9880d681SAndroid Build Coastguard Worker #endif /* defined(__cplusplus) */
157*9880d681SAndroid Build Coastguard Worker 
158*9880d681SAndroid Build Coastguard Worker #endif
159