1 //===- PassRegistry.def
- Registry of passes
--------------------*- C
++ -*-===//
3 // Part of the LLVM Project
, under the Apache License v2.0 with LLVM Exceptions.
4 // See https
://llvm.org
/LICENSE.txt for license information.
5 // SPDX
-License
-Identifier
: Apache
-2.0 WITH LLVM
-exception
7 //===----------------------------------------------------------------------===//
9 // This file is used as the registry of passes that are part of the core LLVM
10 // libraries. This file describes both transformation passes and analyses
11 // Analyses are registered while transformation passes have names registered
12 // that can be used when providing a textual pass pipeline.
14 //===----------------------------------------------------------------------===//
16 // NOTE
: NO INCLUDE GUARD DESIRED
!
18 #ifndef MODULE_ANALYSIS
19 #define
MODULE_ANALYSIS(NAME
, CREATE_PASS
)
21 MODULE_ANALYSIS("callgraph", CallGraphAnalysis())
22 MODULE_ANALYSIS("lcg", LazyCallGraphAnalysis())
23 MODULE_ANALYSIS("module-summary", ModuleSummaryIndexAnalysis())
24 MODULE_ANALYSIS("no-op-module", NoOpModuleAnalysis())
25 MODULE_ANALYSIS("profile-summary", ProfileSummaryAnalysis())
26 MODULE_ANALYSIS("stack-safety", StackSafetyGlobalAnalysis())
27 MODULE_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
28 MODULE_ANALYSIS("verify", VerifierAnalysis())
29 MODULE_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
30 MODULE_ANALYSIS("asan-globals-md", ASanGlobalsMetadataAnalysis())
32 #ifndef MODULE_ALIAS_ANALYSIS
33 #define
MODULE_ALIAS_ANALYSIS(NAME
, CREATE_PASS
) \
34 MODULE_ANALYSIS(NAME
, CREATE_PASS
)
36 MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA())
37 #undef MODULE_ALIAS_ANALYSIS
38 #undef MODULE_ANALYSIS
41 #define
MODULE_PASS(NAME
, CREATE_PASS
)
43 MODULE_PASS("always-inline", AlwaysInlinerPass())
44 MODULE_PASS("called-value-propagation", CalledValuePropagationPass())
45 MODULE_PASS("canonicalize-aliases", CanonicalizeAliasesPass())
46 MODULE_PASS("cg-profile", CGProfilePass())
47 MODULE_PASS("constmerge", ConstantMergePass())
48 MODULE_PASS("cross-dso-cfi", CrossDSOCFIPass())
49 MODULE_PASS("deadargelim", DeadArgumentEliminationPass())
50 MODULE_PASS("elim-avail-extern", EliminateAvailableExternallyPass())
51 MODULE_PASS("forceattrs", ForceFunctionAttrsPass())
52 MODULE_PASS("function-import", FunctionImportPass())
53 MODULE_PASS("globaldce", GlobalDCEPass())
54 MODULE_PASS("globalopt", GlobalOptPass())
55 MODULE_PASS("globalsplit", GlobalSplitPass())
56 MODULE_PASS("hotcoldsplit", HotColdSplittingPass())
57 MODULE_PASS("inferattrs", InferFunctionAttrsPass())
58 MODULE_PASS("insert-gcov-profiling", GCOVProfilerPass())
59 MODULE_PASS("instrprof", InstrProfiling())
60 MODULE_PASS("internalize", InternalizePass())
61 MODULE_PASS("invalidate<all>", InvalidateAllAnalysesPass())
62 MODULE_PASS("ipsccp", IPSCCPPass())
63 MODULE_PASS("lowertypetests", LowerTypeTestsPass(nullptr
, nullptr
))
64 MODULE_PASS("name-anon-globals", NameAnonGlobalPass())
65 MODULE_PASS("no-op-module", NoOpModulePass())
66 MODULE_PASS("partial-inliner", PartialInlinerPass())
67 MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion())
68 MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen())
69 MODULE_PASS("pgo-instr-use", PGOInstrumentationUse())
70 MODULE_PASS("pre-isel-intrinsic-lowering", PreISelIntrinsicLoweringPass())
71 MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs()))
72 MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs()))
73 MODULE_PASS("print", PrintModulePass(dbgs()))
74 MODULE_PASS("print-lcg", LazyCallGraphPrinterPass(dbgs()))
75 MODULE_PASS("print-lcg-dot", LazyCallGraphDOTPrinterPass(dbgs()))
76 MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs()))
77 MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC())
78 MODULE_PASS("rewrite-symbols", RewriteSymbolPass())
79 MODULE_PASS("rpo-functionattrs", ReversePostOrderFunctionAttrsPass())
80 MODULE_PASS("sample-profile", SampleProfileLoaderPass())
81 MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
82 MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation())
83 MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass(nullptr
, nullptr
))
84 MODULE_PASS("verify", VerifierPass())
85 MODULE_PASS("asan-module", ModuleAddressSanitizerPass(false
, false
, true
, false
))
88 #ifndef CGSCC_ANALYSIS
89 #define
CGSCC_ANALYSIS(NAME
, CREATE_PASS
)
91 CGSCC_ANALYSIS("no-op-cgscc", NoOpCGSCCAnalysis())
92 CGSCC_ANALYSIS("fam-proxy", FunctionAnalysisManagerCGSCCProxy())
93 CGSCC_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
97 #define
CGSCC_PASS(NAME
, CREATE_PASS
)
99 CGSCC_PASS("argpromotion", ArgumentPromotionPass())
100 CGSCC_PASS("invalidate<all>", InvalidateAllAnalysesPass())
101 CGSCC_PASS("function-attrs", PostOrderFunctionAttrsPass())
102 CGSCC_PASS("inline", InlinerPass())
103 CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass())
106 #ifndef FUNCTION_ANALYSIS
107 #define
FUNCTION_ANALYSIS(NAME
, CREATE_PASS
)
109 FUNCTION_ANALYSIS("aa", AAManager())
110 FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis())
111 FUNCTION_ANALYSIS("block-freq", BlockFrequencyAnalysis())
112 FUNCTION_ANALYSIS("branch-prob", BranchProbabilityAnalysis())
113 FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis())
114 FUNCTION_ANALYSIS("postdomtree", PostDominatorTreeAnalysis())
115 FUNCTION_ANALYSIS("demanded-bits", DemandedBitsAnalysis())
116 FUNCTION_ANALYSIS("domfrontier", DominanceFrontierAnalysis())
117 FUNCTION_ANALYSIS("loops", LoopAnalysis())
118 FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis())
119 FUNCTION_ANALYSIS("da", DependenceAnalysis())
120 FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis())
121 FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis())
122 FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis())
123 FUNCTION_ANALYSIS("regions", RegionInfoAnalysis())
124 FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis())
125 FUNCTION_ANALYSIS("opt-remark-emit", OptimizationRemarkEmitterAnalysis())
126 FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis())
127 FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis())
128 FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
129 FUNCTION_ANALYSIS("targetir",
130 TM ? TM
->getTargetIRAnalysis() : TargetIRAnalysis())
131 FUNCTION_ANALYSIS("verify", VerifierAnalysis())
132 FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
134 #ifndef FUNCTION_ALIAS_ANALYSIS
135 #define
FUNCTION_ALIAS_ANALYSIS(NAME
, CREATE_PASS
) \
136 FUNCTION_ANALYSIS(NAME
, CREATE_PASS
)
138 FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA())
139 FUNCTION_ALIAS_ANALYSIS("cfl-anders-aa", CFLAndersAA())
140 FUNCTION_ALIAS_ANALYSIS("cfl-steens-aa", CFLSteensAA())
141 FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA())
142 FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA())
143 FUNCTION_ALIAS_ANALYSIS("type-based-aa", TypeBasedAA())
144 #undef FUNCTION_ALIAS_ANALYSIS
145 #undef FUNCTION_ANALYSIS
147 #ifndef FUNCTION_PASS
148 #define
FUNCTION_PASS(NAME
, CREATE_PASS
)
150 FUNCTION_PASS("aa-eval", AAEvaluator())
151 FUNCTION_PASS("adce", ADCEPass())
152 FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass())
153 FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass())
154 FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass())
155 FUNCTION_PASS("bdce", BDCEPass())
156 FUNCTION_PASS("bounds-checking", BoundsCheckingPass())
157 FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass())
158 FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass())
159 FUNCTION_PASS("consthoist", ConstantHoistingPass())
160 FUNCTION_PASS("chr", ControlHeightReductionPass())
161 FUNCTION_PASS("correlated-propagation", CorrelatedValuePropagationPass())
162 FUNCTION_PASS("dce", DCEPass())
163 FUNCTION_PASS("div-rem-pairs", DivRemPairsPass())
164 FUNCTION_PASS("dse", DSEPass())
165 FUNCTION_PASS("dot-cfg", CFGPrinterPass())
166 FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass())
167 FUNCTION_PASS("early-cse", EarlyCSEPass(/*UseMemorySSA
=*/false
))
168 FUNCTION_PASS("early-cse-memssa", EarlyCSEPass(/*UseMemorySSA
=*/true
))
169 FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass(/*PostInlining
=*/false
))
170 FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
171 FUNCTION_PASS("post-inline-ee-instrument", EntryExitInstrumenterPass(/*PostInlining
=*/true
))
172 FUNCTION_PASS("gvn-hoist", GVNHoistPass())
173 FUNCTION_PASS("instcombine", InstCombinePass())
174 FUNCTION_PASS("instsimplify", InstSimplifyPass())
175 FUNCTION_PASS("invalidate<all>", InvalidateAllAnalysesPass())
176 FUNCTION_PASS("float2int", Float2IntPass())
177 FUNCTION_PASS("no-op-function", NoOpFunctionPass())
178 FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass())
179 FUNCTION_PASS("loweratomic", LowerAtomicPass())
180 FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
181 FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
182 FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
183 FUNCTION_PASS("guard-widening", GuardWideningPass())
184 FUNCTION_PASS("gvn", GVN())
185 FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass())
186 FUNCTION_PASS("loop-simplify", LoopSimplifyPass())
187 FUNCTION_PASS("loop-sink", LoopSinkPass())
188 FUNCTION_PASS("lowerinvoke", LowerInvokePass())
189 FUNCTION_PASS("mem2reg", PromotePass())
190 FUNCTION_PASS("memcpyopt", MemCpyOptPass())
191 FUNCTION_PASS("mldst-motion", MergedLoadStoreMotionPass())
192 FUNCTION_PASS("nary-reassociate", NaryReassociatePass())
193 FUNCTION_PASS("newgvn", NewGVNPass())
194 FUNCTION_PASS("jump-threading", JumpThreadingPass())
195 FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass())
196 FUNCTION_PASS("lcssa", LCSSAPass())
197 FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass())
198 FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass())
199 FUNCTION_PASS("loop-distribute", LoopDistributePass())
200 FUNCTION_PASS("loop-vectorize", LoopVectorizePass())
201 FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt())
202 FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
203 FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs()))
204 FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs()))
205 FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs()))
206 FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs()))
207 FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs()))
208 FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs()))
209 FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
210 FUNCTION_PASS("print<domfrontier>", DominanceFrontierPrinterPass(dbgs()))
211 FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs()))
212 FUNCTION_PASS("print<memoryssa>", MemorySSAPrinterPass(dbgs()))
213 FUNCTION_PASS("print<phi-values>", PhiValuesPrinterPass(dbgs()))
214 FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs()))
215 FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs()))
216 FUNCTION_PASS("print<stack-safety-local>", StackSafetyPrinterPass(dbgs()))
217 FUNCTION_PASS("reassociate", ReassociatePass())
218 FUNCTION_PASS("scalarizer", ScalarizerPass())
219 FUNCTION_PASS("sccp", SCCPPass())
220 FUNCTION_PASS("simplify-cfg", SimplifyCFGPass())
221 FUNCTION_PASS("sink", SinkingPass())
222 FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass())
223 FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass())
224 FUNCTION_PASS("spec-phis", SpeculateAroundPHIsPass())
225 FUNCTION_PASS("sroa", SROA())
226 FUNCTION_PASS("tailcallelim", TailCallElimPass())
227 FUNCTION_PASS("unreachableblockelim", UnreachableBlockElimPass())
228 FUNCTION_PASS("verify", VerifierPass())
229 FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass())
230 FUNCTION_PASS("verify<loops>", LoopVerifierPass())
231 FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
232 FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
233 FUNCTION_PASS("view-cfg", CFGViewerPass())
234 FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
235 FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
236 FUNCTION_PASS("asan", AddressSanitizerPass(false
, false
, false
))
237 FUNCTION_PASS("msan", MemorySanitizerPass({}))
238 FUNCTION_PASS("tsan", ThreadSanitizerPass())
241 #ifndef FUNCTION_PASS_WITH_PARAMS
242 #define
FUNCTION_PASS_WITH_PARAMS(NAME
, CREATE_PASS
, PARSER
)
244 FUNCTION_PASS_WITH_PARAMS("unroll",
245 [](LoopUnrollOptions Opts
) {
246 return
LoopUnrollPass(Opts
);
248 parseLoopUnrollOptions
)
249 FUNCTION_PASS_WITH_PARAMS("msan",
250 [](MemorySanitizerOptions Opts
) {
251 return
MemorySanitizerPass(Opts
);
253 parseMSanPassOptions
)
254 #undef FUNCTION_PASS_WITH_PARAMS
256 #ifndef LOOP_ANALYSIS
257 #define
LOOP_ANALYSIS(NAME
, CREATE_PASS
)
259 LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis())
260 LOOP_ANALYSIS("access-info", LoopAccessAnalysis())
261 LOOP_ANALYSIS("ivusers", IVUsersAnalysis())
262 LOOP_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC
))
266 #define
LOOP_PASS(NAME
, CREATE_PASS
)
268 LOOP_PASS("invalidate<all>", InvalidateAllAnalysesPass())
269 LOOP_PASS("licm", LICMPass())
270 LOOP_PASS("loop-idiom", LoopIdiomRecognizePass())
271 LOOP_PASS("loop-instsimplify", LoopInstSimplifyPass())
272 LOOP_PASS("rotate", LoopRotatePass())
273 LOOP_PASS("no-op-loop", NoOpLoopPass())
274 LOOP_PASS("print", PrintLoopPass(dbgs()))
275 LOOP_PASS("loop-deletion", LoopDeletionPass())
276 LOOP_PASS("simplify-cfg", LoopSimplifyCFGPass())
277 LOOP_PASS("strength-reduce", LoopStrengthReducePass())
278 LOOP_PASS("indvars", IndVarSimplifyPass())
279 LOOP_PASS("irce", IRCEPass())
280 LOOP_PASS("unroll-and-jam", LoopUnrollAndJamPass())
281 LOOP_PASS("unroll-full", LoopFullUnrollPass())
282 LOOP_PASS("unswitch", SimpleLoopUnswitchPass())
283 LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs()))
284 LOOP_PASS("print<ivusers>", IVUsersPrinterPass(dbgs()))
285 LOOP_PASS("loop-predication", LoopPredicationPass())