[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / include / llvm-c / Transforms / Scalar.h
blobba142508bbe4457a2605963e938fc4b1b6eceb9e
1 /*===-- Scalar.h - Scalar Transformation Library C Interface ----*- C++ -*-===*\
2 |* *|
3 |* 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 *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header declares the C interface to libLLVMScalarOpts.a, which *|
11 |* implements various scalar transformations of the LLVM IR. *|
12 |* *|
13 |* Many exotic languages can interoperate with C code but have a harder time *|
14 |* with C++ due to name mangling. So in addition to C, this interface enables *|
15 |* tools written in such languages. *|
16 |* *|
17 \*===----------------------------------------------------------------------===*/
19 #ifndef LLVM_C_TRANSFORMS_SCALAR_H
20 #define LLVM_C_TRANSFORMS_SCALAR_H
22 #include "llvm-c/ExternC.h"
23 #include "llvm-c/Types.h"
25 LLVM_C_EXTERN_C_BEGIN
27 /**
28 * @defgroup LLVMCTransformsScalar Scalar transformations
29 * @ingroup LLVMCTransforms
31 * @{
34 /** See llvm::createAggressiveDCEPass function. */
35 void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
37 /** See llvm::createDeadCodeEliminationPass function. */
38 void LLVMAddDCEPass(LLVMPassManagerRef PM);
40 /** See llvm::createBitTrackingDCEPass function. */
41 void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM);
43 /** See llvm::createAlignmentFromAssumptionsPass function. */
44 void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);
46 /** See llvm::createCFGSimplificationPass function. */
47 void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
49 /** See llvm::createDeadStoreEliminationPass function. */
50 void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);
52 /** See llvm::createScalarizerPass function. */
53 void LLVMAddScalarizerPass(LLVMPassManagerRef PM);
55 /** See llvm::createMergedLoadStoreMotionPass function. */
56 void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);
58 /** See llvm::createGVNPass function. */
59 void LLVMAddGVNPass(LLVMPassManagerRef PM);
61 /** See llvm::createGVNPass function. */
62 void LLVMAddNewGVNPass(LLVMPassManagerRef PM);
64 /** See llvm::createIndVarSimplifyPass function. */
65 void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
67 /** See llvm::createInstructionCombiningPass function. */
68 void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
70 /** See llvm::createInstSimplifyLegacyPass function. */
71 void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM);
73 /** See llvm::createJumpThreadingPass function. */
74 void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
76 /** See llvm::createLICMPass function. */
77 void LLVMAddLICMPass(LLVMPassManagerRef PM);
79 /** See llvm::createLoopDeletionPass function. */
80 void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
82 /** See llvm::createLoopIdiomPass function */
83 void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
85 /** See llvm::createLoopRotatePass function. */
86 void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
88 /** See llvm::createLoopRerollPass function. */
89 void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
91 /** See llvm::createLoopUnrollPass function. */
92 void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
94 /** See llvm::createLoopUnrollAndJamPass function. */
95 void LLVMAddLoopUnrollAndJamPass(LLVMPassManagerRef PM);
97 /** See llvm::createLoopUnswitchPass function. */
98 void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM);
100 /** See llvm::createLowerAtomicPass function. */
101 void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);
103 /** See llvm::createMemCpyOptPass function. */
104 void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
106 /** See llvm::createPartiallyInlineLibCallsPass function. */
107 void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
109 /** See llvm::createReassociatePass function. */
110 void LLVMAddReassociatePass(LLVMPassManagerRef PM);
112 /** See llvm::createSCCPPass function. */
113 void LLVMAddSCCPPass(LLVMPassManagerRef PM);
115 /** See llvm::createSROAPass function. */
116 void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
118 /** See llvm::createSROAPass function. */
119 void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);
121 /** See llvm::createSROAPass function. */
122 void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
123 int Threshold);
125 /** See llvm::createSimplifyLibCallsPass function. */
126 void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
128 /** See llvm::createTailCallEliminationPass function. */
129 void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
131 /** See llvm::demotePromoteMemoryToRegisterPass function. */
132 void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
134 /** See llvm::createVerifierPass function. */
135 void LLVMAddVerifierPass(LLVMPassManagerRef PM);
137 /** See llvm::createCorrelatedValuePropagationPass function */
138 void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);
140 /** See llvm::createEarlyCSEPass function */
141 void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);
143 /** See llvm::createEarlyCSEPass function */
144 void LLVMAddEarlyCSEMemSSAPass(LLVMPassManagerRef PM);
146 /** See llvm::createLowerExpectIntrinsicPass function */
147 void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);
149 /** See llvm::createLowerConstantIntrinsicsPass function */
150 void LLVMAddLowerConstantIntrinsicsPass(LLVMPassManagerRef PM);
152 /** See llvm::createTypeBasedAliasAnalysisPass function */
153 void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
155 /** See llvm::createScopedNoAliasAAPass function */
156 void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM);
158 /** See llvm::createBasicAliasAnalysisPass function */
159 void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
161 /** See llvm::createUnifyFunctionExitNodesPass function */
162 void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM);
165 * @}
168 LLVM_C_EXTERN_C_END
170 #endif