LLVM  15.0.0git
PassBuilder.h
Go to the documentation of this file.
1 /*===-- llvm-c/Transform/PassBuilder.h - PassBuilder for LLVM C ---*- 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 contains the LLVM-C interface into the new pass manager *|
11 |* *|
12 \*===----------------------------------------------------------------------===*/
13 
14 #ifndef LLVM_C_TRANSFORMS_PASSBUILDER_H
15 #define LLVM_C_TRANSFORMS_PASSBUILDER_H
16 
17 #include "llvm-c/Error.h"
18 #include "llvm-c/TargetMachine.h"
19 #include "llvm-c/Types.h"
20 
21 /**
22  * @defgroup LLVMCCoreNewPM New Pass Manager
23  * @ingroup LLVMCCore
24  *
25  * @{
26  */
27 
29 
30 /**
31  * A set of options passed which are attached to the Pass Manager upon run.
32  *
33  * This corresponds to an llvm::LLVMPassBuilderOptions instance
34  *
35  * The details for how the different properties of this structure are used can
36  * be found in the source for LLVMRunPasses
37  */
38 typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;
39 
40 /**
41  * Construct and run a set of passes over a module
42  *
43  * This function takes a string with the passes that should be used. The format
44  * of this string is the same as opt's -passes argument for the new pass
45  * manager. Individual passes may be specified, separated by commas. Full
46  * pipelines may also be invoked using `default<O3>` and friends. See opt for
47  * full reference of the Passes format.
48  */
52 
53 /**
54  * Create a new set of options for a PassBuilder
55  *
56  * Ownership of the returned instance is given to the client, and they are
57  * responsible for it. The client should call LLVMDisposePassBuilderOptions
58  * to free the pass builder options.
59  */
61 
62 /**
63  * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions
64  * inside the module is valid.
65  */
68 
69 /**
70  * Toggle debug logging when running the PassBuilder
71  */
73  LLVMBool DebugLogging);
74 
76  LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving);
77 
79  LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization);
80 
82  LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization);
83 
85  LLVMBool LoopUnrolling);
86 
88  LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll);
89 
91  unsigned LicmMssaOptCap);
92 
94  LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap);
95 
97  LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile);
98 
100  LLVMBool MergeFunctions);
101 
102 /**
103  * Dispose of a heap-allocated PassBuilderOptions instance
104  */
106 
107 /**
108  * @}
109  */
110 
112 
113 #endif // LLVM_C_TRANSFORMS_PASSBUILDER_H
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap
void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap)
Definition: PassBuilderBindings.cpp:126
Types.h
Passes
const char * Passes
Definition: PassBuilderBindings.cpp:46
LLVMPassBuilderOptionsRef
typedefLLVM_C_EXTERN_C_BEGIN struct LLVMOpaquePassBuilderOptions * LLVMPassBuilderOptionsRef
A set of options passed which are attached to the Pass Manager upon run.
Definition: PassBuilder.h:38
LLVMPassBuilderOptionsSetDebugLogging
void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, LLVMBool DebugLogging)
Toggle debug logging when running the PassBuilder.
Definition: PassBuilderBindings.cpp:91
LLVMRunPasses
LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options)
Construct and run a set of passes over a module.
LLVMPassBuilderOptionsSetLoopVectorization
void LLVMPassBuilderOptionsSetLoopVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization)
Definition: PassBuilderBindings.cpp:101
LLVMCreatePassBuilderOptions
LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void)
Create a new set of options for a PassBuilder.
Definition: PassBuilderBindings.cpp:82
LLVMPassBuilderOptionsSetLicmMssaOptCap
void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaOptCap)
Definition: PassBuilderBindings.cpp:121
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
LLVMPassBuilderOptionsSetVerifyEach
void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options, LLVMBool VerifyEach)
Toggle adding the VerifierPass for the PassBuilder, ensuring all functions inside the module is valid...
Definition: PassBuilderBindings.cpp:86
LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll
void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll)
Definition: PassBuilderBindings.cpp:116
LLVMDisposePassBuilderOptions
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options)
Dispose of a heap-allocated PassBuilderOptions instance.
Definition: PassBuilderBindings.cpp:142
VerifyEach
bool VerifyEach
Definition: PassBuilderBindings.cpp:52
LLVM_C_EXTERN_C_END
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
Error.h
LLVMBool
int LLVMBool
Definition: Types.h:28
TargetMachine.h
LLVMPassBuilderOptionsSetLoopUnrolling
void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options, LLVMBool LoopUnrolling)
Definition: PassBuilderBindings.cpp:111
LLVM_C_EXTERN_C_BEGIN
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
LLVMPassBuilderOptionsSetMergeFunctions
void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, LLVMBool MergeFunctions)
Definition: PassBuilderBindings.cpp:137
LLVMPassBuilderOptionsSetLoopInterleaving
void LLVMPassBuilderOptionsSetLoopInterleaving(LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving)
Definition: PassBuilderBindings.cpp:96
LLVMErrorRef
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
Definition: Error.h:33
LLVMPassBuilderOptionsSetSLPVectorization
void LLVMPassBuilderOptionsSetSLPVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization)
Definition: PassBuilderBindings.cpp:106
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
LLVMTargetMachineRef
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:34
LLVMModuleRef
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
LLVMPassBuilderOptionsSetCallGraphProfile
void LLVMPassBuilderOptionsSetCallGraphProfile(LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile)
Definition: PassBuilderBindings.cpp:132