LLVM: lib/Passes/PassBuilderBindings.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
21
22using namespace llvm;
23
24namespace llvm {
25
26
27
42}
43
47
50
56
59
65
66
68 if (auto Err = PB.parseAAPipeline(AA, PassOpts->AAPipeline))
69 return wrap(std::move(Err));
70 FAM.registerPass([&] { return std::move(AA); });
71 }
72 PB.registerLoopAnalyses(LAM);
73 PB.registerFunctionAnalyses(FAM);
74 PB.registerCGSCCAnalyses(CGAM);
75 PB.registerModuleAnalyses(MAM);
77
80
81
86 if (auto Err = PB.parsePassPipeline(FPM, Passes))
87 return wrap(std::move(Err));
89 } else {
93 if (auto Err = PB.parsePassPipeline(MPM, Passes))
94 return wrap(std::move(Err));
96 }
97
99}
100
109
118
122
127
132
134 const char *AAPipeline) {
136}
137
140 unwrap(Options)->PTO.LoopInterleaving = LoopInterleaving;
141}
142
145 unwrap(Options)->PTO.LoopVectorization = LoopVectorization;
146}
147
150 unwrap(Options)->PTO.SLPVectorization = SLPVectorization;
151}
152
157
160 unwrap(Options)->PTO.ForgetAllSCEVInLoopUnroll = ForgetAllSCEVInLoopUnroll;
161}
162
164 unsigned LicmMssaOptCap) {
165 unwrap(Options)->PTO.LicmMssaOptCap = LicmMssaOptCap;
166}
167
170 unwrap(Options)->PTO.LicmMssaNoAccForPromotionCap =
171 LicmMssaNoAccForPromotionCap;
172}
173
176 unwrap(Options)->PTO.CallGraphProfile = CallGraphProfile;
177}
178
183
188
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
static ManagedStatic< cl::opt< bool, true >, CreateDebug > Debug
Module.h This file contains the declarations for the Module class.
CGSCCAnalysisManager CGAM
Definition PassBuilderBindings.cpp:62
Function const char TargetMachine * Machine
Definition PassBuilderBindings.cpp:52
Function const char * Passes
Definition PassBuilderBindings.cpp:51
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
Definition PassBuilderBindings.cpp:95
LoopAnalysisManager LAM
Definition PassBuilderBindings.cpp:60
FunctionAnalysisManager FAM
Definition PassBuilderBindings.cpp:61
ModuleAnalysisManager MAM
Definition PassBuilderBindings.cpp:63
bool VerifyEach
Definition PassBuilderBindings.cpp:55
PassInstrumentationCallbacks PIC
Definition PassBuilderBindings.cpp:57
Function const char TargetMachine LLVMPassBuilderOptions * PassOpts
Definition PassBuilderBindings.cpp:53
Function * Fun
Definition PassBuilderBindings.cpp:51
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
This header defines a class that provides bookkeeping for all standard (i.e in-tree) pass instrumenta...
A manager for alias analyses.
Helper struct for holding a set of builder options for LLVMRunPasses.
Definition PassBuilderBindings.cpp:28
PipelineTuningOptions PTO
Definition PassBuilderBindings.cpp:40
LLVMPassBuilderOptions(bool DebugLogging=false, bool VerifyEach=false, const char *AAPipeline=nullptr, PipelineTuningOptions PTO=PipelineTuningOptions())
Definition PassBuilderBindings.cpp:30
const char * AAPipeline
Definition PassBuilderBindings.cpp:39
bool VerifyEach
Definition PassBuilderBindings.cpp:38
bool DebugLogging
Definition PassBuilderBindings.cpp:37
A Module instance is used to store all the information related to an LLVM module.
This class provides access to building LLVM's passes.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs)
Run all of the passes in this manager over the given unit of IR.
Tunable parameters for passes in the default pipelines.
This class provides an interface to register all the standard pass instrumentations and manages their...
Primary interface to the complete machine description for the target machine.
void LLVMPassBuilderOptionsSetSLPVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization)
Definition PassBuilderBindings.cpp:148
void LLVMPassBuilderOptionsSetAAPipeline(LLVMPassBuilderOptionsRef Options, const char *AAPipeline)
Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.
Definition PassBuilderBindings.cpp:133
void LLVMPassBuilderOptionsSetLoopVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization)
Definition PassBuilderBindings.cpp:143
void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, LLVMBool DebugLogging)
Toggle debug logging when running the PassBuilder.
Definition PassBuilderBindings.cpp:128
LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions()
Create a new set of options for a PassBuilder.
Definition PassBuilderBindings.cpp:119
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options)
Dispose of a heap-allocated PassBuilderOptions instance.
Definition PassBuilderBindings.cpp:189
void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options, LLVMBool VerifyEach)
Toggle adding the VerifierPass for the PassBuilder, ensuring all functions inside the module is valid...
Definition PassBuilderBindings.cpp:123
void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll)
Definition PassBuilderBindings.cpp:158
void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, LLVMBool MergeFunctions)
Definition PassBuilderBindings.cpp:179
void LLVMPassBuilderOptionsSetLoopInterleaving(LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving)
Definition PassBuilderBindings.cpp:138
void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaOptCap)
Definition PassBuilderBindings.cpp:163
typedefLLVM_C_EXTERN_C_BEGIN struct LLVMOpaquePassBuilderOptions * LLVMPassBuilderOptionsRef
A set of options passed which are attached to the Pass Manager upon run.
LLVMErrorRef LLVMRunPassesOnFunction(LLVMValueRef F, const char *Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options)
Construct and run a set of passes over a function.
Definition PassBuilderBindings.cpp:110
void LLVMPassBuilderOptionsSetCallGraphProfile(LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile)
Definition PassBuilderBindings.cpp:174
void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options, LLVMBool LoopUnrolling)
Definition PassBuilderBindings.cpp:153
void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap)
Definition PassBuilderBindings.cpp:168
void LLVMPassBuilderOptionsSetInlinerThreshold(LLVMPassBuilderOptionsRef Options, int Threshold)
Definition PassBuilderBindings.cpp:184
LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options)
Construct and run a set of passes over a module.
Definition PassBuilderBindings.cpp:101
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Interfaces for registering analysis passes, producing common pass manager configurations,...
Abstract Attribute helper functions.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
Attribute unwrap(LLVMAttributeRef Attr)
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
LLVMAttributeRef wrap(Attribute Attr)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.