xref: /freebsd/contrib/llvm-project/llvm/lib/Passes/PassRegistry.def (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
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())
30
31#ifndef MODULE_ALIAS_ANALYSIS
32#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS)                               \
33  MODULE_ANALYSIS(NAME, CREATE_PASS)
34#endif
35MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA())
36#undef MODULE_ALIAS_ANALYSIS
37#undef MODULE_ANALYSIS
38
39#ifndef MODULE_PASS
40#define MODULE_PASS(NAME, CREATE_PASS)
41#endif
42MODULE_PASS("always-inline", AlwaysInlinerPass())
43MODULE_PASS("attributor", AttributorPass())
44MODULE_PASS("called-value-propagation", CalledValuePropagationPass())
45MODULE_PASS("canonicalize-aliases", CanonicalizeAliasesPass())
46MODULE_PASS("cg-profile", CGProfilePass())
47MODULE_PASS("constmerge", ConstantMergePass())
48MODULE_PASS("cross-dso-cfi", CrossDSOCFIPass())
49MODULE_PASS("deadargelim", DeadArgumentEliminationPass())
50MODULE_PASS("elim-avail-extern", EliminateAvailableExternallyPass())
51MODULE_PASS("forceattrs", ForceFunctionAttrsPass())
52MODULE_PASS("function-import", FunctionImportPass())
53MODULE_PASS("globaldce", GlobalDCEPass())
54MODULE_PASS("globalopt", GlobalOptPass())
55MODULE_PASS("globalsplit", GlobalSplitPass())
56MODULE_PASS("hotcoldsplit", HotColdSplittingPass())
57MODULE_PASS("hwasan", HWAddressSanitizerPass(false, false))
58MODULE_PASS("khwasan", HWAddressSanitizerPass(true, true))
59MODULE_PASS("inferattrs", InferFunctionAttrsPass())
60MODULE_PASS("insert-gcov-profiling", GCOVProfilerPass())
61MODULE_PASS("instrorderfile", InstrOrderFilePass())
62MODULE_PASS("instrprof", InstrProfiling())
63MODULE_PASS("internalize", InternalizePass())
64MODULE_PASS("invalidate<all>", InvalidateAllAnalysesPass())
65MODULE_PASS("ipsccp", IPSCCPPass())
66MODULE_PASS("lowertypetests", LowerTypeTestsPass(nullptr, nullptr))
67MODULE_PASS("mergefunc", MergeFunctionsPass())
68MODULE_PASS("name-anon-globals", NameAnonGlobalPass())
69MODULE_PASS("no-op-module", NoOpModulePass())
70MODULE_PASS("partial-inliner", PartialInlinerPass())
71MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion())
72MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen())
73MODULE_PASS("pgo-instr-use", PGOInstrumentationUse())
74MODULE_PASS("pre-isel-intrinsic-lowering", PreISelIntrinsicLoweringPass())
75MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs()))
76MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs()))
77MODULE_PASS("print", PrintModulePass(dbgs()))
78MODULE_PASS("print-lcg", LazyCallGraphPrinterPass(dbgs()))
79MODULE_PASS("print-lcg-dot", LazyCallGraphDOTPrinterPass(dbgs()))
80MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs()))
81MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC())
82MODULE_PASS("rewrite-symbols", RewriteSymbolPass())
83MODULE_PASS("rpo-functionattrs", ReversePostOrderFunctionAttrsPass())
84MODULE_PASS("sample-profile", SampleProfileLoaderPass())
85MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
86MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation())
87MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass(nullptr, nullptr))
88MODULE_PASS("verify", VerifierPass())
89MODULE_PASS("asan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/false, false, true, false))
90MODULE_PASS("msan-module", MemorySanitizerPass({}))
91MODULE_PASS("tsan-module", ThreadSanitizerPass())
92MODULE_PASS("kasan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/true, false, true, false))
93MODULE_PASS("sancov-module", ModuleSanitizerCoveragePass())
94MODULE_PASS("poison-checking", PoisonCheckingPass())
95#undef MODULE_PASS
96
97#ifndef CGSCC_ANALYSIS
98#define CGSCC_ANALYSIS(NAME, CREATE_PASS)
99#endif
100CGSCC_ANALYSIS("no-op-cgscc", NoOpCGSCCAnalysis())
101CGSCC_ANALYSIS("fam-proxy", FunctionAnalysisManagerCGSCCProxy())
102CGSCC_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
103#undef CGSCC_ANALYSIS
104
105#ifndef CGSCC_PASS
106#define CGSCC_PASS(NAME, CREATE_PASS)
107#endif
108CGSCC_PASS("argpromotion", ArgumentPromotionPass())
109CGSCC_PASS("invalidate<all>", InvalidateAllAnalysesPass())
110CGSCC_PASS("function-attrs", PostOrderFunctionAttrsPass())
111CGSCC_PASS("inline", InlinerPass())
112CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass())
113#undef CGSCC_PASS
114
115#ifndef FUNCTION_ANALYSIS
116#define FUNCTION_ANALYSIS(NAME, CREATE_PASS)
117#endif
118FUNCTION_ANALYSIS("aa", AAManager())
119FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis())
120FUNCTION_ANALYSIS("block-freq", BlockFrequencyAnalysis())
121FUNCTION_ANALYSIS("branch-prob", BranchProbabilityAnalysis())
122FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis())
123FUNCTION_ANALYSIS("postdomtree", PostDominatorTreeAnalysis())
124FUNCTION_ANALYSIS("demanded-bits", DemandedBitsAnalysis())
125FUNCTION_ANALYSIS("domfrontier", DominanceFrontierAnalysis())
126FUNCTION_ANALYSIS("loops", LoopAnalysis())
127FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis())
128FUNCTION_ANALYSIS("da", DependenceAnalysis())
129FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis())
130FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis())
131FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis())
132FUNCTION_ANALYSIS("regions", RegionInfoAnalysis())
133FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis())
134FUNCTION_ANALYSIS("opt-remark-emit", OptimizationRemarkEmitterAnalysis())
135FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis())
136FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis())
137FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
138FUNCTION_ANALYSIS("targetir",
139                  TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis())
140FUNCTION_ANALYSIS("verify", VerifierAnalysis())
141FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
142
143#ifndef FUNCTION_ALIAS_ANALYSIS
144#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS)                             \
145  FUNCTION_ANALYSIS(NAME, CREATE_PASS)
146#endif
147FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA())
148FUNCTION_ALIAS_ANALYSIS("cfl-anders-aa", CFLAndersAA())
149FUNCTION_ALIAS_ANALYSIS("cfl-steens-aa", CFLSteensAA())
150FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA())
151FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA())
152FUNCTION_ALIAS_ANALYSIS("type-based-aa", TypeBasedAA())
153#undef FUNCTION_ALIAS_ANALYSIS
154#undef FUNCTION_ANALYSIS
155
156#ifndef FUNCTION_PASS
157#define FUNCTION_PASS(NAME, CREATE_PASS)
158#endif
159FUNCTION_PASS("aa-eval", AAEvaluator())
160FUNCTION_PASS("adce", ADCEPass())
161FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass())
162FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass())
163FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass())
164FUNCTION_PASS("bdce", BDCEPass())
165FUNCTION_PASS("bounds-checking", BoundsCheckingPass())
166FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass())
167FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass())
168FUNCTION_PASS("consthoist", ConstantHoistingPass())
169FUNCTION_PASS("chr", ControlHeightReductionPass())
170FUNCTION_PASS("correlated-propagation", CorrelatedValuePropagationPass())
171FUNCTION_PASS("dce", DCEPass())
172FUNCTION_PASS("div-rem-pairs", DivRemPairsPass())
173FUNCTION_PASS("dse", DSEPass())
174FUNCTION_PASS("dot-cfg", CFGPrinterPass())
175FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass())
176FUNCTION_PASS("early-cse", EarlyCSEPass(/*UseMemorySSA=*/false))
177FUNCTION_PASS("early-cse-memssa", EarlyCSEPass(/*UseMemorySSA=*/true))
178FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass(/*PostInlining=*/false))
179FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
180FUNCTION_PASS("post-inline-ee-instrument", EntryExitInstrumenterPass(/*PostInlining=*/true))
181FUNCTION_PASS("gvn-hoist", GVNHoistPass())
182FUNCTION_PASS("instcombine", InstCombinePass())
183FUNCTION_PASS("instsimplify", InstSimplifyPass())
184FUNCTION_PASS("invalidate<all>", InvalidateAllAnalysesPass())
185FUNCTION_PASS("float2int", Float2IntPass())
186FUNCTION_PASS("no-op-function", NoOpFunctionPass())
187FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass())
188FUNCTION_PASS("inject-tli-mappings", InjectTLIMappings())
189FUNCTION_PASS("loweratomic", LowerAtomicPass())
190FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
191FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
192FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
193FUNCTION_PASS("lower-matrix-intrinsics", LowerMatrixIntrinsicsPass())
194FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
195FUNCTION_PASS("guard-widening", GuardWideningPass())
196FUNCTION_PASS("gvn", GVN())
197FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass())
198FUNCTION_PASS("loop-simplify", LoopSimplifyPass())
199FUNCTION_PASS("loop-sink", LoopSinkPass())
200FUNCTION_PASS("lowerinvoke", LowerInvokePass())
201FUNCTION_PASS("mem2reg", PromotePass())
202FUNCTION_PASS("memcpyopt", MemCpyOptPass())
203FUNCTION_PASS("mergeicmps", MergeICmpsPass())
204FUNCTION_PASS("nary-reassociate", NaryReassociatePass())
205FUNCTION_PASS("newgvn", NewGVNPass())
206FUNCTION_PASS("jump-threading", JumpThreadingPass())
207FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass())
208FUNCTION_PASS("lcssa", LCSSAPass())
209FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass())
210FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass())
211FUNCTION_PASS("loop-fuse", LoopFusePass())
212FUNCTION_PASS("loop-distribute", LoopDistributePass())
213FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt())
214FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
215FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
216FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
217FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
218FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs()))
219FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
220FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
221FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
222FUNCTION_PASS("print<domfrontier>", DominanceFrontierPrinterPass(dbgs()))
223FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs()))
224FUNCTION_PASS("print<memoryssa>", MemorySSAPrinterPass(dbgs()))
225FUNCTION_PASS("print<phi-values>", PhiValuesPrinterPass(dbgs()))
226FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs()))
227FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs()))
228FUNCTION_PASS("print<stack-safety-local>", StackSafetyPrinterPass(dbgs()))
229FUNCTION_PASS("reassociate", ReassociatePass())
230FUNCTION_PASS("scalarizer", ScalarizerPass())
231FUNCTION_PASS("sccp", SCCPPass())
232FUNCTION_PASS("sink", SinkingPass())
233FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass())
234FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass())
235FUNCTION_PASS("spec-phis", SpeculateAroundPHIsPass())
236FUNCTION_PASS("sroa", SROA())
237FUNCTION_PASS("tailcallelim", TailCallElimPass())
238FUNCTION_PASS("unreachableblockelim", UnreachableBlockElimPass())
239FUNCTION_PASS("unroll-and-jam", LoopUnrollAndJamPass())
240FUNCTION_PASS("verify", VerifierPass())
241FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass())
242FUNCTION_PASS("verify<loops>", LoopVerifierPass())
243FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
244FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
245FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass())
246FUNCTION_PASS("verify<scalar-evolution>", ScalarEvolutionVerifierPass())
247FUNCTION_PASS("view-cfg", CFGViewerPass())
248FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
249FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
250FUNCTION_PASS("asan", AddressSanitizerPass(false, false, false))
251FUNCTION_PASS("kasan", AddressSanitizerPass(true, false, false))
252FUNCTION_PASS("msan", MemorySanitizerPass({}))
253FUNCTION_PASS("kmsan", MemorySanitizerPass({0, false, /*Kernel=*/true}))
254FUNCTION_PASS("tsan", ThreadSanitizerPass())
255#undef FUNCTION_PASS
256
257#ifndef FUNCTION_PASS_WITH_PARAMS
258#define FUNCTION_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER)
259#endif
260FUNCTION_PASS_WITH_PARAMS("unroll",
261                           [](LoopUnrollOptions Opts) {
262                             return LoopUnrollPass(Opts);
263                           },
264                           parseLoopUnrollOptions)
265FUNCTION_PASS_WITH_PARAMS("msan",
266                           [](MemorySanitizerOptions Opts) {
267                             return MemorySanitizerPass(Opts);
268                           },
269                           parseMSanPassOptions)
270FUNCTION_PASS_WITH_PARAMS("simplify-cfg",
271                           [](SimplifyCFGOptions Opts) {
272                             return SimplifyCFGPass(Opts);
273                           },
274                           parseSimplifyCFGOptions)
275FUNCTION_PASS_WITH_PARAMS("loop-vectorize",
276                           [](LoopVectorizeOptions Opts) {
277                             return LoopVectorizePass(Opts);
278                           },
279                           parseLoopVectorizeOptions)
280FUNCTION_PASS_WITH_PARAMS("mldst-motion",
281                           [](MergedLoadStoreMotionOptions Opts) {
282                             return MergedLoadStoreMotionPass(Opts);
283                           },
284                           parseMergedLoadStoreMotionOptions)
285#undef FUNCTION_PASS_WITH_PARAMS
286
287#ifndef LOOP_ANALYSIS
288#define LOOP_ANALYSIS(NAME, CREATE_PASS)
289#endif
290LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis())
291LOOP_ANALYSIS("access-info", LoopAccessAnalysis())
292LOOP_ANALYSIS("ddg", DDGAnalysis())
293LOOP_ANALYSIS("ivusers", IVUsersAnalysis())
294LOOP_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
295#undef LOOP_ANALYSIS
296
297#ifndef LOOP_PASS
298#define LOOP_PASS(NAME, CREATE_PASS)
299#endif
300LOOP_PASS("invalidate<all>", InvalidateAllAnalysesPass())
301LOOP_PASS("licm", LICMPass())
302LOOP_PASS("loop-idiom", LoopIdiomRecognizePass())
303LOOP_PASS("loop-instsimplify", LoopInstSimplifyPass())
304LOOP_PASS("rotate", LoopRotatePass())
305LOOP_PASS("no-op-loop", NoOpLoopPass())
306LOOP_PASS("print", PrintLoopPass(dbgs()))
307LOOP_PASS("loop-deletion", LoopDeletionPass())
308LOOP_PASS("simplify-cfg", LoopSimplifyCFGPass())
309LOOP_PASS("strength-reduce", LoopStrengthReducePass())
310LOOP_PASS("indvars", IndVarSimplifyPass())
311LOOP_PASS("irce", IRCEPass())
312LOOP_PASS("unroll-full", LoopFullUnrollPass())
313LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs()))
314LOOP_PASS("print<ddg>", DDGAnalysisPrinterPass(dbgs()))
315LOOP_PASS("print<ivusers>", IVUsersPrinterPass(dbgs()))
316LOOP_PASS("print<loop-cache-cost>", LoopCachePrinterPass(dbgs()))
317LOOP_PASS("loop-predication", LoopPredicationPass())
318LOOP_PASS("guard-widening", GuardWideningPass())
319#undef LOOP_PASS
320
321#ifndef LOOP_PASS_WITH_PARAMS
322#define LOOP_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER)
323#endif
324LOOP_PASS_WITH_PARAMS("unswitch",
325                           [](bool NonTrivial) {
326                             return SimpleLoopUnswitchPass(NonTrivial);
327                           },
328                           parseLoopUnswitchOptions)
329#undef LOOP_PASS_WITH_PARAMS
330