LLVM  14.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 
22 
23 /**
24  * A set of options passed which are attached to the Pass Manager upon run.
25  *
26  * This corresponds to an llvm::LLVMPassBuilderOptions instance
27  *
28  * The details for how the different properties of this structure are used can
29  * be found in the source for LLVMRunPasses
30  */
31 typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;
32 
33 /**
34  * Construct and run a set of passes over a module
35  *
36  * This function takes a string with the passes that should be used. The format
37  * of this string is the same as opt's -passes argument for the new pass
38  * manager. Individual passes may be specified, separated by commas. Full
39  * pipelines may also be invoked using `default<O3>` and friends. See opt for
40  * full reference of the Passes format.
41  */
45 
46 /**
47  * Create a new set of options for a PassBuilder
48  *
49  * Ownership of the returned instance is given to the client, and they are
50  * responsible for it. The client should call LLVMDisposePassBuilderOptions
51  * to free the pass builder options.
52  */
54 
55 /**
56  * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions
57  * inside the module is valid.
58  */
61 
62 /**
63  * Toggle debug logging when running the PassBuilder
64  */
66  LLVMBool DebugLogging);
67 
69  LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving);
70 
72  LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization);
73 
75  LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization);
76 
78  LLVMBool LoopUnrolling);
79 
81  LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll);
82 
84  unsigned LicmMssaOptCap);
85 
87  LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap);
88 
90  LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile);
91 
93  LLVMBool MergeFunctions);
94 
95 /**
96  * Dispose of a heap-allocated PassBuilderOptions instance
97  */
99 
101 
102 #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
LLVMCreatePassBuilderOptions
LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void)
Create a new set of options for a PassBuilder.
Definition: PassBuilderBindings.cpp:82
Types.h
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
Passes
const char * Passes
Definition: PassBuilderBindings.cpp:46
LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll
void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll)
Definition: PassBuilderBindings.cpp:116
LLVMPassBuilderOptionsSetDebugLogging
void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, LLVMBool DebugLogging)
Toggle debug logging when running the PassBuilder.
Definition: PassBuilderBindings.cpp:91
LLVMPassBuilderOptionsSetSLPVectorization
void LLVMPassBuilderOptionsSetSLPVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization)
Definition: PassBuilderBindings.cpp:106
LLVMPassBuilderOptionsSetLicmMssaOptCap
void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaOptCap)
Definition: PassBuilderBindings.cpp:121
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
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:31
LLVMRunPasses
LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options)
Construct and run a set of passes over a module.
LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap
void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap)
Definition: PassBuilderBindings.cpp:126
LLVMTargetMachineRef
typedefLLVM_C_EXTERN_C_BEGIN struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:28
LLVMPassBuilderOptionsSetLoopVectorization
void LLVMPassBuilderOptionsSetLoopVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization)
Definition: PassBuilderBindings.cpp:101
LLVMPassBuilderOptionsSetLoopInterleaving
void LLVMPassBuilderOptionsSetLoopInterleaving(LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving)
Definition: PassBuilderBindings.cpp:96
VerifyEach
bool VerifyEach
Definition: PassBuilderBindings.cpp:52
LLVMDisposePassBuilderOptions
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options)
Dispose of a heap-allocated PassBuilderOptions instance.
Definition: PassBuilderBindings.cpp:142
LLVM_C_EXTERN_C_END
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
Error.h
LLVMBool
int LLVMBool
Definition: Types.h:28
LLVMErrorRef
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
Definition: Error.h:26
TargetMachine.h
LLVM_C_EXTERN_C_BEGIN
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
LLVMPassBuilderOptionsSetCallGraphProfile
void LLVMPassBuilderOptionsSetCallGraphProfile(LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile)
Definition: PassBuilderBindings.cpp:132
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
LLVMPassBuilderOptionsSetMergeFunctions
void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, LLVMBool MergeFunctions)
Definition: PassBuilderBindings.cpp:137
LLVMModuleRef
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
LLVMPassBuilderOptionsSetLoopUnrolling
void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options, LLVMBool LoopUnrolling)
Definition: PassBuilderBindings.cpp:111