blob: 7ad1ad1d05640070d09c105d4e79bd1b76617215 [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
Hal Finkeld67e4632014-09-07 20:05:11 +000038/** See llvm::createAlignmentFromAssumptionsPass function. */
39void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);
40
Chris Lattnere48f8972009-03-06 16:52:18 +000041/** See llvm::createCFGSimplificationPass function. */
42void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +000043
Chris Lattnere48f8972009-03-06 16:52:18 +000044/** See llvm::createDeadStoreEliminationPass function. */
45void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +000046
Richard Sandiford8ee1b772013-11-22 16:58:05 +000047/** See llvm::createScalarizerPass function. */
48void LLVMAddScalarizerPass(LLVMPassManagerRef PM);
49
Gerolf Hoflehnerf27ae6c2014-07-18 19:13:09 +000050/** See llvm::createMergedLoadStoreMotionPass function. */
51void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);
52
Gordon Henriksen82a0e742008-03-16 16:32:40 +000053/** See llvm::createGVNPass function. */
54void LLVMAddGVNPass(LLVMPassManagerRef PM);
55
Chris Lattnere48f8972009-03-06 16:52:18 +000056/** See llvm::createIndVarSimplifyPass function. */
57void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
58
59/** See llvm::createInstructionCombiningPass function. */
60void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
61
62/** See llvm::createJumpThreadingPass function. */
63void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
64
65/** See llvm::createLICMPass function. */
66void LLVMAddLICMPass(LLVMPassManagerRef PM);
67
68/** See llvm::createLoopDeletionPass function. */
69void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
70
Rafael Espindolae4e4e372011-04-07 18:20:46 +000071/** See llvm::createLoopIdiomPass function */
72void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
73
Chris Lattnere48f8972009-03-06 16:52:18 +000074/** See llvm::createLoopRotatePass function. */
75void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
76
Hal Finkelbf45efd2013-11-16 23:59:05 +000077/** See llvm::createLoopRerollPass function. */
78void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
79
Chris Lattnere48f8972009-03-06 16:52:18 +000080/** See llvm::createLoopUnrollPass function. */
81void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
82
83/** See llvm::createLoopUnswitchPass function. */
84void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM);
85
86/** See llvm::createMemCpyOptPass function. */
87void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
88
Richard Sandiford37cd6cf2013-08-23 10:27:02 +000089/** See llvm::createPartiallyInlineLibCallsPass function. */
90void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
91
Juergen Ributzka14ae6042014-09-11 21:32:32 +000092/** See llvm::createLowerSwitchPass function. */
93void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM);
94
Chris Lattnere48f8972009-03-06 16:52:18 +000095/** See llvm::createPromoteMemoryToRegisterPass function. */
96void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
97
98/** See llvm::createReassociatePass function. */
99void LLVMAddReassociatePass(LLVMPassManagerRef PM);
100
101/** See llvm::createSCCPPass function. */
102void LLVMAddSCCPPass(LLVMPassManagerRef PM);
103
104/** See llvm::createScalarReplAggregatesPass function. */
105void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
106
Nate Begeman5daa2352010-03-11 23:06:07 +0000107/** See llvm::createScalarReplAggregatesPass function. */
Rafael Espindolae4e4e372011-04-07 18:20:46 +0000108void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);
109
110/** See llvm::createScalarReplAggregatesPass function. */
Nate Begeman5daa2352010-03-11 23:06:07 +0000111void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
112 int Threshold);
113
Chris Lattnere48f8972009-03-06 16:52:18 +0000114/** See llvm::createSimplifyLibCallsPass function. */
115void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
116
117/** See llvm::createTailCallEliminationPass function. */
118void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
119
120/** See llvm::createConstantPropagationPass function. */
121void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
122
123/** See llvm::demotePromoteMemoryToRegisterPass function. */
124void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
Gordon Henriksen82a0e742008-03-16 16:32:40 +0000125
Nate Begeman5daa2352010-03-11 23:06:07 +0000126/** See llvm::createVerifierPass function. */
127void LLVMAddVerifierPass(LLVMPassManagerRef PM);
128
Rafael Espindolae4e4e372011-04-07 18:20:46 +0000129/** See llvm::createCorrelatedValuePropagationPass function */
130void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);
131
132/** See llvm::createEarlyCSEPass function */
133void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);
134
Rafael Espindola72813952011-07-25 20:57:59 +0000135/** See llvm::createLowerExpectIntrinsicPass function */
136void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);
137
Rafael Espindola6aafb642011-04-13 15:44:58 +0000138/** See llvm::createTypeBasedAliasAnalysisPass function */
139void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
140
Hal Finkel94146652014-07-24 14:25:39 +0000141/** See llvm::createScopedNoAliasAAPass function */
142void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM);
143
Rafael Espindola6aafb642011-04-13 15:44:58 +0000144/** See llvm::createBasicAliasAnalysisPass function */
145void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
146
Gregory Szorc34c863a2012-03-21 03:54:29 +0000147/**
148 * @}
149 */
Rafael Espindola6aafb642011-04-13 15:44:58 +0000150
Gordon Henriksen82a0e742008-03-16 16:32:40 +0000151#ifdef __cplusplus
152}
153#endif /* defined(__cplusplus) */
154
155#endif