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