PassRegistry.def 25 KB

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