PassRegistry.def 28 KB

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