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 \*===----------------------------------------------------------------------===*/ 18 19 #ifndef LLVM_C_TRANSFORMS_SCALAR_H 20 #define LLVM_C_TRANSFORMS_SCALAR_H 21 22 #include "llvm-c/ExternC.h" 23 #include "llvm-c/Types.h" 24 25 LLVM_C_EXTERN_C_BEGIN 26 27 /** 28 * @defgroup LLVMCTransformsScalar Scalar transformations 29 * @ingroup LLVMCTransforms 30 * 31 * @{ 32 */ 33 34 /** See llvm::createAggressiveDCEPass function. */ 35 void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM); 36 37 /** See llvm::createDeadCodeEliminationPass function. */ 38 void LLVMAddDCEPass(LLVMPassManagerRef PM); 39 40 /** See llvm::createBitTrackingDCEPass function. */ 41 void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM); 42 43 /** See llvm::createAlignmentFromAssumptionsPass function. */ 44 void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM); 45 46 /** See llvm::createCFGSimplificationPass function. */ 47 void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM); 48 49 /** See llvm::createDeadStoreEliminationPass function. */ 50 void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM); 51 52 /** See llvm::createScalarizerPass function. */ 53 void LLVMAddScalarizerPass(LLVMPassManagerRef PM); 54 55 /** See llvm::createMergedLoadStoreMotionPass function. */ 56 void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM); 57 58 /** See llvm::createGVNPass function. */ 59 void LLVMAddGVNPass(LLVMPassManagerRef PM); 60 61 /** See llvm::createGVNPass function. */ 62 void LLVMAddNewGVNPass(LLVMPassManagerRef PM); 63 64 /** See llvm::createIndVarSimplifyPass function. */ 65 void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM); 66 67 /** See llvm::createInstructionCombiningPass function. */ 68 void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM); 69 70 /** See llvm::createInstSimplifyLegacyPass function. */ 71 void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM); 72 73 /** See llvm::createJumpThreadingPass function. */ 74 void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM); 75 76 /** See llvm::createLICMPass function. */ 77 void LLVMAddLICMPass(LLVMPassManagerRef PM); 78 79 /** See llvm::createLoopDeletionPass function. */ 80 void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM); 81 82 /** See llvm::createLoopIdiomPass function */ 83 void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM); 84 85 /** See llvm::createLoopRotatePass function. */ 86 void LLVMAddLoopRotatePass(LLVMPassManagerRef PM); 87 88 /** See llvm::createLoopRerollPass function. */ 89 void LLVMAddLoopRerollPass(LLVMPassManagerRef PM); 90 91 /** See llvm::createLoopUnrollPass function. */ 92 void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM); 93 94 /** See llvm::createLoopUnrollAndJamPass function. */ 95 void LLVMAddLoopUnrollAndJamPass(LLVMPassManagerRef PM); 96 97 /** See llvm::createLoopUnswitchPass function. */ 98 void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM); 99 100 /** See llvm::createLowerAtomicPass function. */ 101 void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM); 102 103 /** See llvm::createMemCpyOptPass function. */ 104 void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM); 105 106 /** See llvm::createPartiallyInlineLibCallsPass function. */ 107 void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM); 108 109 /** See llvm::createReassociatePass function. */ 110 void LLVMAddReassociatePass(LLVMPassManagerRef PM); 111 112 /** See llvm::createSCCPPass function. */ 113 void LLVMAddSCCPPass(LLVMPassManagerRef PM); 114 115 /** See llvm::createSROAPass function. */ 116 void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM); 117 118 /** See llvm::createSROAPass function. */ 119 void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM); 120 121 /** See llvm::createSROAPass function. */ 122 void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM, 123 int Threshold); 124 125 /** See llvm::createSimplifyLibCallsPass function. */ 126 void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM); 127 128 /** See llvm::createTailCallEliminationPass function. */ 129 void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM); 130 131 /** See llvm::demotePromoteMemoryToRegisterPass function. */ 132 void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM); 133 134 /** See llvm::createVerifierPass function. */ 135 void LLVMAddVerifierPass(LLVMPassManagerRef PM); 136 137 /** See llvm::createCorrelatedValuePropagationPass function */ 138 void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM); 139 140 /** See llvm::createEarlyCSEPass function */ 141 void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM); 142 143 /** See llvm::createEarlyCSEPass function */ 144 void LLVMAddEarlyCSEMemSSAPass(LLVMPassManagerRef PM); 145 146 /** See llvm::createLowerExpectIntrinsicPass function */ 147 void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM); 148 149 /** See llvm::createLowerConstantIntrinsicsPass function */ 150 void LLVMAddLowerConstantIntrinsicsPass(LLVMPassManagerRef PM); 151 152 /** See llvm::createTypeBasedAliasAnalysisPass function */ 153 void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM); 154 155 /** See llvm::createScopedNoAliasAAPass function */ 156 void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM); 157 158 /** See llvm::createBasicAliasAnalysisPass function */ 159 void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM); 160 161 /** See llvm::createUnifyFunctionExitNodesPass function */ 162 void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM); 163 164 /** 165 * @} 166 */ 167 168 LLVM_C_EXTERN_C_END 169 170 #endif 171