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("inline-advisor", InlineAdvisorAnalysis()) 30MODULE_ANALYSIS("ir-similarity", IRSimilarityAnalysis()) 31 32#ifndef MODULE_ALIAS_ANALYSIS 33#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ 34 MODULE_ANALYSIS(NAME, CREATE_PASS) 35#endif 36MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA()) 37#undef MODULE_ALIAS_ANALYSIS 38#undef MODULE_ANALYSIS 39 40#ifndef MODULE_PASS 41#define MODULE_PASS(NAME, CREATE_PASS) 42#endif 43MODULE_PASS("always-inline", AlwaysInlinerPass()) 44MODULE_PASS("attributor", AttributorPass()) 45MODULE_PASS("annotation2metadata", Annotation2MetadataPass()) 46MODULE_PASS("openmp-opt", OpenMPOptPass()) 47MODULE_PASS("called-value-propagation", CalledValuePropagationPass()) 48MODULE_PASS("canonicalize-aliases", CanonicalizeAliasesPass()) 49MODULE_PASS("cg-profile", CGProfilePass()) 50MODULE_PASS("check-debugify", NewPMCheckDebugifyPass()) 51MODULE_PASS("constmerge", ConstantMergePass()) 52MODULE_PASS("coro-early", CoroEarlyPass()) 53MODULE_PASS("coro-cleanup", CoroCleanupPass()) 54MODULE_PASS("cross-dso-cfi", CrossDSOCFIPass()) 55MODULE_PASS("deadargelim", DeadArgumentEliminationPass()) 56MODULE_PASS("debugify", NewPMDebugifyPass()) 57MODULE_PASS("dot-callgraph", CallGraphDOTPrinterPass()) 58MODULE_PASS("elim-avail-extern", EliminateAvailableExternallyPass()) 59MODULE_PASS("extract-blocks", BlockExtractorPass()) 60MODULE_PASS("forceattrs", ForceFunctionAttrsPass()) 61MODULE_PASS("function-import", FunctionImportPass()) 62MODULE_PASS("function-specialization", FunctionSpecializationPass()) 63MODULE_PASS("globaldce", GlobalDCEPass()) 64MODULE_PASS("globalopt", GlobalOptPass()) 65MODULE_PASS("globalsplit", GlobalSplitPass()) 66MODULE_PASS("hotcoldsplit", HotColdSplittingPass()) 67MODULE_PASS("inferattrs", InferFunctionAttrsPass()) 68MODULE_PASS("inliner-wrapper", ModuleInlinerWrapperPass()) 69MODULE_PASS("inliner-ml-advisor-release", ModuleInlinerWrapperPass(getInlineParams(), true, {}, InliningAdvisorMode::Release, 0)) 70MODULE_PASS("print<inline-advisor>", InlineAdvisorAnalysisPrinterPass(dbgs())) 71MODULE_PASS("inliner-wrapper-no-mandatory-first", ModuleInlinerWrapperPass( 72 getInlineParams(), 73 false)) 74MODULE_PASS("insert-gcov-profiling", GCOVProfilerPass()) 75MODULE_PASS("instrorderfile", InstrOrderFilePass()) 76MODULE_PASS("instrprof", InstrProfiling()) 77MODULE_PASS("internalize", InternalizePass()) 78MODULE_PASS("invalidate<all>", InvalidateAllAnalysesPass()) 79MODULE_PASS("ipsccp", IPSCCPPass()) 80MODULE_PASS("iroutliner", IROutlinerPass()) 81MODULE_PASS("print-ir-similarity", IRSimilarityAnalysisPrinterPass(dbgs())) 82MODULE_PASS("lower-global-dtors", LowerGlobalDtorsPass()) 83MODULE_PASS("lowertypetests", LowerTypeTestsPass()) 84MODULE_PASS("metarenamer", MetaRenamerPass()) 85MODULE_PASS("mergefunc", MergeFunctionsPass()) 86MODULE_PASS("name-anon-globals", NameAnonGlobalPass()) 87MODULE_PASS("no-op-module", NoOpModulePass()) 88MODULE_PASS("objc-arc-apelim", ObjCARCAPElimPass()) 89MODULE_PASS("partial-inliner", PartialInlinerPass()) 90MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion()) 91MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen()) 92MODULE_PASS("pgo-instr-use", PGOInstrumentationUse()) 93MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs())) 94MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs())) 95MODULE_PASS("print", PrintModulePass(dbgs())) 96MODULE_PASS("print-lcg", LazyCallGraphPrinterPass(dbgs())) 97MODULE_PASS("print-lcg-dot", LazyCallGraphDOTPrinterPass(dbgs())) 98MODULE_PASS("print-must-be-executed-contexts", MustBeExecutedContextPrinterPass(dbgs())) 99MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs())) 100MODULE_PASS("print<module-debuginfo>", ModuleDebugInfoPrinterPass(dbgs())) 101MODULE_PASS("recompute-globalsaa", RecomputeGlobalsAAPass()) 102MODULE_PASS("rel-lookup-table-converter", RelLookupTableConverterPass()) 103MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC()) 104MODULE_PASS("rewrite-symbols", RewriteSymbolPass()) 105MODULE_PASS("rpo-function-attrs", ReversePostOrderFunctionAttrsPass()) 106MODULE_PASS("sample-profile", SampleProfileLoaderPass()) 107MODULE_PASS("scc-oz-module-inliner", 108 buildInlinerPipeline(OptimizationLevel::Oz, ThinOrFullLTOPhase::None)) 109MODULE_PASS("strip", StripSymbolsPass()) 110MODULE_PASS("strip-dead-debug-info", StripDeadDebugInfoPass()) 111MODULE_PASS("pseudo-probe", SampleProfileProbePass(TM)) 112MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass()) 113MODULE_PASS("strip-debug-declare", StripDebugDeclarePass()) 114MODULE_PASS("strip-nondebug", StripNonDebugSymbolsPass()) 115MODULE_PASS("strip-nonlinetable-debuginfo", StripNonLineTableDebugInfoPass()) 116MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation()) 117MODULE_PASS("trigger-crash", TriggerCrashPass()) 118MODULE_PASS("verify", VerifierPass()) 119MODULE_PASS("view-callgraph", CallGraphViewerPass()) 120MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass()) 121MODULE_PASS("dfsan", DataFlowSanitizerPass()) 122MODULE_PASS("msan-module", ModuleMemorySanitizerPass({})) 123MODULE_PASS("module-inline", ModuleInlinerPass()) 124MODULE_PASS("tsan-module", ModuleThreadSanitizerPass()) 125MODULE_PASS("sancov-module", ModuleSanitizerCoveragePass()) 126MODULE_PASS("memprof-module", ModuleMemProfilerPass()) 127MODULE_PASS("poison-checking", PoisonCheckingPass()) 128MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass()) 129#undef MODULE_PASS 130 131#ifndef MODULE_PASS_WITH_PARAMS 132#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) 133#endif 134MODULE_PASS_WITH_PARAMS("loop-extract", 135 "LoopExtractorPass", 136 [](bool Single) { 137 if (Single) 138 return LoopExtractorPass(1); 139 return LoopExtractorPass(); 140 }, 141 parseLoopExtractorPassOptions, 142 "single") 143MODULE_PASS_WITH_PARAMS("hwasan", 144 "HWAddressSanitizerPass", 145 [](HWAddressSanitizerOptions Opts) { 146 return HWAddressSanitizerPass(Opts); 147 }, 148 parseHWASanPassOptions, 149 "kernel;recover") 150MODULE_PASS_WITH_PARAMS("asan-module", 151 "ModuleAddressSanitizerPass", 152 [](AddressSanitizerOptions Opts) { 153 return ModuleAddressSanitizerPass(Opts); 154 }, 155 parseASanPassOptions, 156 "kernel") 157#undef MODULE_PASS_WITH_PARAMS 158 159#ifndef CGSCC_ANALYSIS 160#define CGSCC_ANALYSIS(NAME, CREATE_PASS) 161#endif 162CGSCC_ANALYSIS("no-op-cgscc", NoOpCGSCCAnalysis()) 163CGSCC_ANALYSIS("fam-proxy", FunctionAnalysisManagerCGSCCProxy()) 164CGSCC_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) 165#undef CGSCC_ANALYSIS 166 167#ifndef CGSCC_PASS 168#define CGSCC_PASS(NAME, CREATE_PASS) 169#endif 170CGSCC_PASS("argpromotion", ArgumentPromotionPass()) 171CGSCC_PASS("invalidate<all>", InvalidateAllAnalysesPass()) 172CGSCC_PASS("function-attrs", PostOrderFunctionAttrsPass()) 173CGSCC_PASS("attributor-cgscc", AttributorCGSCCPass()) 174CGSCC_PASS("openmp-opt-cgscc", OpenMPOptCGSCCPass()) 175CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass()) 176#undef CGSCC_PASS 177 178#ifndef CGSCC_PASS_WITH_PARAMS 179#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) 180#endif 181CGSCC_PASS_WITH_PARAMS("inline", 182 "InlinerPass", 183 [](bool OnlyMandatory) { 184 return InlinerPass(OnlyMandatory); 185 }, 186 parseInlinerPassOptions, 187 "only-mandatory") 188CGSCC_PASS_WITH_PARAMS("coro-split", 189 "CoroSplitPass", 190 [](bool OptimizeFrame) { 191 return CoroSplitPass(OptimizeFrame); 192 }, 193 parseCoroSplitPassOptions, 194 "reuse-storage") 195#undef CGSCC_PASS_WITH_PARAMS 196 197#ifndef FUNCTION_ANALYSIS 198#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) 199#endif 200FUNCTION_ANALYSIS("aa", AAManager()) 201FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis()) 202FUNCTION_ANALYSIS("block-freq", BlockFrequencyAnalysis()) 203FUNCTION_ANALYSIS("branch-prob", BranchProbabilityAnalysis()) 204FUNCTION_ANALYSIS("cycles", CycleAnalysis()) 205FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis()) 206FUNCTION_ANALYSIS("postdomtree", PostDominatorTreeAnalysis()) 207FUNCTION_ANALYSIS("demanded-bits", DemandedBitsAnalysis()) 208FUNCTION_ANALYSIS("domfrontier", DominanceFrontierAnalysis()) 209FUNCTION_ANALYSIS("func-properties", FunctionPropertiesAnalysis()) 210FUNCTION_ANALYSIS("loops", LoopAnalysis()) 211FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis()) 212FUNCTION_ANALYSIS("da", DependenceAnalysis()) 213FUNCTION_ANALYSIS("inliner-size-estimator", InlineSizeEstimatorAnalysis()) 214FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis()) 215FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis()) 216FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis()) 217FUNCTION_ANALYSIS("regions", RegionInfoAnalysis()) 218FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis()) 219FUNCTION_ANALYSIS("opt-remark-emit", OptimizationRemarkEmitterAnalysis()) 220FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis()) 221FUNCTION_ANALYSIS("should-not-run-function-passes", ShouldNotRunFunctionPassesAnalysis()) 222FUNCTION_ANALYSIS("should-run-extra-vector-passes", ShouldRunExtraVectorPasses()) 223FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis()) 224FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis()) 225FUNCTION_ANALYSIS("targetir", 226 TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis()) 227FUNCTION_ANALYSIS("verify", VerifierAnalysis()) 228FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) 229FUNCTION_ANALYSIS("divergence", DivergenceAnalysis()) 230 231#ifndef FUNCTION_ALIAS_ANALYSIS 232#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ 233 FUNCTION_ANALYSIS(NAME, CREATE_PASS) 234#endif 235FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA()) 236FUNCTION_ALIAS_ANALYSIS("cfl-anders-aa", CFLAndersAA()) 237FUNCTION_ALIAS_ANALYSIS("cfl-steens-aa", CFLSteensAA()) 238FUNCTION_ALIAS_ANALYSIS("objc-arc-aa", objcarc::ObjCARCAA()) 239FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA()) 240FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA()) 241FUNCTION_ALIAS_ANALYSIS("tbaa", TypeBasedAA()) 242#undef FUNCTION_ALIAS_ANALYSIS 243#undef FUNCTION_ANALYSIS 244 245#ifndef FUNCTION_PASS 246#define FUNCTION_PASS(NAME, CREATE_PASS) 247#endif 248FUNCTION_PASS("aa-eval", AAEvaluator()) 249FUNCTION_PASS("adce", ADCEPass()) 250FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass()) 251FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass()) 252FUNCTION_PASS("assume-builder", AssumeBuilderPass()) 253FUNCTION_PASS("assume-simplify", AssumeSimplifyPass()) 254FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass()) 255FUNCTION_PASS("annotation-remarks", AnnotationRemarksPass()) 256FUNCTION_PASS("bdce", BDCEPass()) 257FUNCTION_PASS("bounds-checking", BoundsCheckingPass()) 258FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass()) 259FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass()) 260FUNCTION_PASS("consthoist", ConstantHoistingPass()) 261FUNCTION_PASS("constraint-elimination", ConstraintEliminationPass()) 262FUNCTION_PASS("chr", ControlHeightReductionPass()) 263FUNCTION_PASS("coro-elide", CoroElidePass()) 264FUNCTION_PASS("correlated-propagation", CorrelatedValuePropagationPass()) 265FUNCTION_PASS("dce", DCEPass()) 266FUNCTION_PASS("dfa-jump-threading", DFAJumpThreadingPass()) 267FUNCTION_PASS("div-rem-pairs", DivRemPairsPass()) 268FUNCTION_PASS("dse", DSEPass()) 269FUNCTION_PASS("dot-cfg", CFGPrinterPass()) 270FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass()) 271FUNCTION_PASS("dot-dom", DomPrinter()) 272FUNCTION_PASS("dot-dom-only", DomOnlyPrinter()) 273FUNCTION_PASS("dot-post-dom", PostDomPrinter()) 274FUNCTION_PASS("dot-post-dom-only", PostDomOnlyPrinter()) 275FUNCTION_PASS("view-dom", DomViewer()) 276FUNCTION_PASS("view-dom-only", DomOnlyViewer()) 277FUNCTION_PASS("view-post-dom", PostDomViewer()) 278FUNCTION_PASS("view-post-dom-only", PostDomOnlyViewer()) 279FUNCTION_PASS("fix-irreducible", FixIrreduciblePass()) 280FUNCTION_PASS("flattencfg", FlattenCFGPass()) 281FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass()) 282FUNCTION_PASS("gvn-hoist", GVNHoistPass()) 283FUNCTION_PASS("gvn-sink", GVNSinkPass()) 284FUNCTION_PASS("helloworld", HelloWorldPass()) 285FUNCTION_PASS("infer-address-spaces", InferAddressSpacesPass()) 286FUNCTION_PASS("instcombine", InstCombinePass()) 287FUNCTION_PASS("instcount", InstCountPass()) 288FUNCTION_PASS("instsimplify", InstSimplifyPass()) 289FUNCTION_PASS("invalidate<all>", InvalidateAllAnalysesPass()) 290FUNCTION_PASS("irce", IRCEPass()) 291FUNCTION_PASS("float2int", Float2IntPass()) 292FUNCTION_PASS("no-op-function", NoOpFunctionPass()) 293FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass()) 294FUNCTION_PASS("lint", LintPass()) 295FUNCTION_PASS("inject-tli-mappings", InjectTLIMappings()) 296FUNCTION_PASS("instnamer", InstructionNamerPass()) 297FUNCTION_PASS("loweratomic", LowerAtomicPass()) 298FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass()) 299FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass()) 300FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass()) 301FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass()) 302FUNCTION_PASS("guard-widening", GuardWideningPass()) 303FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass()) 304FUNCTION_PASS("loop-simplify", LoopSimplifyPass()) 305FUNCTION_PASS("loop-sink", LoopSinkPass()) 306FUNCTION_PASS("lowerinvoke", LowerInvokePass()) 307FUNCTION_PASS("lowerswitch", LowerSwitchPass()) 308FUNCTION_PASS("mem2reg", PromotePass()) 309FUNCTION_PASS("memcpyopt", MemCpyOptPass()) 310FUNCTION_PASS("mergeicmps", MergeICmpsPass()) 311FUNCTION_PASS("mergereturn", UnifyFunctionExitNodesPass()) 312FUNCTION_PASS("nary-reassociate", NaryReassociatePass()) 313FUNCTION_PASS("newgvn", NewGVNPass()) 314FUNCTION_PASS("jump-threading", JumpThreadingPass()) 315FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass()) 316FUNCTION_PASS("lcssa", LCSSAPass()) 317FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass()) 318FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass()) 319FUNCTION_PASS("loop-fusion", LoopFusePass()) 320FUNCTION_PASS("loop-distribute", LoopDistributePass()) 321FUNCTION_PASS("loop-versioning", LoopVersioningPass()) 322FUNCTION_PASS("objc-arc", ObjCARCOptPass()) 323FUNCTION_PASS("objc-arc-contract", ObjCARCContractPass()) 324FUNCTION_PASS("objc-arc-expand", ObjCARCExpandPass()) 325FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt()) 326FUNCTION_PASS("print", PrintFunctionPass(dbgs())) 327FUNCTION_PASS("print<assumptions>", AssumptionPrinterPass(dbgs())) 328FUNCTION_PASS("print<block-freq>", BlockFrequencyPrinterPass(dbgs())) 329FUNCTION_PASS("print<branch-prob>", BranchProbabilityPrinterPass(dbgs())) 330FUNCTION_PASS("print<cost-model>", CostModelPrinterPass(dbgs())) 331FUNCTION_PASS("print<cycles>", CycleInfoPrinterPass(dbgs())) 332FUNCTION_PASS("print<da>", DependenceAnalysisPrinterPass(dbgs())) 333FUNCTION_PASS("print<divergence>", DivergenceAnalysisPrinterPass(dbgs())) 334FUNCTION_PASS("print<domtree>", DominatorTreePrinterPass(dbgs())) 335FUNCTION_PASS("print<postdomtree>", PostDominatorTreePrinterPass(dbgs())) 336FUNCTION_PASS("print<delinearization>", DelinearizationPrinterPass(dbgs())) 337FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs())) 338FUNCTION_PASS("print<domfrontier>", DominanceFrontierPrinterPass(dbgs())) 339FUNCTION_PASS("print<func-properties>", FunctionPropertiesPrinterPass(dbgs())) 340FUNCTION_PASS("print<inline-cost>", InlineCostAnnotationPrinterPass(dbgs())) 341FUNCTION_PASS("print<inliner-size-estimator>", 342 InlineSizeEstimatorAnalysisPrinterPass(dbgs())) 343FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs())) 344FUNCTION_PASS("print<memoryssa>", MemorySSAPrinterPass(dbgs())) 345FUNCTION_PASS("print<memoryssa-walker>", MemorySSAWalkerPrinterPass(dbgs())) 346FUNCTION_PASS("print<phi-values>", PhiValuesPrinterPass(dbgs())) 347FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs())) 348FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs())) 349FUNCTION_PASS("print<stack-safety-local>", StackSafetyPrinterPass(dbgs())) 350// TODO: rename to print<foo> after NPM switch 351FUNCTION_PASS("print-alias-sets", AliasSetsPrinterPass(dbgs())) 352FUNCTION_PASS("print-predicateinfo", PredicateInfoPrinterPass(dbgs())) 353FUNCTION_PASS("print-mustexecute", MustExecutePrinterPass(dbgs())) 354FUNCTION_PASS("print-memderefs", MemDerefPrinterPass(dbgs())) 355FUNCTION_PASS("reassociate", ReassociatePass()) 356FUNCTION_PASS("redundant-dbg-inst-elim", RedundantDbgInstEliminationPass()) 357FUNCTION_PASS("reg2mem", RegToMemPass()) 358FUNCTION_PASS("scalarize-masked-mem-intrin", ScalarizeMaskedMemIntrinPass()) 359FUNCTION_PASS("scalarizer", ScalarizerPass()) 360FUNCTION_PASS("separate-const-offset-from-gep", SeparateConstOffsetFromGEPPass()) 361FUNCTION_PASS("sccp", SCCPPass()) 362FUNCTION_PASS("sink", SinkingPass()) 363FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass()) 364FUNCTION_PASS("slsr", StraightLineStrengthReducePass()) 365FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass()) 366FUNCTION_PASS("sroa", SROAPass()) 367FUNCTION_PASS("strip-gc-relocates", StripGCRelocates()) 368FUNCTION_PASS("structurizecfg", StructurizeCFGPass()) 369FUNCTION_PASS("tailcallelim", TailCallElimPass()) 370FUNCTION_PASS("unify-loop-exits", UnifyLoopExitsPass()) 371FUNCTION_PASS("vector-combine", VectorCombinePass()) 372FUNCTION_PASS("verify", VerifierPass()) 373FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass()) 374FUNCTION_PASS("verify<loops>", LoopVerifierPass()) 375FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass()) 376FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass()) 377FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass()) 378FUNCTION_PASS("verify<scalar-evolution>", ScalarEvolutionVerifierPass()) 379FUNCTION_PASS("view-cfg", CFGViewerPass()) 380FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass()) 381FUNCTION_PASS("tlshoist", TLSVariableHoistPass()) 382FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass()) 383FUNCTION_PASS("tsan", ThreadSanitizerPass()) 384FUNCTION_PASS("memprof", MemProfilerPass()) 385#undef FUNCTION_PASS 386 387#ifndef FUNCTION_PASS_WITH_PARAMS 388#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) 389#endif 390FUNCTION_PASS_WITH_PARAMS("early-cse", 391 "EarlyCSEPass", 392 [](bool UseMemorySSA) { 393 return EarlyCSEPass(UseMemorySSA); 394 }, 395 parseEarlyCSEPassOptions, 396 "memssa") 397FUNCTION_PASS_WITH_PARAMS("ee-instrument", 398 "EntryExitInstrumenterPass", 399 [](bool PostInlining) { 400 return EntryExitInstrumenterPass(PostInlining); 401 }, 402 parseEntryExitInstrumenterPassOptions, 403 "post-inline") 404FUNCTION_PASS_WITH_PARAMS("lower-matrix-intrinsics", 405 "LowerMatrixIntrinsicsPass", 406 [](bool Minimal) { 407 return LowerMatrixIntrinsicsPass(Minimal); 408 }, 409 parseLowerMatrixIntrinsicsPassOptions, 410 "minimal") 411FUNCTION_PASS_WITH_PARAMS("loop-unroll", 412 "LoopUnrollPass", 413 [](LoopUnrollOptions Opts) { 414 return LoopUnrollPass(Opts); 415 }, 416 parseLoopUnrollOptions, 417 "O0;O1;O2;O3;full-unroll-max=N;" 418 "no-partial;partial;" 419 "no-peeling;peeling;" 420 "no-profile-peeling;profile-peeling;" 421 "no-runtime;runtime;" 422 "no-upperbound;upperbound") 423FUNCTION_PASS_WITH_PARAMS("msan", 424 "MemorySanitizerPass", 425 [](MemorySanitizerOptions Opts) { 426 return MemorySanitizerPass(Opts); 427 }, 428 parseMSanPassOptions, 429 "recover;kernel;eager-checks;track-origins=N") 430FUNCTION_PASS_WITH_PARAMS("simplifycfg", 431 "SimplifyCFGPass", 432 [](SimplifyCFGOptions Opts) { 433 return SimplifyCFGPass(Opts); 434 }, 435 parseSimplifyCFGOptions, 436 "no-forward-switch-cond;forward-switch-cond;" 437 "no-switch-range-to-icmp;switch-range-to-icmp;" 438 "no-switch-to-lookup;switch-to-lookup;" 439 "no-keep-loops;keep-loops;" 440 "no-hoist-common-insts;hoist-common-insts;" 441 "no-sink-common-insts;sink-common-insts;" 442 "bonus-inst-threshold=N" 443 ) 444FUNCTION_PASS_WITH_PARAMS("loop-vectorize", 445 "LoopVectorizePass", 446 [](LoopVectorizeOptions Opts) { 447 return LoopVectorizePass(Opts); 448 }, 449 parseLoopVectorizeOptions, 450 "no-interleave-forced-only;interleave-forced-only;" 451 "no-vectorize-forced-only;vectorize-forced-only") 452FUNCTION_PASS_WITH_PARAMS("mldst-motion", 453 "MergedLoadStoreMotionPass", 454 [](MergedLoadStoreMotionOptions Opts) { 455 return MergedLoadStoreMotionPass(Opts); 456 }, 457 parseMergedLoadStoreMotionOptions, 458 "no-split-footer-bb;split-footer-bb") 459FUNCTION_PASS_WITH_PARAMS("gvn", 460 "GVNPass", 461 [](GVNOptions Opts) { 462 return GVNPass(Opts); 463 }, 464 parseGVNOptions, 465 "no-pre;pre;" 466 "no-load-pre;load-pre;" 467 "no-split-backedge-load-pre;split-backedge-load-pre;" 468 "no-memdep;memdep") 469FUNCTION_PASS_WITH_PARAMS("print<stack-lifetime>", 470 "StackLifetimePrinterPass", 471 [](StackLifetime::LivenessType Type) { 472 return StackLifetimePrinterPass(dbgs(), Type); 473 }, 474 parseStackLifetimeOptions, 475 "may;must") 476#undef FUNCTION_PASS_WITH_PARAMS 477 478#ifndef LOOPNEST_PASS 479#define LOOPNEST_PASS(NAME, CREATE_PASS) 480#endif 481LOOPNEST_PASS("loop-flatten", LoopFlattenPass()) 482LOOPNEST_PASS("loop-interchange", LoopInterchangePass()) 483LOOPNEST_PASS("loop-unroll-and-jam", LoopUnrollAndJamPass()) 484LOOPNEST_PASS("no-op-loopnest", NoOpLoopNestPass()) 485#undef LOOPNEST_PASS 486 487#ifndef LOOP_ANALYSIS 488#define LOOP_ANALYSIS(NAME, CREATE_PASS) 489#endif 490LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis()) 491LOOP_ANALYSIS("access-info", LoopAccessAnalysis()) 492LOOP_ANALYSIS("ddg", DDGAnalysis()) 493LOOP_ANALYSIS("iv-users", IVUsersAnalysis()) 494LOOP_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) 495#undef LOOP_ANALYSIS 496 497#ifndef LOOP_PASS 498#define LOOP_PASS(NAME, CREATE_PASS) 499#endif 500LOOP_PASS("canon-freeze", CanonicalizeFreezeInLoopsPass()) 501LOOP_PASS("dot-ddg", DDGDotPrinterPass()) 502LOOP_PASS("invalidate<all>", InvalidateAllAnalysesPass()) 503LOOP_PASS("loop-idiom", LoopIdiomRecognizePass()) 504LOOP_PASS("loop-instsimplify", LoopInstSimplifyPass()) 505LOOP_PASS("loop-rotate", LoopRotatePass()) 506LOOP_PASS("no-op-loop", NoOpLoopPass()) 507LOOP_PASS("print", PrintLoopPass(dbgs())) 508LOOP_PASS("loop-deletion", LoopDeletionPass()) 509LOOP_PASS("loop-simplifycfg", LoopSimplifyCFGPass()) 510LOOP_PASS("loop-reduce", LoopStrengthReducePass()) 511LOOP_PASS("indvars", IndVarSimplifyPass()) 512LOOP_PASS("loop-unroll-full", LoopFullUnrollPass()) 513LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs())) 514LOOP_PASS("print<ddg>", DDGAnalysisPrinterPass(dbgs())) 515LOOP_PASS("print<iv-users>", IVUsersPrinterPass(dbgs())) 516LOOP_PASS("print<loopnest>", LoopNestPrinterPass(dbgs())) 517LOOP_PASS("print<loop-cache-cost>", LoopCachePrinterPass(dbgs())) 518LOOP_PASS("loop-predication", LoopPredicationPass()) 519LOOP_PASS("guard-widening", GuardWideningPass()) 520LOOP_PASS("loop-bound-split", LoopBoundSplitPass()) 521LOOP_PASS("loop-reroll", LoopRerollPass()) 522LOOP_PASS("loop-versioning-licm", LoopVersioningLICMPass()) 523#undef LOOP_PASS 524 525#ifndef LOOP_PASS_WITH_PARAMS 526#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) 527#endif 528LOOP_PASS_WITH_PARAMS("simple-loop-unswitch", 529 "SimpleLoopUnswitchPass", 530 [](std::pair<bool, bool> Params) { 531 return SimpleLoopUnswitchPass(Params.first, Params.second); 532 }, 533 parseLoopUnswitchOptions, 534 "nontrivial;no-nontrivial;trivial;no-trivial") 535 536LOOP_PASS_WITH_PARAMS("licm", "LICMPass", 537 [](LICMOptions Params) { 538 return LICMPass(Params); 539 }, 540 parseLICMOptions, 541 "allowspeculation"); 542 543LOOP_PASS_WITH_PARAMS("lnicm", "LNICMPass", 544 [](LICMOptions Params) { 545 return LNICMPass(Params); 546 }, 547 parseLICMOptions, 548 "allowspeculation"); 549#undef LOOP_PASS_WITH_PARAMS 550