blob: 355e8dc299fb95cc82412c5153a3a2c64b2769e3 [file] [log] [blame]
Gordon Henriksen82a0e742008-03-16 16:32:40 +00001/*===-- Scalar.h - Scalar Transformation Library C Interface ----*- C++ -*-===*\
2|* *|
3|* The LLVM Compiler Infrastructure *|
4|* *|
5|* This file is distributed under the University of Illinois Open Source *|
6|* License. See LICENSE.TXT for details. *|
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/Core.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
Gregory Szorc34c863a2012-03-21 03:54:29 +000028/**
29 * @defgroup LLVMCTransformsScalar Scalar transformations
30 * @ingroup LLVMCTransforms
31 *
32 * @{
33 */
34
Chris Lattnere48f8972009-03-06 16:52:18 +000035/** See llvm::createAggressiveDCEPass function. */
36void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +000037
Chris Lattnere48f8972009-03-06 16:52:18 +000038/** See llvm::createCFGSimplificationPass function. */
39void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +000040
Chris Lattnere48f8972009-03-06 16:52:18 +000041/** See llvm::createDeadStoreEliminationPass function. */
42void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +000043
44/** See llvm::createGVNPass function. */
45void LLVMAddGVNPass(LLVMPassManagerRef PM);
46
Chris Lattnere48f8972009-03-06 16:52:18 +000047/** See llvm::createIndVarSimplifyPass function. */
48void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
49
50/** See llvm::createInstructionCombiningPass function. */
51void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
52
53/** See llvm::createJumpThreadingPass function. */
54void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
55
56/** See llvm::createLICMPass function. */
57void LLVMAddLICMPass(LLVMPassManagerRef PM);
58
59/** See llvm::createLoopDeletionPass function. */
60void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
61
Rafael Espindolae4e4e372011-04-07 18:20:46 +000062/** See llvm::createLoopIdiomPass function */
63void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
64
Chris Lattnere48f8972009-03-06 16:52:18 +000065/** See llvm::createLoopRotatePass function. */
66void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
67
Hal Finkelbf45efd2013-11-16 23:59:05 +000068/** See llvm::createLoopRerollPass function. */
69void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
70
Chris Lattnere48f8972009-03-06 16:52:18 +000071/** See llvm::createLoopUnrollPass function. */
72void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
73
74/** See llvm::createLoopUnswitchPass function. */
75void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM);
76
77/** See llvm::createMemCpyOptPass function. */
78void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
79
Richard Sandiford37cd6cf2013-08-23 10:27:02 +000080/** See llvm::createPartiallyInlineLibCallsPass function. */
81void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
82
Chris Lattnere48f8972009-03-06 16:52:18 +000083/** See llvm::createPromoteMemoryToRegisterPass function. */
84void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
85
86/** See llvm::createReassociatePass function. */
87void LLVMAddReassociatePass(LLVMPassManagerRef PM);
88
89/** See llvm::createSCCPPass function. */
90void LLVMAddSCCPPass(LLVMPassManagerRef PM);
91
92/** See llvm::createScalarReplAggregatesPass function. */
93void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
94
Nate Begeman5daa2352010-03-11 23:06:07 +000095/** See llvm::createScalarReplAggregatesPass function. */
Rafael Espindolae4e4e372011-04-07 18:20:46 +000096void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);
97
98/** See llvm::createScalarReplAggregatesPass function. */
Nate Begeman5daa2352010-03-11 23:06:07 +000099void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
100 int Threshold);
101
Chris Lattnere48f8972009-03-06 16:52:18 +0000102/** See llvm::createSimplifyLibCallsPass function. */
103void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
104
105/** See llvm::createTailCallEliminationPass function. */
106void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
107
108/** See llvm::createConstantPropagationPass function. */
109void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
110
111/** See llvm::demotePromoteMemoryToRegisterPass function. */
112void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +0000113
Nate Begeman5daa2352010-03-11 23:06:07 +0000114/** See llvm::createVerifierPass function. */
115void LLVMAddVerifierPass(LLVMPassManagerRef PM);
116
Rafael Espindolae4e4e372011-04-07 18:20:46 +0000117/** See llvm::createCorrelatedValuePropagationPass function */
118void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);
119
120/** See llvm::createEarlyCSEPass function */
121void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);
122
Rafael Espindola72813952011-07-25 20:57:59 +0000123/** See llvm::createLowerExpectIntrinsicPass function */
124void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);
125
Rafael Espindola6aafb642011-04-13 15:44:58 +0000126/** See llvm::createTypeBasedAliasAnalysisPass function */
127void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
128
129/** See llvm::createBasicAliasAnalysisPass function */
130void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
131
Gregory Szorc34c863a2012-03-21 03:54:29 +0000132/**
133 * @}
134 */
Rafael Espindola6aafb642011-04-13 15:44:58 +0000135
Gordon Henriksen82a0e742008-03-16 16:32:40 +0000136#ifdef __cplusplus
137}
138#endif /* defined(__cplusplus) */
139
140#endif