1 //===- PassRegistry.def
- Registry of passes
--------------------*- C
++ -*-===//
3 // Part of the LLVM Project
, under the Apache License v2.0 with LLVM Exceptions.
4 // See https
://llvm.org
/LICENSE.txt for license information.
5 // SPDX
-License
-Identifier
: Apache
-2.0 WITH LLVM
-exception
7 //===----------------------------------------------------------------------===//
9 // This file is used as the registry of passes that are part of the core LLVM
10 // libraries. This file describes both transformation passes and analyses
11 // Analyses are registered while transformation passes have names registered
12 // that can be used when providing a textual pass pipeline.
14 //===----------------------------------------------------------------------===//
16 // NOTE
: NO INCLUDE GUARD DESIRED
!
18 #ifndef MODULE_ANALYSIS
19 #define
MODULE_ANALYSIS(NAME
, CREATE_PASS
)
21 MODULE_ANALYSIS("callgraph", CallGraphAnalysis())
22 MODULE_ANALYSIS("lcg", LazyCallGraphAnalysis())
23 MODULE_ANALYSIS("module-summary", ModuleSummaryIndexAnalysis())
24 MODULE_ANALYSIS("no-op-module", NoOpModuleAnalysis())
25 MODULE_ANALYSIS("profile-summary", ProfileSummaryAnalysis())
26 MODULE_ANALYSIS("stack-safety", StackSafetyGlobalAnalysis())
27 MODULE_ANALYSIS("verify", VerifierAnalysis())
28 MODULE_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
29 MODULE_ANALYSIS("inline-advisor", InlineAdvisorAnalysis())
30 MODULE_ANALYSIS("ir-similarity", IRSimilarityAnalysis())
32 #ifndef MODULE_ALIAS_ANALYSIS
33 #define
MODULE_ALIAS_ANALYSIS(NAME
, CREATE_PASS
) \
34 MODULE_ANALYSIS(NAME
, CREATE_PASS
)
36 MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA())
37 #undef MODULE_ALIAS_ANALYSIS
38 #undef MODULE_ANALYSIS
41 #define
MODULE_PASS(NAME
, CREATE_PASS
)
43 MODULE_PASS("always-inline", AlwaysInlinerPass())
44 MODULE_PASS("attributor", AttributorPass())
45 MODULE_PASS("attributor-light", AttributorLightPass())
46 MODULE_PASS("annotation2metadata", Annotation2MetadataPass())
47 MODULE_PASS("openmp-opt", OpenMPOptPass())
48 MODULE_PASS("openmp-opt-postlink", OpenMPOptPass(ThinOrFullLTOPhase
::FullLTOPostLink
))
49 MODULE_PASS("called-value-propagation", CalledValuePropagationPass())
50 MODULE_PASS("canonicalize-aliases", CanonicalizeAliasesPass())
51 MODULE_PASS("cg-profile", CGProfilePass())
52 MODULE_PASS("check-debugify", NewPMCheckDebugifyPass())
53 MODULE_PASS("constmerge", ConstantMergePass())
54 MODULE_PASS("coro-early", CoroEarlyPass())
55 MODULE_PASS("coro-cleanup", CoroCleanupPass())
56 MODULE_PASS("cross-dso-cfi", CrossDSOCFIPass())
57 MODULE_PASS("deadargelim", DeadArgumentEliminationPass())
58 MODULE_PASS("debugify", NewPMDebugifyPass())
59 MODULE_PASS("dot-callgraph", CallGraphDOTPrinterPass())
60 MODULE_PASS("dxil-upgrade", DXILUpgradePass())
61 MODULE_PASS("elim-avail-extern", EliminateAvailableExternallyPass())
62 MODULE_PASS("extract-blocks", BlockExtractorPass({}, false
))
63 MODULE_PASS("forceattrs", ForceFunctionAttrsPass())
64 MODULE_PASS("function-import", FunctionImportPass())
65 MODULE_PASS("globalopt", GlobalOptPass())
66 MODULE_PASS("globalsplit", GlobalSplitPass())
67 MODULE_PASS("hipstdpar-select-accelerator-code",
68 HipStdParAcceleratorCodeSelectionPass())
69 MODULE_PASS("hipstdpar-interpose-alloc", HipStdParAllocationInterpositionPass())
70 MODULE_PASS("hotcoldsplit", HotColdSplittingPass())
71 MODULE_PASS("inferattrs", InferFunctionAttrsPass())
72 MODULE_PASS("inliner-wrapper", ModuleInlinerWrapperPass())
73 MODULE_PASS("inliner-ml-advisor-release", ModuleInlinerWrapperPass(getInlineParams(), true
, {}, InliningAdvisorMode
::Release
, 0))
74 MODULE_PASS("print<inline-advisor>", InlineAdvisorAnalysisPrinterPass(dbgs()))
75 MODULE_PASS("inliner-wrapper-no-mandatory-first", ModuleInlinerWrapperPass(
78 MODULE_PASS("insert-gcov-profiling", GCOVProfilerPass())
79 MODULE_PASS("instrorderfile", InstrOrderFilePass())
80 MODULE_PASS("instrprof", InstrProfiling())
81 MODULE_PASS("internalize", InternalizePass())
82 MODULE_PASS("invalidate<all>", InvalidateAllAnalysesPass())
83 MODULE_PASS("iroutliner", IROutlinerPass())
84 MODULE_PASS("print-ir-similarity", IRSimilarityAnalysisPrinterPass(dbgs()))
85 MODULE_PASS("lower-global-dtors", LowerGlobalDtorsPass())
86 MODULE_PASS("lower-ifunc", LowerIFuncPass())
87 MODULE_PASS("lowertypetests", LowerTypeTestsPass())
88 MODULE_PASS("metarenamer", MetaRenamerPass())
89 MODULE_PASS("mergefunc", MergeFunctionsPass())
90 MODULE_PASS("name-anon-globals", NameAnonGlobalPass())
91 MODULE_PASS("no-op-module", NoOpModulePass())
92 MODULE_PASS("objc-arc-apelim", ObjCARCAPElimPass())
93 MODULE_PASS("partial-inliner", PartialInlinerPass())
94 MODULE_PASS("memprof-context-disambiguation", MemProfContextDisambiguation())
95 MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion())
96 MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen())
97 MODULE_PASS("pgo-instr-use", PGOInstrumentationUse())
98 MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs()))
99 MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs()))
100 MODULE_PASS("print-callgraph-sccs", CallGraphSCCsPrinterPass(dbgs()))
101 MODULE_PASS("print", PrintModulePass(dbgs()))
102 MODULE_PASS("print-lcg", LazyCallGraphPrinterPass(dbgs()))
103 MODULE_PASS("print-lcg-dot", LazyCallGraphDOTPrinterPass(dbgs()))
104 MODULE_PASS("print-must-be-executed-contexts", MustBeExecutedContextPrinterPass(dbgs()))
105 MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs()))
106 MODULE_PASS("print<module-debuginfo>", ModuleDebugInfoPrinterPass(dbgs()))
107 MODULE_PASS("recompute-globalsaa", RecomputeGlobalsAAPass())
108 MODULE_PASS("rel-lookup-table-converter", RelLookupTableConverterPass())
109 MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC())
110 MODULE_PASS("rewrite-symbols", RewriteSymbolPass())
111 MODULE_PASS("rpo-function-attrs", ReversePostOrderFunctionAttrsPass())
112 MODULE_PASS("sample-profile", SampleProfileLoaderPass())
113 MODULE_PASS("scc-oz-module-inliner",
114 buildInlinerPipeline(OptimizationLevel
::Oz
, ThinOrFullLTOPhase
::None
))
115 MODULE_PASS("strip", StripSymbolsPass())
116 MODULE_PASS("strip-dead-debug-info", StripDeadDebugInfoPass())
117 MODULE_PASS("pseudo-probe", SampleProfileProbePass(TM
))
118 MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
119 MODULE_PASS("strip-debug-declare", StripDebugDeclarePass())
120 MODULE_PASS("strip-nondebug", StripNonDebugSymbolsPass())
121 MODULE_PASS("strip-nonlinetable-debuginfo", StripNonLineTableDebugInfoPass())
122 MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation())
123 MODULE_PASS("trigger-crash", TriggerCrashPass())
124 MODULE_PASS("verify", VerifierPass())
125 MODULE_PASS("view-callgraph", CallGraphViewerPass())
126 MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass())
127 MODULE_PASS("dfsan", DataFlowSanitizerPass())
128 MODULE_PASS("module-inline", ModuleInlinerPass())
129 MODULE_PASS("tsan-module", ModuleThreadSanitizerPass())
130 MODULE_PASS("sancov-module", SanitizerCoveragePass())
131 MODULE_PASS("sanmd-module", SanitizerBinaryMetadataPass())
132 MODULE_PASS("memprof-module", ModuleMemProfilerPass())
133 MODULE_PASS("poison-checking", PoisonCheckingPass())
134 MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass())
137 #ifndef MODULE_PASS_WITH_PARAMS
138 #define
MODULE_PASS_WITH_PARAMS(NAME
, CLASS
, CREATE_PASS
, PARSER
, PARAMS
)
140 MODULE_PASS_WITH_PARAMS("loop-extract",
144 return
LoopExtractorPass(1);
145 return
LoopExtractorPass();
147 parseLoopExtractorPassOptions
,
149 MODULE_PASS_WITH_PARAMS("globaldce",
151 [](bool InLTOPostLink
) {
152 return
GlobalDCEPass(InLTOPostLink
);
154 parseGlobalDCEPassOptions
,
156 MODULE_PASS_WITH_PARAMS("hwasan",
157 "HWAddressSanitizerPass",
158 [](HWAddressSanitizerOptions Opts
) {
159 return
HWAddressSanitizerPass(Opts
);
161 parseHWASanPassOptions
,
163 MODULE_PASS_WITH_PARAMS("asan",
164 "AddressSanitizerPass",
165 [](AddressSanitizerOptions Opts
) {
166 return
AddressSanitizerPass(Opts
);
168 parseASanPassOptions
,
170 MODULE_PASS_WITH_PARAMS("msan",
171 "MemorySanitizerPass",
172 [](MemorySanitizerOptions Opts
) {
173 return
MemorySanitizerPass(Opts
);
175 parseMSanPassOptions
,
176 "recover;kernel;eager-checks;track-origins=N")
177 MODULE_PASS_WITH_PARAMS("ipsccp",
179 [](IPSCCPOptions Opts
) {
180 return
IPSCCPPass(Opts
);
183 "no-func-spec;func-spec")
184 MODULE_PASS_WITH_PARAMS("embed-bitcode",
186 [](EmbedBitcodeOptions Opts
) {
187 return
EmbedBitcodePass(Opts
);
189 parseEmbedBitcodePassOptions
,
190 "thinlto;emit-summary")
191 MODULE_PASS_WITH_PARAMS("memprof-use",
193 [](std
::string Opts
) {
194 return
MemProfUsePass(Opts
);
196 parseMemProfUsePassOptions
,
197 "profile-filename=S")
198 MODULE_PASS_WITH_PARAMS("print<structural-hash>",
199 "StructuralHashPrinterPass",
200 [](bool EnableDetailedStructuralHash
) {
201 return
StructuralHashPrinterPass(
203 EnableDetailedStructuralHash
);
205 parseStructuralHashPrinterPassOptions
,
207 #undef MODULE_PASS_WITH_PARAMS
209 #ifndef CGSCC_ANALYSIS
210 #define
CGSCC_ANALYSIS(NAME
, CREATE_PASS
)
212 CGSCC_ANALYSIS("no-op-cgscc", NoOpCGSCCAnalysis())
213 CGSCC_ANALYSIS("fam-proxy", FunctionAnalysisManagerCGSCCProxy())
214 CGSCC_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
215 #undef CGSCC_ANALYSIS
218 #define
CGSCC_PASS(NAME
, CREATE_PASS
)
220 CGSCC_PASS("argpromotion", ArgumentPromotionPass())
221 CGSCC_PASS("invalidate<all>", InvalidateAllAnalysesPass())
222 CGSCC_PASS("attributor-cgscc", AttributorCGSCCPass())
223 CGSCC_PASS("attributor-light-cgscc", AttributorLightCGSCCPass())
224 CGSCC_PASS("openmp-opt-cgscc", OpenMPOptCGSCCPass())
225 CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass())
228 #ifndef CGSCC_PASS_WITH_PARAMS
229 #define
CGSCC_PASS_WITH_PARAMS(NAME
, CLASS
, CREATE_PASS
, PARSER
, PARAMS
)
231 CGSCC_PASS_WITH_PARAMS("inline",
233 [](bool OnlyMandatory
) {
234 return
InlinerPass(OnlyMandatory
);
236 parseInlinerPassOptions
,
238 CGSCC_PASS_WITH_PARAMS("coro-split",
240 [](bool OptimizeFrame
) {
241 return
CoroSplitPass(OptimizeFrame
);
243 parseCoroSplitPassOptions
,
245 CGSCC_PASS_WITH_PARAMS("function-attrs",
246 "PostOrderFunctionAttrsPass",
247 [](bool SkipNonRecursive
) {
248 return
PostOrderFunctionAttrsPass(SkipNonRecursive
);
250 parsePostOrderFunctionAttrsPassOptions
,
251 "skip-non-recursive-function-attrs")
252 #undef CGSCC_PASS_WITH_PARAMS
254 #ifndef FUNCTION_ANALYSIS
255 #define
FUNCTION_ANALYSIS(NAME
, CREATE_PASS
)
257 FUNCTION_ANALYSIS("aa", AAManager())
258 FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis())
259 FUNCTION_ANALYSIS("block-freq", BlockFrequencyAnalysis())
260 FUNCTION_ANALYSIS("branch-prob", BranchProbabilityAnalysis())
261 FUNCTION_ANALYSIS("cycles", CycleAnalysis())
262 FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis())
263 FUNCTION_ANALYSIS("postdomtree", PostDominatorTreeAnalysis())
264 FUNCTION_ANALYSIS("demanded-bits", DemandedBitsAnalysis())
265 FUNCTION_ANALYSIS("domfrontier", DominanceFrontierAnalysis())
266 FUNCTION_ANALYSIS("func-properties", FunctionPropertiesAnalysis())
267 FUNCTION_ANALYSIS("loops", LoopAnalysis())
268 FUNCTION_ANALYSIS("access-info", LoopAccessAnalysis())
269 FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis())
270 FUNCTION_ANALYSIS("da", DependenceAnalysis())
271 FUNCTION_ANALYSIS("inliner-size-estimator", InlineSizeEstimatorAnalysis())
272 FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis())
273 FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis())
274 FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis())
275 FUNCTION_ANALYSIS("regions", RegionInfoAnalysis())
276 FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis())
277 FUNCTION_ANALYSIS("opt-remark-emit", OptimizationRemarkEmitterAnalysis())
278 FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis())
279 FUNCTION_ANALYSIS("should-not-run-function-passes", ShouldNotRunFunctionPassesAnalysis())
280 FUNCTION_ANALYSIS("should-run-extra-vector-passes", ShouldRunExtraVectorPasses())
281 FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis())
282 FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
283 FUNCTION_ANALYSIS("targetir",
284 TM ? TM
->getTargetIRAnalysis() : TargetIRAnalysis())
285 FUNCTION_ANALYSIS("verify", VerifierAnalysis())
286 FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
287 FUNCTION_ANALYSIS("uniformity", UniformityInfoAnalysis())
289 #ifndef FUNCTION_ALIAS_ANALYSIS
290 #define
FUNCTION_ALIAS_ANALYSIS(NAME
, CREATE_PASS
) \
291 FUNCTION_ANALYSIS(NAME
, CREATE_PASS
)
293 FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA())
294 FUNCTION_ALIAS_ANALYSIS("objc-arc-aa", objcarc
::ObjCARCAA())
295 FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA())
296 FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA())
297 FUNCTION_ALIAS_ANALYSIS("tbaa", TypeBasedAA())
298 #undef FUNCTION_ALIAS_ANALYSIS
299 #undef FUNCTION_ANALYSIS
301 #ifndef FUNCTION_PASS
302 #define
FUNCTION_PASS(NAME
, CREATE_PASS
)
304 FUNCTION_PASS("aa-eval", AAEvaluator())
305 FUNCTION_PASS("adce", ADCEPass())
306 FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass())
307 FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass())
308 FUNCTION_PASS("assume-builder", AssumeBuilderPass())
309 FUNCTION_PASS("assume-simplify", AssumeSimplifyPass())
310 FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass())
311 FUNCTION_PASS("annotation-remarks", AnnotationRemarksPass())
312 FUNCTION_PASS("bdce", BDCEPass())
313 FUNCTION_PASS("bounds-checking", BoundsCheckingPass())
314 FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass())
315 FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass())
316 FUNCTION_PASS("consthoist", ConstantHoistingPass())
317 FUNCTION_PASS("count-visits", CountVisitsPass())
318 FUNCTION_PASS("constraint-elimination", ConstraintEliminationPass())
319 FUNCTION_PASS("chr", ControlHeightReductionPass())
320 FUNCTION_PASS("coro-elide", CoroElidePass())
321 FUNCTION_PASS("correlated-propagation", CorrelatedValuePropagationPass())
322 FUNCTION_PASS("dce", DCEPass())
323 FUNCTION_PASS("dfa-jump-threading", DFAJumpThreadingPass())
324 FUNCTION_PASS("div-rem-pairs", DivRemPairsPass())
325 FUNCTION_PASS("dse", DSEPass())
326 FUNCTION_PASS("dot-cfg", CFGPrinterPass())
327 FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass())
328 FUNCTION_PASS("dot-dom", DomPrinter())
329 FUNCTION_PASS("dot-dom-only", DomOnlyPrinter())
330 FUNCTION_PASS("dot-post-dom", PostDomPrinter())
331 FUNCTION_PASS("dot-post-dom-only", PostDomOnlyPrinter())
332 FUNCTION_PASS("view-dom", DomViewer())
333 FUNCTION_PASS("view-dom-only", DomOnlyViewer())
334 FUNCTION_PASS("view-post-dom", PostDomViewer())
335 FUNCTION_PASS("view-post-dom-only", PostDomOnlyViewer())
336 FUNCTION_PASS("fix-irreducible", FixIrreduciblePass())
337 FUNCTION_PASS("flattencfg", FlattenCFGPass())
338 FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
339 FUNCTION_PASS("gvn-hoist", GVNHoistPass())
340 FUNCTION_PASS("gvn-sink", GVNSinkPass())
341 FUNCTION_PASS("helloworld", HelloWorldPass())
342 FUNCTION_PASS("infer-address-spaces", InferAddressSpacesPass())
343 FUNCTION_PASS("infer-alignment", InferAlignmentPass())
344 FUNCTION_PASS("instcount", InstCountPass())
345 FUNCTION_PASS("instsimplify", InstSimplifyPass())
346 FUNCTION_PASS("invalidate<all>", InvalidateAllAnalysesPass())
347 FUNCTION_PASS("irce", IRCEPass())
348 FUNCTION_PASS("float2int", Float2IntPass())
349 FUNCTION_PASS("no-op-function", NoOpFunctionPass())
350 FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass())
351 FUNCTION_PASS("lint", LintPass())
352 FUNCTION_PASS("inject-tli-mappings", InjectTLIMappings())
353 FUNCTION_PASS("instnamer", InstructionNamerPass())
354 FUNCTION_PASS("loweratomic", LowerAtomicPass())
355 FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
356 FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
357 FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
358 FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
359 FUNCTION_PASS("guard-widening", GuardWideningPass())
360 FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass())
361 FUNCTION_PASS("loop-simplify", LoopSimplifyPass())
362 FUNCTION_PASS("loop-sink", LoopSinkPass())
363 FUNCTION_PASS("lowerinvoke", LowerInvokePass())
364 FUNCTION_PASS("lowerswitch", LowerSwitchPass())
365 FUNCTION_PASS("mem2reg", PromotePass())
366 FUNCTION_PASS("memcpyopt", MemCpyOptPass())
367 FUNCTION_PASS("mergeicmps", MergeICmpsPass())
368 FUNCTION_PASS("mergereturn", UnifyFunctionExitNodesPass())
369 FUNCTION_PASS("move-auto-init", MoveAutoInitPass())
370 FUNCTION_PASS("nary-reassociate", NaryReassociatePass())
371 FUNCTION_PASS("newgvn", NewGVNPass())
372 FUNCTION_PASS("jump-threading", JumpThreadingPass())
373 FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass())
374 FUNCTION_PASS("kcfi", KCFIPass())
375 FUNCTION_PASS("lcssa", LCSSAPass())
376 FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass())
377 FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass())
378 FUNCTION_PASS("loop-fusion", LoopFusePass())
379 FUNCTION_PASS("loop-distribute", LoopDistributePass())
380 FUNCTION_PASS("loop-versioning", LoopVersioningPass())
381 FUNCTION_PASS("objc-arc", ObjCARCOptPass())
382 FUNCTION_PASS("objc-arc-contract", ObjCARCContractPass())
383 FUNCTION_PASS("objc-arc-expand", ObjCARCExpandPass())
384 FUNCTION_PASS("pa-eval", PAEvalPass())
385 FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt())
386 FUNCTION_PASS("place-safepoints", PlaceSafepointsPass())
387 FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
388 FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
389 FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
390 FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
391 FUNCTION_PASS("print<cost-model>", CostModelPrinterPass(dbgs()))
392 FUNCTION_PASS("print<cycles>", CycleInfoPrinterPass(dbgs()))
393 FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs()))
394 FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
395 FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
396 FUNCTION_PASS("print<delinearization>", DelinearizationPrinterPass(dbgs()))
397 FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
398 FUNCTION_PASS("print<domfrontier>", DominanceFrontierPrinterPass(dbgs()))
399 FUNCTION_PASS("print<func-properties>", FunctionPropertiesPrinterPass(dbgs()))
400 FUNCTION_PASS("print<inline-cost>", InlineCostAnnotationPrinterPass(dbgs()))
401 FUNCTION_PASS("print<inliner-size-estimator>",
402 InlineSizeEstimatorAnalysisPrinterPass(dbgs()))
403 FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs()))
404 FUNCTION_PASS("print<memoryssa-walker>", MemorySSAWalkerPrinterPass(dbgs()))
405 FUNCTION_PASS("print<phi-values>", PhiValuesPrinterPass(dbgs()))
406 FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs()))
407 FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs()))
408 FUNCTION_PASS("print<stack-safety-local>", StackSafetyPrinterPass(dbgs()))
409 FUNCTION_PASS("print<access-info>", LoopAccessInfoPrinterPass(dbgs()))
410 // TODO
: rename to print
<foo
> after NPM switch
411 FUNCTION_PASS("print-alias-sets", AliasSetsPrinterPass(dbgs()))
412 FUNCTION_PASS("print-cfg-sccs", CFGSCCPrinterPass(dbgs()))
413 FUNCTION_PASS("print-predicateinfo", PredicateInfoPrinterPass(dbgs()))
414 FUNCTION_PASS("print-mustexecute", MustExecutePrinterPass(dbgs()))
415 FUNCTION_PASS("print-memderefs", MemDerefPrinterPass(dbgs()))
416 FUNCTION_PASS("print<uniformity>", UniformityInfoPrinterPass(dbgs()))
417 FUNCTION_PASS("reassociate", ReassociatePass())
418 FUNCTION_PASS("redundant-dbg-inst-elim", RedundantDbgInstEliminationPass())
419 FUNCTION_PASS("reg2mem", RegToMemPass())
420 FUNCTION_PASS("scalarize-masked-mem-intrin", ScalarizeMaskedMemIntrinPass())
421 FUNCTION_PASS("scalarizer", ScalarizerPass())
422 FUNCTION_PASS("separate-const-offset-from-gep", SeparateConstOffsetFromGEPPass())
423 FUNCTION_PASS("sccp", SCCPPass())
424 FUNCTION_PASS("sink", SinkingPass())
425 FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass())
426 FUNCTION_PASS("slsr", StraightLineStrengthReducePass())
427 FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass())
428 FUNCTION_PASS("strip-gc-relocates", StripGCRelocates())
429 FUNCTION_PASS("structurizecfg", StructurizeCFGPass())
430 FUNCTION_PASS("tailcallelim", TailCallElimPass())
431 FUNCTION_PASS("typepromotion", TypePromotionPass(TM
))
432 FUNCTION_PASS("unify-loop-exits", UnifyLoopExitsPass())
433 FUNCTION_PASS("vector-combine", VectorCombinePass())
434 FUNCTION_PASS("verify", VerifierPass())
435 FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass())
436 FUNCTION_PASS("verify<loops>", LoopVerifierPass())
437 FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
438 FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
439 FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass())
440 FUNCTION_PASS("verify<scalar-evolution>", ScalarEvolutionVerifierPass())
441 FUNCTION_PASS("view-cfg", CFGViewerPass())
442 FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
443 FUNCTION_PASS("tlshoist", TLSVariableHoistPass())
444 FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
445 FUNCTION_PASS("tsan", ThreadSanitizerPass())
446 FUNCTION_PASS("memprof", MemProfilerPass())
447 FUNCTION_PASS("declare-to-assign", llvm
::AssignmentTrackingPass())
450 #ifndef FUNCTION_PASS_WITH_PARAMS
451 #define
FUNCTION_PASS_WITH_PARAMS(NAME
, CLASS
, CREATE_PASS
, PARSER
, PARAMS
)
453 FUNCTION_PASS_WITH_PARAMS("early-cse",
455 [](bool UseMemorySSA
) {
456 return
EarlyCSEPass(UseMemorySSA
);
458 parseEarlyCSEPassOptions
,
460 FUNCTION_PASS_WITH_PARAMS("ee-instrument",
461 "EntryExitInstrumenterPass",
462 [](bool PostInlining
) {
463 return
EntryExitInstrumenterPass(PostInlining
);
465 parseEntryExitInstrumenterPassOptions
,
467 FUNCTION_PASS_WITH_PARAMS("hardware-loops",
469 [](HardwareLoopOptions Opts
) {
470 return
HardwareLoopsPass(Opts
);
472 parseHardwareLoopOptions
,
473 "force-hardware-loops;"
474 "force-hardware-loop-phi;"
475 "force-nested-hardware-loop;"
476 "force-hardware-loop-guard;"
477 "hardware-loop-decrement=N;"
478 "hardware-loop-counter-bitwidth=N")
479 FUNCTION_PASS_WITH_PARAMS("lower-matrix-intrinsics",
480 "LowerMatrixIntrinsicsPass",
482 return
LowerMatrixIntrinsicsPass(Minimal
);
484 parseLowerMatrixIntrinsicsPassOptions
,
486 FUNCTION_PASS_WITH_PARAMS("loop-unroll",
488 [](LoopUnrollOptions Opts
) {
489 return
LoopUnrollPass(Opts
);
491 parseLoopUnrollOptions
,
492 "O0;O1;O2;O3;full-unroll-max=N;"
493 "no-partial;partial;"
494 "no-peeling;peeling;"
495 "no-profile-peeling;profile-peeling;"
496 "no-runtime;runtime;"
497 "no-upperbound;upperbound")
498 FUNCTION_PASS_WITH_PARAMS("simplifycfg",
500 [](SimplifyCFGOptions Opts
) {
501 return
SimplifyCFGPass(Opts
);
503 parseSimplifyCFGOptions
,
504 "no-forward-switch-cond;forward-switch-cond;"
505 "no-switch-range-to-icmp;switch-range-to-icmp;"
506 "no-switch-to-lookup;switch-to-lookup;"
507 "no-keep-loops;keep-loops;"
508 "no-hoist-common-insts;hoist-common-insts;"
509 "no-sink-common-insts;sink-common-insts;"
510 "bonus-inst-threshold=N"
512 FUNCTION_PASS_WITH_PARAMS("loop-vectorize",
514 [](LoopVectorizeOptions Opts
) {
515 return
LoopVectorizePass(Opts
);
517 parseLoopVectorizeOptions
,
518 "no-interleave-forced-only;interleave-forced-only;"
519 "no-vectorize-forced-only;vectorize-forced-only")
520 FUNCTION_PASS_WITH_PARAMS("instcombine",
522 [](InstCombineOptions Opts
) {
523 return
InstCombinePass(Opts
);
525 parseInstCombineOptions
,
526 "no-use-loop-info;use-loop-info;"
527 "no-verify-fixpoint;verify-fixpoint;"
530 FUNCTION_PASS_WITH_PARAMS("mldst-motion",
531 "MergedLoadStoreMotionPass",
532 [](MergedLoadStoreMotionOptions Opts
) {
533 return
MergedLoadStoreMotionPass(Opts
);
535 parseMergedLoadStoreMotionOptions
,
536 "no-split-footer-bb;split-footer-bb")
537 FUNCTION_PASS_WITH_PARAMS("gvn",
539 [](GVNOptions Opts
) {
540 return
GVNPass(Opts
);
544 "no-load-pre;load-pre;"
545 "no-split-backedge-load-pre;split-backedge-load-pre;"
547 FUNCTION_PASS_WITH_PARAMS("sroa",
549 [](SROAOptions PreserveCFG
) {
550 return
SROAPass(PreserveCFG
);
553 "preserve-cfg;modify-cfg")
554 FUNCTION_PASS_WITH_PARAMS("print<stack-lifetime>",
555 "StackLifetimePrinterPass",
556 [](StackLifetime
::LivenessType Type
) {
557 return
StackLifetimePrinterPass(dbgs(), Type
);
559 parseStackLifetimeOptions
,
561 FUNCTION_PASS_WITH_PARAMS("print<da>",
562 "DependenceAnalysisPrinterPass",
563 [](bool NormalizeResults
) {
564 return
DependenceAnalysisPrinterPass(dbgs(), NormalizeResults
);
566 parseDependenceAnalysisPrinterOptions
,
567 "normalized-results")
568 FUNCTION_PASS_WITH_PARAMS("separate-const-offset-from-gep",
569 "SeparateConstOffsetFromGEPPass",
571 return
SeparateConstOffsetFromGEPPass(LowerGEP
);
573 parseSeparateConstOffsetFromGEPPassOptions
,
575 FUNCTION_PASS_WITH_PARAMS("function-simplification",
577 [this
](OptimizationLevel OL
) {
578 return
buildFunctionSimplificationPipeline(OL
, ThinOrFullLTOPhase
::None
);
580 parseFunctionSimplificationPipelineOptions
,
582 FUNCTION_PASS_WITH_PARAMS("print<memoryssa>",
583 "MemorySSAPrinterPass",
584 [](bool NoEnsureOptimizedUses
) {
585 return
MemorySSAPrinterPass(dbgs(), !NoEnsureOptimizedUses
);
587 parseMemorySSAPrinterPassOptions
,
588 "no-ensure-optimized-uses")
589 #undef FUNCTION_PASS_WITH_PARAMS
591 #ifndef LOOPNEST_PASS
592 #define
LOOPNEST_PASS(NAME
, CREATE_PASS
)
594 LOOPNEST_PASS("loop-flatten", LoopFlattenPass())
595 LOOPNEST_PASS("loop-interchange", LoopInterchangePass())
596 LOOPNEST_PASS("loop-unroll-and-jam", LoopUnrollAndJamPass())
597 LOOPNEST_PASS("no-op-loopnest", NoOpLoopNestPass())
600 #ifndef LOOP_ANALYSIS
601 #define
LOOP_ANALYSIS(NAME
, CREATE_PASS
)
603 LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis())
604 LOOP_ANALYSIS("ddg", DDGAnalysis())
605 LOOP_ANALYSIS("iv-users", IVUsersAnalysis())
606 LOOP_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
610 #define
LOOP_PASS(NAME
, CREATE_PASS
)
612 LOOP_PASS("canon-freeze", CanonicalizeFreezeInLoopsPass())
613 LOOP_PASS("dot-ddg", DDGDotPrinterPass())
614 LOOP_PASS("invalidate<all>", InvalidateAllAnalysesPass())
615 LOOP_PASS("loop-idiom", LoopIdiomRecognizePass())
616 LOOP_PASS("loop-instsimplify", LoopInstSimplifyPass())
617 LOOP_PASS("no-op-loop", NoOpLoopPass())
618 LOOP_PASS("print", PrintLoopPass(dbgs()))
619 LOOP_PASS("loop-deletion", LoopDeletionPass())
620 LOOP_PASS("loop-simplifycfg", LoopSimplifyCFGPass())
621 LOOP_PASS("loop-reduce", LoopStrengthReducePass())
622 LOOP_PASS("indvars", IndVarSimplifyPass())
623 LOOP_PASS("loop-unroll-full", LoopFullUnrollPass())
624 LOOP_PASS("print<ddg>", DDGAnalysisPrinterPass(dbgs()))
625 LOOP_PASS("print<iv-users>", IVUsersPrinterPass(dbgs()))
626 LOOP_PASS("print<loopnest>", LoopNestPrinterPass(dbgs()))
627 LOOP_PASS("print<loop-cache-cost>", LoopCachePrinterPass(dbgs()))
628 LOOP_PASS("loop-predication", LoopPredicationPass())
629 LOOP_PASS("guard-widening", GuardWideningPass())
630 LOOP_PASS("loop-bound-split", LoopBoundSplitPass())
631 LOOP_PASS("loop-reroll", LoopRerollPass())
632 LOOP_PASS("loop-versioning-licm", LoopVersioningLICMPass())
635 #ifndef LOOP_PASS_WITH_PARAMS
636 #define
LOOP_PASS_WITH_PARAMS(NAME
, CLASS
, CREATE_PASS
, PARSER
, PARAMS
)
638 LOOP_PASS_WITH_PARAMS("simple-loop-unswitch",
639 "SimpleLoopUnswitchPass",
640 [](std
::pair
<bool
, bool
> Params
) {
641 return
SimpleLoopUnswitchPass(Params.first
, Params.second
);
643 parseLoopUnswitchOptions
,
644 "nontrivial;no-nontrivial;trivial;no-trivial")
646 LOOP_PASS_WITH_PARAMS("licm", "LICMPass",
647 [](LICMOptions Params
) {
648 return
LICMPass(Params
);
653 LOOP_PASS_WITH_PARAMS("lnicm", "LNICMPass",
654 [](LICMOptions Params
) {
655 return
LNICMPass(Params
);
660 LOOP_PASS_WITH_PARAMS("loop-rotate",
662 [](std
::pair
<bool
, bool
> Params
) {
663 return
LoopRotatePass(Params.first
, Params.second
);
665 parseLoopRotateOptions
,
666 "no-header-duplication;header-duplication;no-prepare-for-lto;prepare-for-lto")
667 #undef LOOP_PASS_WITH_PARAMS