xref: /freebsd/contrib/llvm-project/llvm/lib/Passes/PassRegistry.def (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
1//===- PassRegistry.def - Registry of passes --------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
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.
13//
14//===----------------------------------------------------------------------===//
15
16// NOTE: NO INCLUDE GUARD DESIRED!
17
18#ifndef MODULE_ANALYSIS
19#define MODULE_ANALYSIS(NAME, CREATE_PASS)
20#endif
21MODULE_ANALYSIS("callgraph", CallGraphAnalysis())
22MODULE_ANALYSIS("lcg", LazyCallGraphAnalysis())
23MODULE_ANALYSIS("module-summary", ModuleSummaryIndexAnalysis())
24MODULE_ANALYSIS("no-op-module", NoOpModuleAnalysis())
25MODULE_ANALYSIS("profile-summary", ProfileSummaryAnalysis())
26MODULE_ANALYSIS("stack-safety", StackSafetyGlobalAnalysis())
27MODULE_ANALYSIS("verify", VerifierAnalysis())
28MODULE_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
29MODULE_ANALYSIS("asan-globals-md", ASanGlobalsMetadataAnalysis())
30MODULE_ANALYSIS("inline-advisor", InlineAdvisorAnalysis())
31MODULE_ANALYSIS("ir-similarity", IRSimilarityAnalysis())
32
33#ifndef MODULE_ALIAS_ANALYSIS
34#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS)                               \
35  MODULE_ANALYSIS(NAME, CREATE_PASS)
36#endif
37MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA())
38#undef MODULE_ALIAS_ANALYSIS
39#undef MODULE_ANALYSIS
40
41#ifndef MODULE_PASS
42#define MODULE_PASS(NAME, CREATE_PASS)
43#endif
44MODULE_PASS("always-inline", AlwaysInlinerPass())
45MODULE_PASS("attributor", AttributorPass())
46MODULE_PASS("annotation2metadata", Annotation2MetadataPass())
47MODULE_PASS("openmp-opt", OpenMPOptPass())
48MODULE_PASS("called-value-propagation", CalledValuePropagationPass())
49MODULE_PASS("canonicalize-aliases", CanonicalizeAliasesPass())
50MODULE_PASS("cg-profile", CGProfilePass())
51MODULE_PASS("constmerge", ConstantMergePass())
52MODULE_PASS("cross-dso-cfi", CrossDSOCFIPass())
53MODULE_PASS("deadargelim", DeadArgumentEliminationPass())
54MODULE_PASS("elim-avail-extern", EliminateAvailableExternallyPass())
55MODULE_PASS("extract-blocks", BlockExtractorPass())
56MODULE_PASS("forceattrs", ForceFunctionAttrsPass())
57MODULE_PASS("function-import", FunctionImportPass())
58MODULE_PASS("function-specialization", FunctionSpecializationPass())
59MODULE_PASS("globaldce", GlobalDCEPass())
60MODULE_PASS("globalopt", GlobalOptPass())
61MODULE_PASS("globalsplit", GlobalSplitPass())
62MODULE_PASS("hotcoldsplit", HotColdSplittingPass())
63MODULE_PASS("hwasan", HWAddressSanitizerPass(false, false))
64MODULE_PASS("khwasan", HWAddressSanitizerPass(true, true))
65MODULE_PASS("inferattrs", InferFunctionAttrsPass())
66MODULE_PASS("inliner-wrapper", ModuleInlinerWrapperPass())
67MODULE_PASS("inliner-wrapper-no-mandatory-first", ModuleInlinerWrapperPass(
68  getInlineParams(),
69  false))
70MODULE_PASS("insert-gcov-profiling", GCOVProfilerPass())
71MODULE_PASS("instrorderfile", InstrOrderFilePass())
72MODULE_PASS("instrprof", InstrProfiling())
73MODULE_PASS("internalize", InternalizePass())
74MODULE_PASS("invalidate<all>", InvalidateAllAnalysesPass())
75MODULE_PASS("ipsccp", IPSCCPPass())
76MODULE_PASS("iroutliner", IROutlinerPass())
77MODULE_PASS("print-ir-similarity", IRSimilarityAnalysisPrinterPass(dbgs()))
78MODULE_PASS("loop-extract", LoopExtractorPass())
79MODULE_PASS("lowertypetests", LowerTypeTestsPass())
80MODULE_PASS("metarenamer", MetaRenamerPass())
81MODULE_PASS("mergefunc", MergeFunctionsPass())
82MODULE_PASS("name-anon-globals", NameAnonGlobalPass())
83MODULE_PASS("no-op-module", NoOpModulePass())
84MODULE_PASS("objc-arc-apelim", ObjCARCAPElimPass())
85MODULE_PASS("partial-inliner", PartialInlinerPass())
86MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion())
87MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen())
88MODULE_PASS("pgo-instr-use", PGOInstrumentationUse())
89MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs()))
90MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs()))
91MODULE_PASS("print", PrintModulePass(dbgs()))
92MODULE_PASS("print-lcg", LazyCallGraphPrinterPass(dbgs()))
93MODULE_PASS("print-lcg-dot", LazyCallGraphDOTPrinterPass(dbgs()))
94MODULE_PASS("print-must-be-executed-contexts", MustBeExecutedContextPrinterPass(dbgs()))
95MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs()))
96MODULE_PASS("print<module-debuginfo>", ModuleDebugInfoPrinterPass(dbgs()))
97MODULE_PASS("rel-lookup-table-converter", RelLookupTableConverterPass())
98MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC())
99MODULE_PASS("rewrite-symbols", RewriteSymbolPass())
100MODULE_PASS("rpo-function-attrs", ReversePostOrderFunctionAttrsPass())
101MODULE_PASS("sample-profile", SampleProfileLoaderPass())
102MODULE_PASS("scc-oz-module-inliner",
103  buildInlinerPipeline(OptimizationLevel::Oz, ThinOrFullLTOPhase::None))
104MODULE_PASS("loop-extract-single", LoopExtractorPass(1))
105MODULE_PASS("strip", StripSymbolsPass())
106MODULE_PASS("strip-dead-debug-info", StripDeadDebugInfoPass())
107MODULE_PASS("pseudo-probe", SampleProfileProbePass(TM))
108MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
109MODULE_PASS("strip-debug-declare", StripDebugDeclarePass())
110MODULE_PASS("strip-nondebug", StripNonDebugSymbolsPass())
111MODULE_PASS("strip-nonlinetable-debuginfo", StripNonLineTableDebugInfoPass())
112MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation())
113MODULE_PASS("verify", VerifierPass())
114MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass())
115MODULE_PASS("dfsan", DataFlowSanitizerPass())
116MODULE_PASS("asan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/false, false, true, false))
117MODULE_PASS("msan-module", MemorySanitizerPass({}))
118MODULE_PASS("tsan-module", ThreadSanitizerPass())
119MODULE_PASS("kasan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/true, false, true, false))
120MODULE_PASS("sancov-module", ModuleSanitizerCoveragePass())
121MODULE_PASS("memprof-module", ModuleMemProfilerPass())
122MODULE_PASS("poison-checking", PoisonCheckingPass())
123MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass())
124#undef MODULE_PASS
125
126#ifndef CGSCC_ANALYSIS
127#define CGSCC_ANALYSIS(NAME, CREATE_PASS)
128#endif
129CGSCC_ANALYSIS("no-op-cgscc", NoOpCGSCCAnalysis())
130CGSCC_ANALYSIS("fam-proxy", FunctionAnalysisManagerCGSCCProxy())
131CGSCC_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
132#undef CGSCC_ANALYSIS
133
134#ifndef CGSCC_PASS
135#define CGSCC_PASS(NAME, CREATE_PASS)
136#endif
137CGSCC_PASS("argpromotion", ArgumentPromotionPass())
138CGSCC_PASS("invalidate<all>", InvalidateAllAnalysesPass())
139CGSCC_PASS("function-attrs", PostOrderFunctionAttrsPass())
140CGSCC_PASS("attributor-cgscc", AttributorCGSCCPass())
141CGSCC_PASS("inline", InlinerPass())
142CGSCC_PASS("openmp-opt-cgscc", OpenMPOptCGSCCPass())
143CGSCC_PASS("coro-split", CoroSplitPass())
144CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass())
145#undef CGSCC_PASS
146
147#ifndef FUNCTION_ANALYSIS
148#define FUNCTION_ANALYSIS(NAME, CREATE_PASS)
149#endif
150FUNCTION_ANALYSIS("aa", AAManager())
151FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis())
152FUNCTION_ANALYSIS("block-freq", BlockFrequencyAnalysis())
153FUNCTION_ANALYSIS("branch-prob", BranchProbabilityAnalysis())
154FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis())
155FUNCTION_ANALYSIS("postdomtree", PostDominatorTreeAnalysis())
156FUNCTION_ANALYSIS("demanded-bits", DemandedBitsAnalysis())
157FUNCTION_ANALYSIS("domfrontier", DominanceFrontierAnalysis())
158FUNCTION_ANALYSIS("func-properties", FunctionPropertiesAnalysis())
159FUNCTION_ANALYSIS("loops", LoopAnalysis())
160FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis())
161FUNCTION_ANALYSIS("da", DependenceAnalysis())
162FUNCTION_ANALYSIS("inliner-size-estimator", InlineSizeEstimatorAnalysis())
163FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis())
164FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis())
165FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis())
166FUNCTION_ANALYSIS("regions", RegionInfoAnalysis())
167FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis())
168FUNCTION_ANALYSIS("opt-remark-emit", OptimizationRemarkEmitterAnalysis())
169FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis())
170FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis())
171FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
172FUNCTION_ANALYSIS("targetir",
173                  TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis())
174FUNCTION_ANALYSIS("verify", VerifierAnalysis())
175FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
176FUNCTION_ANALYSIS("divergence", DivergenceAnalysis())
177
178#ifndef FUNCTION_ALIAS_ANALYSIS
179#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS)                             \
180  FUNCTION_ANALYSIS(NAME, CREATE_PASS)
181#endif
182FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA())
183FUNCTION_ALIAS_ANALYSIS("cfl-anders-aa", CFLAndersAA())
184FUNCTION_ALIAS_ANALYSIS("cfl-steens-aa", CFLSteensAA())
185FUNCTION_ALIAS_ANALYSIS("objc-arc-aa", objcarc::ObjCARCAA())
186FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA())
187FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA())
188FUNCTION_ALIAS_ANALYSIS("tbaa", TypeBasedAA())
189#undef FUNCTION_ALIAS_ANALYSIS
190#undef FUNCTION_ANALYSIS
191
192#ifndef FUNCTION_PASS
193#define FUNCTION_PASS(NAME, CREATE_PASS)
194#endif
195FUNCTION_PASS("aa-eval", AAEvaluator())
196FUNCTION_PASS("adce", ADCEPass())
197FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass())
198FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass())
199FUNCTION_PASS("assume-builder", AssumeBuilderPass())
200FUNCTION_PASS("assume-simplify", AssumeSimplifyPass())
201FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass())
202FUNCTION_PASS("annotation-remarks", AnnotationRemarksPass())
203FUNCTION_PASS("bdce", BDCEPass())
204FUNCTION_PASS("bounds-checking", BoundsCheckingPass())
205FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass())
206FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass())
207FUNCTION_PASS("consthoist", ConstantHoistingPass())
208FUNCTION_PASS("constraint-elimination", ConstraintEliminationPass())
209FUNCTION_PASS("chr", ControlHeightReductionPass())
210FUNCTION_PASS("coro-early", CoroEarlyPass())
211FUNCTION_PASS("coro-elide", CoroElidePass())
212FUNCTION_PASS("coro-cleanup", CoroCleanupPass())
213FUNCTION_PASS("correlated-propagation", CorrelatedValuePropagationPass())
214FUNCTION_PASS("dce", DCEPass())
215FUNCTION_PASS("dfa-jump-threading", DFAJumpThreadingPass())
216FUNCTION_PASS("div-rem-pairs", DivRemPairsPass())
217FUNCTION_PASS("dse", DSEPass())
218FUNCTION_PASS("dot-cfg", CFGPrinterPass())
219FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass())
220FUNCTION_PASS("early-cse", EarlyCSEPass(/*UseMemorySSA=*/false))
221FUNCTION_PASS("early-cse-memssa", EarlyCSEPass(/*UseMemorySSA=*/true))
222FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass(/*PostInlining=*/false))
223FUNCTION_PASS("fix-irreducible", FixIrreduciblePass())
224FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
225FUNCTION_PASS("post-inline-ee-instrument", EntryExitInstrumenterPass(/*PostInlining=*/true))
226FUNCTION_PASS("gvn-hoist", GVNHoistPass())
227FUNCTION_PASS("gvn-sink", GVNSinkPass())
228FUNCTION_PASS("helloworld", HelloWorldPass())
229FUNCTION_PASS("infer-address-spaces", InferAddressSpacesPass())
230FUNCTION_PASS("instcombine", InstCombinePass())
231FUNCTION_PASS("instcount", InstCountPass())
232FUNCTION_PASS("instsimplify", InstSimplifyPass())
233FUNCTION_PASS("invalidate<all>", InvalidateAllAnalysesPass())
234FUNCTION_PASS("irce", IRCEPass())
235FUNCTION_PASS("float2int", Float2IntPass())
236FUNCTION_PASS("no-op-function", NoOpFunctionPass())
237FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass())
238FUNCTION_PASS("lint", LintPass())
239FUNCTION_PASS("inject-tli-mappings", InjectTLIMappings())
240FUNCTION_PASS("instnamer", InstructionNamerPass())
241FUNCTION_PASS("loweratomic", LowerAtomicPass())
242FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
243FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
244FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
245FUNCTION_PASS("lower-matrix-intrinsics", LowerMatrixIntrinsicsPass())
246FUNCTION_PASS("lower-matrix-intrinsics-minimal", LowerMatrixIntrinsicsPass(true))
247FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
248FUNCTION_PASS("guard-widening", GuardWideningPass())
249FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass())
250FUNCTION_PASS("loop-simplify", LoopSimplifyPass())
251FUNCTION_PASS("loop-sink", LoopSinkPass())
252FUNCTION_PASS("lowerinvoke", LowerInvokePass())
253FUNCTION_PASS("lowerswitch", LowerSwitchPass())
254FUNCTION_PASS("mem2reg", PromotePass())
255FUNCTION_PASS("memcpyopt", MemCpyOptPass())
256FUNCTION_PASS("mergeicmps", MergeICmpsPass())
257FUNCTION_PASS("mergereturn", UnifyFunctionExitNodesPass())
258FUNCTION_PASS("nary-reassociate", NaryReassociatePass())
259FUNCTION_PASS("newgvn", NewGVNPass())
260FUNCTION_PASS("jump-threading", JumpThreadingPass())
261FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass())
262FUNCTION_PASS("lcssa", LCSSAPass())
263FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass())
264FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass())
265FUNCTION_PASS("loop-fusion", LoopFusePass())
266FUNCTION_PASS("loop-distribute", LoopDistributePass())
267FUNCTION_PASS("loop-versioning", LoopVersioningPass())
268FUNCTION_PASS("objc-arc", ObjCARCOptPass())
269FUNCTION_PASS("objc-arc-contract", ObjCARCContractPass())
270FUNCTION_PASS("objc-arc-expand", ObjCARCExpandPass())
271FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt())
272FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
273FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
274FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
275FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
276FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs()))
277FUNCTION_PASS("print<divergence>", DivergenceAnalysisPrinterPass(dbgs()))
278FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
279FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
280FUNCTION_PASS("print<delinearization>", DelinearizationPrinterPass(dbgs()))
281FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
282FUNCTION_PASS("print<domfrontier>", DominanceFrontierPrinterPass(dbgs()))
283FUNCTION_PASS("print<func-properties>", FunctionPropertiesPrinterPass(dbgs()))
284FUNCTION_PASS("print<inline-cost>", InlineCostAnnotationPrinterPass(dbgs()))
285FUNCTION_PASS("print<inliner-size-estimator>",
286  InlineSizeEstimatorAnalysisPrinterPass(dbgs()))
287FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs()))
288FUNCTION_PASS("print<memoryssa>", MemorySSAPrinterPass(dbgs()))
289FUNCTION_PASS("print<phi-values>", PhiValuesPrinterPass(dbgs()))
290FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs()))
291FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs()))
292FUNCTION_PASS("print<stack-safety-local>", StackSafetyPrinterPass(dbgs()))
293// TODO: rename to print<foo> after NPM switch
294FUNCTION_PASS("print-alias-sets", AliasSetsPrinterPass(dbgs()))
295FUNCTION_PASS("print-predicateinfo", PredicateInfoPrinterPass(dbgs()))
296FUNCTION_PASS("print-mustexecute", MustExecutePrinterPass(dbgs()))
297FUNCTION_PASS("print-memderefs", MemDerefPrinterPass(dbgs()))
298FUNCTION_PASS("reassociate", ReassociatePass())
299FUNCTION_PASS("redundant-dbg-inst-elim", RedundantDbgInstEliminationPass())
300FUNCTION_PASS("reg2mem", RegToMemPass())
301FUNCTION_PASS("scalarize-masked-mem-intrin", ScalarizeMaskedMemIntrinPass())
302FUNCTION_PASS("scalarizer", ScalarizerPass())
303FUNCTION_PASS("separate-const-offset-from-gep", SeparateConstOffsetFromGEPPass())
304FUNCTION_PASS("sccp", SCCPPass())
305FUNCTION_PASS("sink", SinkingPass())
306FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass())
307FUNCTION_PASS("slsr", StraightLineStrengthReducePass())
308FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass())
309FUNCTION_PASS("sroa", SROA())
310FUNCTION_PASS("strip-gc-relocates", StripGCRelocates())
311FUNCTION_PASS("structurizecfg", StructurizeCFGPass())
312FUNCTION_PASS("tailcallelim", TailCallElimPass())
313FUNCTION_PASS("unify-loop-exits", UnifyLoopExitsPass())
314FUNCTION_PASS("vector-combine", VectorCombinePass())
315FUNCTION_PASS("verify", VerifierPass())
316FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass())
317FUNCTION_PASS("verify<loops>", LoopVerifierPass())
318FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
319FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
320FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass())
321FUNCTION_PASS("verify<scalar-evolution>", ScalarEvolutionVerifierPass())
322FUNCTION_PASS("view-cfg", CFGViewerPass())
323FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
324FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
325FUNCTION_PASS("asan", AddressSanitizerPass(false, false, false))
326FUNCTION_PASS("kasan", AddressSanitizerPass(true, false, false))
327FUNCTION_PASS("msan", MemorySanitizerPass({}))
328FUNCTION_PASS("kmsan", MemorySanitizerPass({0, false, /*Kernel=*/true}))
329FUNCTION_PASS("tsan", ThreadSanitizerPass())
330FUNCTION_PASS("memprof", MemProfilerPass())
331#undef FUNCTION_PASS
332
333#ifndef FUNCTION_PASS_WITH_PARAMS
334#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS)
335#endif
336FUNCTION_PASS_WITH_PARAMS("loop-unroll",
337                          "LoopUnrollPass",
338                           [](LoopUnrollOptions Opts) {
339                             return LoopUnrollPass(Opts);
340                           },
341                          parseLoopUnrollOptions,
342                          "O0;O1;O2;O3;full-unroll-max=N;"
343                          "no-partial;partial;"
344                          "no-peeling;peeling;"
345                          "no-profile-peeling;profile-peeling;"
346                          "no-runtime;runtime;"
347                          "no-upperbound;upperbound")
348FUNCTION_PASS_WITH_PARAMS("msan",
349                          "MemorySanitizerPass",
350                           [](MemorySanitizerOptions Opts) {
351                             return MemorySanitizerPass(Opts);
352                           },
353                          parseMSanPassOptions,
354                          "recover;kernel;track-origins=N")
355FUNCTION_PASS_WITH_PARAMS("simplifycfg",
356                          "SimplifyCFGPass",
357                           [](SimplifyCFGOptions Opts) {
358                             return SimplifyCFGPass(Opts);
359                           },
360                          parseSimplifyCFGOptions,
361                          "no-forward-switch-cond;forward-switch-cond;"
362                          "no-switch-to-lookup;switch-to-lookup;"
363                          "no-keep-loops;keep-loops;"
364                          "no-hoist-common-insts;hoist-common-insts;"
365                          "no-sink-common-insts;sink-common-insts;"
366                          "bonus-inst-threshold=N"
367                          )
368FUNCTION_PASS_WITH_PARAMS("loop-vectorize",
369                          "LoopVectorizePass",
370                           [](LoopVectorizeOptions Opts) {
371                             return LoopVectorizePass(Opts);
372                           },
373                          parseLoopVectorizeOptions,
374                          "no-interleave-forced-only;interleave-forced-only;"
375                          "no-vectorize-forced-only;vectorize-forced-only")
376FUNCTION_PASS_WITH_PARAMS("mldst-motion",
377                          "MergedLoadStoreMotionPass",
378                           [](MergedLoadStoreMotionOptions Opts) {
379                             return MergedLoadStoreMotionPass(Opts);
380                           },
381                          parseMergedLoadStoreMotionOptions,
382                          "no-split-footer-bb;split-footer-bb")
383FUNCTION_PASS_WITH_PARAMS("gvn",
384                          "GVN",
385                           [](GVNOptions Opts) {
386                             return GVN(Opts);
387                           },
388                          parseGVNOptions,
389                          "no-pre;pre;"
390                          "no-load-pre;load-pre;"
391                          "no-split-backedge-load-pre;split-backedge-load-pre;"
392                          "no-memdep;memdep")
393FUNCTION_PASS_WITH_PARAMS("print<stack-lifetime>",
394                          "StackLifetimePrinterPass",
395                           [](StackLifetime::LivenessType Type) {
396                             return StackLifetimePrinterPass(dbgs(), Type);
397                           },
398                          parseStackLifetimeOptions,
399                          "may;must")
400#undef FUNCTION_PASS_WITH_PARAMS
401
402#ifndef LOOP_ANALYSIS
403#define LOOP_ANALYSIS(NAME, CREATE_PASS)
404#endif
405LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis())
406LOOP_ANALYSIS("access-info", LoopAccessAnalysis())
407LOOP_ANALYSIS("ddg", DDGAnalysis())
408LOOP_ANALYSIS("iv-users", IVUsersAnalysis())
409LOOP_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
410#undef LOOP_ANALYSIS
411
412#ifndef LOOP_PASS
413#define LOOP_PASS(NAME, CREATE_PASS)
414#endif
415LOOP_PASS("canon-freeze", CanonicalizeFreezeInLoopsPass())
416LOOP_PASS("dot-ddg", DDGDotPrinterPass())
417LOOP_PASS("invalidate<all>", InvalidateAllAnalysesPass())
418LOOP_PASS("licm", LICMPass())
419LOOP_PASS("lnicm", LNICMPass())
420LOOP_PASS("loop-flatten", LoopFlattenPass())
421LOOP_PASS("loop-idiom", LoopIdiomRecognizePass())
422LOOP_PASS("loop-instsimplify", LoopInstSimplifyPass())
423LOOP_PASS("loop-interchange", LoopInterchangePass())
424LOOP_PASS("loop-rotate", LoopRotatePass())
425LOOP_PASS("no-op-loop", NoOpLoopPass())
426LOOP_PASS("print", PrintLoopPass(dbgs()))
427LOOP_PASS("loop-deletion", LoopDeletionPass())
428LOOP_PASS("loop-simplifycfg", LoopSimplifyCFGPass())
429LOOP_PASS("loop-reduce", LoopStrengthReducePass())
430LOOP_PASS("indvars", IndVarSimplifyPass())
431LOOP_PASS("loop-unroll-and-jam", LoopUnrollAndJamPass())
432LOOP_PASS("loop-unroll-full", LoopFullUnrollPass())
433LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs()))
434LOOP_PASS("print<ddg>", DDGAnalysisPrinterPass(dbgs()))
435LOOP_PASS("print<iv-users>", IVUsersPrinterPass(dbgs()))
436LOOP_PASS("print<loopnest>", LoopNestPrinterPass(dbgs()))
437LOOP_PASS("print<loop-cache-cost>", LoopCachePrinterPass(dbgs()))
438LOOP_PASS("loop-predication", LoopPredicationPass())
439LOOP_PASS("guard-widening", GuardWideningPass())
440LOOP_PASS("loop-bound-split", LoopBoundSplitPass())
441LOOP_PASS("loop-reroll", LoopRerollPass())
442LOOP_PASS("loop-versioning-licm", LoopVersioningLICMPass())
443#undef LOOP_PASS
444
445#ifndef LOOP_PASS_WITH_PARAMS
446#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS)
447#endif
448LOOP_PASS_WITH_PARAMS("simple-loop-unswitch",
449                      "SimpleLoopUnswitchPass",
450                      [](std::pair<bool, bool> Params) {
451                        return SimpleLoopUnswitchPass(Params.first, Params.second);
452                      },
453                      parseLoopUnswitchOptions,
454                      "nontrivial;no-nontrivial;trivial;no-trivial")
455#undef LOOP_PASS_WITH_PARAMS
456