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

source code of llvm/lib/Passes/PassRegistry.def