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