396 "print-pipeline-passes",
397 cl::desc(
"Print a '-passes' compatible string describing the pipeline "
398 "(best-effort only)."));
409class TriggerCrashModulePass :
public PassInfoMixin<TriggerCrashModulePass> {
415 static StringRef
name() {
return "TriggerCrashModulePass"; }
418class TriggerCrashFunctionPass
425 static StringRef
name() {
return "TriggerCrashFunctionPass"; }
430class TriggerVerifierErrorPass
436 auto *PtrTy = PointerType::getUnqual(
M.getContext());
438 GlobalValue::LinkageTypes::InternalLinkage,
439 "__bad_alias",
nullptr, &M);
459 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
464class RequireAllMachineFunctionPropertiesPass
465 :
public PassInfoMixin<RequireAllMachineFunctionPropertiesPass> {
472 static MachineFunctionProperties getRequiredProperties() {
473 return MachineFunctionProperties()
475 .setFailsVerification()
480 .setRegBankSelected()
482 .setTiedOpsRewritten()
483 .setTracksDebugUserValues()
484 .setTracksLiveness();
486 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
503 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
507 formatv(
"invalid optimization level '{}'", S).str(),
512 std::optional<PGOOptions> PGOOpt,
515 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
517 TM->registerPassBuilderCallbacks(*
this);
519 PIC->registerClassToPassNameCallback([
this, PIC]() {
523#define MODULE_PASS(NAME, CREATE_PASS) \
524 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
525#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
526 PIC->addClassToPassName(CLASS, NAME);
527#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
528 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
529#define FUNCTION_PASS(NAME, CREATE_PASS) \
530 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
531#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
532 PIC->addClassToPassName(CLASS, NAME);
533#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
534 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
535#define LOOPNEST_PASS(NAME, CREATE_PASS) \
536 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
537#define LOOP_PASS(NAME, CREATE_PASS) \
538 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
539#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
540 PIC->addClassToPassName(CLASS, NAME);
541#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
542 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
543#define CGSCC_PASS(NAME, CREATE_PASS) \
544 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
545#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
546 PIC->addClassToPassName(CLASS, NAME);
547#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
548 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
549#include "PassRegistry.def"
551#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
552 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
553#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
554 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
555#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
557 PIC->addClassToPassName(CLASS, NAME);
558#include "llvm/Passes/MachinePassRegistry.def"
566#define MODULE_CALLBACK(NAME, INVOKE) \
567 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
568 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
570 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
573 INVOKE(PM, L.get()); \
576#include "PassRegistry.def"
584#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
585 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
586 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
588 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
591 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
594#include "PassRegistry.def"
602#define FUNCTION_CALLBACK(NAME, INVOKE) \
603 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
604 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
606 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
609 INVOKE(PM, L.get()); \
612#include "PassRegistry.def"
620#define CGSCC_CALLBACK(NAME, INVOKE) \
621 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
622 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
624 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
627 INVOKE(PM, L.get()); \
630#include "PassRegistry.def"
638#define LOOP_CALLBACK(NAME, INVOKE) \
639 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
640 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
642 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
645 INVOKE(PM, L.get()); \
648#include "PassRegistry.def"
654#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
655 MAM.registerPass([&] { return CREATE_PASS; });
656#include "PassRegistry.def"
658 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
663#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
664 CGAM.registerPass([&] { return CREATE_PASS; });
665#include "PassRegistry.def"
667 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
677#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
678 if constexpr (std::is_constructible_v< \
679 std::remove_reference_t<decltype(CREATE_PASS)>, \
680 const TargetMachine &>) { \
682 FAM.registerPass([&] { return CREATE_PASS; }); \
684 FAM.registerPass([&] { return CREATE_PASS; }); \
686#include "PassRegistry.def"
688 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
695#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
696 MFAM.registerPass([&] { return CREATE_PASS; });
697#include "llvm/Passes/MachinePassRegistry.def"
699 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
704#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
705 LAM.registerPass([&] { return CREATE_PASS; });
706#include "PassRegistry.def"
708 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
712static std::optional<std::pair<bool, bool>>
714 std::pair<bool, bool> Params;
715 if (!Name.consume_front(
"function"))
719 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
721 while (!Name.empty()) {
722 auto [Front, Back] = Name.split(
';');
724 if (Front ==
"eager-inv")
726 else if (Front ==
"no-rerun")
727 Params.second =
true;
735 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
747 while (!Params.
empty()) {
749 std::tie(ParamName, Params) = Params.
split(
';');
751 if (ParamName == OptionName) {
768 while (!Params.
empty()) {
770 std::tie(ParamName, Params) = Params.
split(
';');
775 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
780 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
784 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
789 if (ParamName ==
"force-hardware-loops") {
791 }
else if (ParamName ==
"force-hardware-loop-phi") {
793 }
else if (ParamName ==
"force-nested-hardware-loop") {
795 }
else if (ParamName ==
"force-hardware-loop-guard") {
799 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
803 return HardwareLoopOpts;
815 "FunctionPropertiesStatisticsPass");
826 while (!Params.
empty()) {
828 std::tie(ParamName, Params) = Params.
split(
';');
829 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
831 if (OptLevel && !OptLevel->isOptimizingForSize()) {
832 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
839 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
846 if (ParamName ==
"partial") {
848 }
else if (ParamName ==
"peeling") {
850 }
else if (ParamName ==
"profile-peeling") {
852 }
else if (ParamName ==
"runtime") {
854 }
else if (ParamName ==
"upperbound") {
858 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
867 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
887 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
896 "EntryExitInstrumenter");
901 "DropUnnecessaryAssumes");
910 "LowerMatrixIntrinsics");
915 while (!Params.
empty()) {
917 std::tie(ParamName, Params) = Params.
split(
';');
920 if (ParamName ==
"preserve-order")
922 else if (ParamName ==
"rename-all")
924 else if (ParamName ==
"fold-all")
926 else if (ParamName ==
"reorder-operands")
930 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
940 while (!Params.
empty()) {
942 std::tie(ParamName, Params) = Params.
split(
';');
944 if (ParamName ==
"kernel") {
945 Result.CompileKernel =
true;
946 }
else if (ParamName ==
"use-after-scope") {
947 Result.UseAfterScope =
true;
950 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
960 while (!Params.
empty()) {
962 std::tie(ParamName, Params) = Params.
split(
';');
964 if (ParamName ==
"recover") {
966 }
else if (ParamName ==
"kernel") {
967 Result.CompileKernel =
true;
970 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
979parseDropTypeTestsPassOptions(
StringRef Params) {
981 while (!Params.
empty()) {
983 std::tie(ParamName, Params) = Params.
split(
';');
985 if (ParamName ==
"all") {
987 }
else if (ParamName ==
"assume") {
991 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1000 while (!Params.
empty()) {
1002 std::tie(ParamName, Params) = Params.
split(
';');
1004 if (ParamName ==
"thinlto") {
1006 }
else if (ParamName ==
"emit-summary") {
1007 Result.EmitLTOSummary =
true;
1010 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1018parseLowerAllowCheckPassOptions(
StringRef Params) {
1020 while (!Params.
empty()) {
1022 std::tie(ParamName, Params) = Params.
split(
';');
1033 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1040 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1045 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1047 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1048 IndicesStr, CutoffStr)
1052 while (IndicesStr !=
"") {
1054 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1060 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1061 firstIndexStr, IndicesStr)
1068 if (index >=
Result.cutoffs.size())
1069 Result.cutoffs.resize(index + 1, 0);
1071 Result.cutoffs[index] = cutoff;
1073 }
else if (ParamName.
starts_with(
"runtime_check")) {
1075 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1079 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1081 ValueString, Params)
1085 Result.runtime_check = runtime_check;
1088 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1099 while (!Params.
empty()) {
1101 std::tie(ParamName, Params) = Params.
split(
';');
1103 if (ParamName ==
"recover") {
1105 }
else if (ParamName ==
"kernel") {
1110 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1115 }
else if (ParamName ==
"eager-checks") {
1116 Result.EagerChecks =
true;
1119 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1129 while (!Params.
empty()) {
1131 std::tie(ParamName, Params) = Params.
split(
';');
1138 formatv(
"invalid argument to AllocToken pass mode "
1145 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1155 while (!Params.
empty()) {
1157 std::tie(ParamName, Params) = Params.
split(
';');
1160 if (ParamName ==
"speculate-blocks") {
1162 }
else if (ParamName ==
"simplify-cond-branch") {
1164 }
else if (ParamName ==
"forward-switch-cond") {
1166 }
else if (ParamName ==
"switch-range-to-icmp") {
1168 }
else if (ParamName ==
"switch-to-arithmetic") {
1170 }
else if (ParamName ==
"switch-to-lookup") {
1172 }
else if (ParamName ==
"keep-loops") {
1174 }
else if (ParamName ==
"hoist-common-insts") {
1176 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1178 }
else if (ParamName ==
"sink-common-insts") {
1180 }
else if (ParamName ==
"speculate-unpredictables") {
1183 APInt BonusInstThreshold;
1186 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1194 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1205 Result.setVerifyFixpoint(
true);
1206 while (!Params.
empty()) {
1208 std::tie(ParamName, Params) = Params.
split(
';');
1211 if (ParamName ==
"verify-fixpoint") {
1214 APInt MaxIterations;
1217 formatv(
"invalid argument to InstCombine pass max-iterations "
1225 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1235 while (!Params.
empty()) {
1237 std::tie(ParamName, Params) = Params.
split(
';');
1240 if (ParamName ==
"interleave-forced-only") {
1242 }
else if (ParamName ==
"vectorize-forced-only") {
1246 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1254 std::pair<bool, bool>
Result = {
false,
true};
1255 while (!Params.
empty()) {
1257 std::tie(ParamName, Params) = Params.
split(
';');
1260 if (ParamName ==
"nontrivial") {
1262 }
else if (ParamName ==
"trivial") {
1266 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1275 while (!Params.
empty()) {
1277 std::tie(ParamName, Params) = Params.
split(
';');
1280 if (ParamName ==
"allowspeculation") {
1284 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1291struct LoopRotateOptions {
1292 bool EnableHeaderDuplication =
true;
1293 bool PrepareForLTO =
false;
1294 bool CheckExitCount =
false;
1298 LoopRotateOptions
Result;
1299 while (!Params.
empty()) {
1301 std::tie(ParamName, Params) = Params.
split(
';');
1304 if (ParamName ==
"header-duplication") {
1306 }
else if (ParamName ==
"prepare-for-lto") {
1308 }
else if (ParamName ==
"check-exit-count") {
1312 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1321 while (!Params.
empty()) {
1323 std::tie(ParamName, Params) = Params.
split(
';');
1326 if (ParamName ==
"split-footer-bb") {
1330 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1341 while (!Params.
empty()) {
1343 std::tie(ParamName, Params) = Params.
split(
';');
1346 if (ParamName ==
"pre") {
1348 }
else if (ParamName ==
"load-pre") {
1350 }
else if (ParamName ==
"split-backedge-load-pre") {
1352 }
else if (ParamName ==
"memdep") {
1356 }
else if (ParamName ==
"memoryssa") {
1362 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1371 while (!Params.
empty()) {
1373 std::tie(ParamName, Params) = Params.
split(
';');
1376 if (ParamName ==
"func-spec")
1380 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1388 while (!Params.
empty()) {
1390 std::tie(ParamName, Params) = Params.
split(
';');
1395 formatv(
"invalid argument to Scalarizer pass min-bits "
1406 if (ParamName ==
"load-store")
1408 else if (ParamName ==
"variable-insert-extract")
1412 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1421 if (Params.
empty() || Params ==
"modify-cfg")
1423 if (Params ==
"preserve-cfg")
1426 formatv(
"invalid SROA pass parameter '{}' (either preserve-cfg or "
1427 "modify-cfg can be specified)",
1434parseStackLifetimeOptions(
StringRef Params) {
1436 while (!Params.
empty()) {
1438 std::tie(ParamName, Params) = Params.
split(
';');
1440 if (ParamName ==
"may") {
1442 }
else if (ParamName ==
"must") {
1446 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1455 "DependenceAnalysisPrinter");
1460 "SeparateConstOffsetFromGEP");
1469parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1473 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1481 "MemorySSAPrinterPass");
1486 "SpeculativeExecutionPass");
1491 while (!Params.
empty()) {
1493 std::tie(ParamName, Params) = Params.
split(
';');
1499 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1507parseStructuralHashPrinterPassOptions(
StringRef Params) {
1510 if (Params ==
"detailed")
1512 if (Params ==
"call-target-ignored")
1515 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1521 "WinEHPreparePass");
1526 while (!Params.
empty()) {
1528 std::tie(ParamName, Params) = Params.
split(
';');
1531 if (ParamName ==
"group-by-use")
1533 else if (ParamName ==
"ignore-single-use")
1535 else if (ParamName ==
"merge-const")
1537 else if (ParamName ==
"merge-const-aggressive")
1539 else if (ParamName ==
"merge-external")
1544 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1548 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1557 while (!Params.
empty()) {
1559 std::tie(ParamName, Params) = Params.
split(
';');
1565 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1576 while (!Params.
empty()) {
1578 std::tie(ParamName, Params) = Params.
split(
';');
1581 std::optional<RegAllocFilterFunc>
Filter =
1585 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1594 if (ParamName ==
"no-clear-vregs") {
1600 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1607parseBoundsCheckingOptions(
StringRef Params) {
1609 while (!Params.
empty()) {
1611 std::tie(ParamName, Params) = Params.
split(
';');
1612 if (ParamName ==
"trap") {
1614 }
else if (ParamName ==
"rt") {
1620 }
else if (ParamName ==
"rt-abort") {
1626 }
else if (ParamName ==
"min-rt") {
1632 }
else if (ParamName ==
"min-rt-abort") {
1638 }
else if (ParamName ==
"merge") {
1640 }
else if (ParamName ==
"handler-preserve-all-regs") {
1642 Options.Rt->HandlerPreserveAllRegs =
true;
1646 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1652 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1669 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1671 Param.str().c_str());
1674 if (!
Level.has_value())
1676 "invalid optimization level for expand-ir-insts pass: %s",
1677 Digit.str().c_str());
1684 if (Params.
empty() || Params ==
"all")
1685 return RAGreedyPass::Options();
1689 return RAGreedyPass::Options{*
Filter, Params};
1692 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1698 "MachineSinkingPass");
1702 bool AllowTailMerge =
true;
1703 if (!Params.
empty()) {
1705 if (Params !=
"tail-merge")
1707 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1711 return AllowTailMerge;
1715 bool ClearVirtRegs =
true;
1716 if (!Params.
empty()) {
1718 if (Params !=
"clear-vregs")
1720 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1723 return ClearVirtRegs;
1726struct FatLTOOptions {
1727 OptimizationLevel OptLevel;
1728 bool ThinLTO =
false;
1729 bool EmitSummary =
false;
1734 bool HaveOptLevel =
false;
1735 while (!Params.
empty()) {
1737 std::tie(ParamName, Params) = Params.
split(
';');
1739 if (ParamName ==
"thinlto") {
1741 }
else if (ParamName ==
"emit-summary") {
1742 Result.EmitSummary =
true;
1743 }
else if (std::optional<OptimizationLevel> OptLevel =
1745 Result.OptLevel = *OptLevel;
1746 HaveOptLevel =
true;
1749 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1756 "missing optimization level for fatlto-pre-link pipeline",
1771template <
typename PassManagerT,
typename CallbacksT>
1773 if (!Callbacks.empty()) {
1774 PassManagerT DummyPM;
1775 for (
auto &CB : Callbacks)
1776 if (CB(Name, DummyPM, {}))
1782template <
typename CallbacksT>
1784 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1787 if (Name ==
"module")
1789 if (Name ==
"cgscc")
1791 if (NameNoBracket ==
"function")
1793 if (Name ==
"coro-cond")
1796#define MODULE_PASS(NAME, CREATE_PASS) \
1799#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1800 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1802#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1803 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1805#include "PassRegistry.def"
1810template <
typename CallbacksT>
1813 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1814 if (Name ==
"cgscc")
1816 if (NameNoBracket ==
"function")
1823#define CGSCC_PASS(NAME, CREATE_PASS) \
1826#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1827 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1829#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1830 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1832#include "PassRegistry.def"
1837template <
typename CallbacksT>
1840 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1841 if (NameNoBracket ==
"function")
1843 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1846#define FUNCTION_PASS(NAME, CREATE_PASS) \
1849#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1850 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1852#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1853 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1855#include "PassRegistry.def"
1860template <
typename CallbacksT>
1863 if (Name ==
"machine-function")
1866#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1869#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1871 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1874#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1875 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1878#include "llvm/Passes/MachinePassRegistry.def"
1883template <
typename CallbacksT>
1885 bool &UseMemorySSA) {
1886 UseMemorySSA =
false;
1889 UseMemorySSA =
true;
1893#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1896#include "PassRegistry.def"
1901template <
typename CallbacksT>
1903 bool &UseMemorySSA) {
1904 UseMemorySSA =
false;
1907 UseMemorySSA =
true;
1911#define LOOP_PASS(NAME, CREATE_PASS) \
1914#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1915 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1917#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1918 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1920#include "PassRegistry.def"
1925std::optional<std::vector<PassBuilder::PipelineElement>>
1926PassBuilder::parsePipelineText(
StringRef Text) {
1927 std::vector<PipelineElement> ResultPipeline;
1932 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1933 size_t Pos =
Text.find_first_of(
",()");
1934 Pipeline.push_back({
Text.substr(0, Pos), {}});
1937 if (Pos ==
Text.npos)
1940 char Sep =
Text[Pos];
1948 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1952 assert(Sep ==
')' &&
"Bogus separator!");
1957 if (PipelineStack.
size() == 1)
1958 return std::nullopt;
1961 }
while (
Text.consume_front(
")"));
1969 if (!
Text.consume_front(
","))
1970 return std::nullopt;
1973 if (PipelineStack.
size() > 1)
1975 return std::nullopt;
1977 assert(PipelineStack.
back() == &ResultPipeline &&
1978 "Wrong pipeline at the bottom of the stack!");
1979 return {std::move(ResultPipeline)};
1989 const PipelineElement &
E) {
1990 auto &
Name =
E.Name;
1991 auto &InnerPipeline =
E.InnerPipeline;
1994 if (!InnerPipeline.empty()) {
1995 if (Name ==
"module") {
1997 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
1999 MPM.
addPass(std::move(NestedMPM));
2002 if (Name ==
"coro-cond") {
2004 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2006 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2009 if (Name ==
"cgscc") {
2011 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2019 "cannot have a no-rerun module to function adaptor",
2022 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2029 for (
auto &
C : ModulePipelineParsingCallbacks)
2030 if (
C(Name, MPM, InnerPipeline))
2035 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2041#define MODULE_PASS(NAME, CREATE_PASS) \
2042 if (Name == NAME) { \
2043 MPM.addPass(CREATE_PASS); \
2044 return Error::success(); \
2046#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2047 if (checkParametrizedPassName(Name, NAME)) { \
2048 auto Params = parsePassParameters(PARSER, Name, NAME); \
2050 return Params.takeError(); \
2051 MPM.addPass(CREATE_PASS(Params.get())); \
2052 return Error::success(); \
2054#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2055 if (Name == "require<" NAME ">") { \
2057 RequireAnalysisPass< \
2058 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2059 return Error::success(); \
2061 if (Name == "invalidate<" NAME ">") { \
2062 MPM.addPass(InvalidateAnalysisPass< \
2063 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2064 return Error::success(); \
2066#define CGSCC_PASS(NAME, CREATE_PASS) \
2067 if (Name == NAME) { \
2068 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2069 return Error::success(); \
2071#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2072 if (checkParametrizedPassName(Name, NAME)) { \
2073 auto Params = parsePassParameters(PARSER, Name, NAME); \
2075 return Params.takeError(); \
2077 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2078 return Error::success(); \
2080#define FUNCTION_PASS(NAME, CREATE_PASS) \
2081 if (Name == NAME) { \
2082 if constexpr (std::is_constructible_v< \
2083 std::remove_reference_t<decltype(CREATE_PASS)>, \
2084 const TargetMachine &>) { \
2086 return make_error<StringError>( \
2087 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2088 inconvertibleErrorCode()); \
2090 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2091 return Error::success(); \
2093#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2094 if (checkParametrizedPassName(Name, NAME)) { \
2095 auto Params = parsePassParameters(PARSER, Name, NAME); \
2097 return Params.takeError(); \
2098 auto CreatePass = CREATE_PASS; \
2099 if constexpr (std::is_constructible_v< \
2100 std::remove_reference_t<decltype(CreatePass( \
2102 const TargetMachine &, \
2103 std::remove_reference_t<decltype(Params.get())>>) { \
2105 return make_error<StringError>( \
2106 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2107 inconvertibleErrorCode()); \
2110 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2111 return Error::success(); \
2113#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2114 if (Name == NAME) { \
2115 MPM.addPass(createModuleToFunctionPassAdaptor( \
2116 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2117 return Error::success(); \
2119#define LOOP_PASS(NAME, CREATE_PASS) \
2120 if (Name == NAME) { \
2121 MPM.addPass(createModuleToFunctionPassAdaptor( \
2122 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2123 return Error::success(); \
2125#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2126 if (checkParametrizedPassName(Name, NAME)) { \
2127 auto Params = parsePassParameters(PARSER, Name, NAME); \
2129 return Params.takeError(); \
2130 MPM.addPass(createModuleToFunctionPassAdaptor( \
2131 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2132 return Error::success(); \
2134#include "PassRegistry.def"
2136 for (
auto &
C : ModulePipelineParsingCallbacks)
2137 if (
C(Name, MPM, InnerPipeline))
2140 formatv(
"unknown module pass '{}'", Name).str(),
2145 const PipelineElement &
E) {
2146 auto &
Name =
E.Name;
2147 auto &InnerPipeline =
E.InnerPipeline;
2150 if (!InnerPipeline.empty()) {
2151 if (Name ==
"cgscc") {
2153 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2156 CGPM.
addPass(std::move(NestedCGPM));
2161 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2165 std::move(FPM), Params->first, Params->second));
2170 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2177 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2178 if (
C(Name, CGPM, InnerPipeline))
2183 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2188#define CGSCC_PASS(NAME, CREATE_PASS) \
2189 if (Name == NAME) { \
2190 CGPM.addPass(CREATE_PASS); \
2191 return Error::success(); \
2193#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2194 if (checkParametrizedPassName(Name, NAME)) { \
2195 auto Params = parsePassParameters(PARSER, Name, NAME); \
2197 return Params.takeError(); \
2198 CGPM.addPass(CREATE_PASS(Params.get())); \
2199 return Error::success(); \
2201#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2202 if (Name == "require<" NAME ">") { \
2203 CGPM.addPass(RequireAnalysisPass< \
2204 std::remove_reference_t<decltype(CREATE_PASS)>, \
2205 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2206 CGSCCUpdateResult &>()); \
2207 return Error::success(); \
2209 if (Name == "invalidate<" NAME ">") { \
2210 CGPM.addPass(InvalidateAnalysisPass< \
2211 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2212 return Error::success(); \
2214#define FUNCTION_PASS(NAME, CREATE_PASS) \
2215 if (Name == NAME) { \
2216 if constexpr (std::is_constructible_v< \
2217 std::remove_reference_t<decltype(CREATE_PASS)>, \
2218 const TargetMachine &>) { \
2220 return make_error<StringError>( \
2221 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2222 inconvertibleErrorCode()); \
2224 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2225 return Error::success(); \
2227#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2228 if (checkParametrizedPassName(Name, NAME)) { \
2229 auto Params = parsePassParameters(PARSER, Name, NAME); \
2231 return Params.takeError(); \
2232 auto CreatePass = CREATE_PASS; \
2233 if constexpr (std::is_constructible_v< \
2234 std::remove_reference_t<decltype(CreatePass( \
2236 const TargetMachine &, \
2237 std::remove_reference_t<decltype(Params.get())>>) { \
2239 return make_error<StringError>( \
2240 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2241 inconvertibleErrorCode()); \
2244 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2245 return Error::success(); \
2247#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2248 if (Name == NAME) { \
2249 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2250 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2251 return Error::success(); \
2253#define LOOP_PASS(NAME, CREATE_PASS) \
2254 if (Name == NAME) { \
2255 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2256 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2257 return Error::success(); \
2259#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2260 if (checkParametrizedPassName(Name, NAME)) { \
2261 auto Params = parsePassParameters(PARSER, Name, NAME); \
2263 return Params.takeError(); \
2264 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2265 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2266 return Error::success(); \
2268#include "PassRegistry.def"
2270 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2271 if (
C(Name, CGPM, InnerPipeline))
2278 const PipelineElement &
E) {
2279 auto &
Name =
E.Name;
2280 auto &InnerPipeline =
E.InnerPipeline;
2283 if (!InnerPipeline.empty()) {
2284 if (Name ==
"function") {
2286 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2289 FPM.
addPass(std::move(NestedFPM));
2292 if (Name ==
"loop" || Name ==
"loop-mssa") {
2294 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2297 bool UseMemorySSA = (
Name ==
"loop-mssa");
2302 if (Name ==
"machine-function") {
2304 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2310 for (
auto &
C : FunctionPipelineParsingCallbacks)
2311 if (
C(Name, FPM, InnerPipeline))
2316 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2321#define FUNCTION_PASS(NAME, CREATE_PASS) \
2322 if (Name == NAME) { \
2323 if constexpr (std::is_constructible_v< \
2324 std::remove_reference_t<decltype(CREATE_PASS)>, \
2325 const TargetMachine &>) { \
2327 return make_error<StringError>( \
2328 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2329 inconvertibleErrorCode()); \
2331 FPM.addPass(CREATE_PASS); \
2332 return Error::success(); \
2334#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2335 if (checkParametrizedPassName(Name, NAME)) { \
2336 auto Params = parsePassParameters(PARSER, Name, NAME); \
2338 return Params.takeError(); \
2339 auto CreatePass = CREATE_PASS; \
2340 if constexpr (std::is_constructible_v< \
2341 std::remove_reference_t<decltype(CreatePass( \
2343 const TargetMachine &, \
2344 std::remove_reference_t<decltype(Params.get())>>) { \
2346 return make_error<StringError>( \
2347 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2348 inconvertibleErrorCode()); \
2351 FPM.addPass(CREATE_PASS(Params.get())); \
2352 return Error::success(); \
2354#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2355 if (Name == "require<" NAME ">") { \
2356 if constexpr (std::is_constructible_v< \
2357 std::remove_reference_t<decltype(CREATE_PASS)>, \
2358 const TargetMachine &>) { \
2360 return make_error<StringError>( \
2361 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2362 inconvertibleErrorCode()); \
2365 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2367 return Error::success(); \
2369 if (Name == "invalidate<" NAME ">") { \
2370 FPM.addPass(InvalidateAnalysisPass< \
2371 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2372 return Error::success(); \
2378#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2379 if (Name == NAME) { \
2380 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2381 return Error::success(); \
2383#define LOOP_PASS(NAME, CREATE_PASS) \
2384 if (Name == NAME) { \
2385 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2386 return Error::success(); \
2388#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2389 if (checkParametrizedPassName(Name, NAME)) { \
2390 auto Params = parsePassParameters(PARSER, Name, NAME); \
2392 return Params.takeError(); \
2394 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2395 return Error::success(); \
2397#include "PassRegistry.def"
2399 for (
auto &
C : FunctionPipelineParsingCallbacks)
2400 if (
C(Name, FPM, InnerPipeline))
2403 formatv(
"unknown function pass '{}'", Name).str(),
2408 const PipelineElement &
E) {
2409 StringRef
Name =
E.Name;
2410 auto &InnerPipeline =
E.InnerPipeline;
2413 if (!InnerPipeline.empty()) {
2414 if (Name ==
"loop") {
2416 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2419 LPM.addPass(std::move(NestedLPM));
2423 for (
auto &
C : LoopPipelineParsingCallbacks)
2424 if (
C(Name, LPM, InnerPipeline))
2429 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2434#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2435 if (Name == NAME) { \
2436 LPM.addPass(CREATE_PASS); \
2437 return Error::success(); \
2439#define LOOP_PASS(NAME, CREATE_PASS) \
2440 if (Name == NAME) { \
2441 LPM.addPass(CREATE_PASS); \
2442 return Error::success(); \
2444#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2445 if (checkParametrizedPassName(Name, NAME)) { \
2446 auto Params = parsePassParameters(PARSER, Name, NAME); \
2448 return Params.takeError(); \
2449 LPM.addPass(CREATE_PASS(Params.get())); \
2450 return Error::success(); \
2452#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2453 if (Name == "require<" NAME ">") { \
2454 LPM.addPass(RequireAnalysisPass< \
2455 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2456 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2458 return Error::success(); \
2460 if (Name == "invalidate<" NAME ">") { \
2461 LPM.addPass(InvalidateAnalysisPass< \
2462 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2463 return Error::success(); \
2465#include "PassRegistry.def"
2467 for (
auto &
C : LoopPipelineParsingCallbacks)
2468 if (
C(Name, LPM, InnerPipeline))
2475 const PipelineElement &
E) {
2476 StringRef
Name =
E.Name;
2478 if (!
E.InnerPipeline.empty()) {
2479 if (
E.Name ==
"machine-function") {
2481 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2483 MFPM.
addPass(std::move(NestedPM));
2490#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2491 if (Name == NAME) { \
2492 MFPM.addPass(CREATE_PASS); \
2493 return Error::success(); \
2495#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2496 if (Name == NAME) { \
2497 MFPM.addPass(CREATE_PASS); \
2498 return Error::success(); \
2500#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2502 if (checkParametrizedPassName(Name, NAME)) { \
2503 auto Params = parsePassParameters(PARSER, Name, NAME); \
2505 return Params.takeError(); \
2506 MFPM.addPass(CREATE_PASS(Params.get())); \
2507 return Error::success(); \
2509#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2510 if (Name == "require<" NAME ">") { \
2512 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2513 MachineFunction>()); \
2514 return Error::success(); \
2516 if (Name == "invalidate<" NAME ">") { \
2517 MFPM.addPass(InvalidateAnalysisPass< \
2518 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2519 return Error::success(); \
2521#include "llvm/Passes/MachinePassRegistry.def"
2523 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2524 if (
C(Name, MFPM,
E.InnerPipeline))
2527 formatv(
"unknown machine pass '{}'", Name).str(),
2532#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2533 if (Name == NAME) { \
2534 AA.registerModuleAnalysis< \
2535 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2538#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2539 if (Name == NAME) { \
2540 AA.registerFunctionAnalysis< \
2541 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2544#include "PassRegistry.def"
2546 for (
auto &
C : AAParsingCallbacks)
2552Error PassBuilder::parseMachinePassPipeline(
2554 for (
const auto &Element : Pipeline) {
2555 if (
auto Err = parseMachinePass(MFPM, Element))
2563 for (
const auto &Element : Pipeline) {
2564 if (
auto Err = parseLoopPass(LPM, Element))
2570Error PassBuilder::parseFunctionPassPipeline(
2572 for (
const auto &Element : Pipeline) {
2573 if (
auto Err = parseFunctionPass(FPM, Element))
2581 for (
const auto &Element : Pipeline) {
2582 if (
auto Err = parseCGSCCPass(CGPM, Element))
2614 for (
const auto &Element : Pipeline) {
2615 if (
auto Err = parseModulePass(MPM, Element))
2626 auto Pipeline = parsePipelineText(PipelineText);
2627 if (!Pipeline || Pipeline->empty())
2629 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2639 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2641 FunctionPipelineParsingCallbacks)) {
2642 Pipeline = {{
"function", std::move(*Pipeline)}};
2645 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2646 std::move(*Pipeline)}}}};
2647 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2649 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2650 std::move(*Pipeline)}}}};
2652 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2653 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2655 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2656 if (
C(MPM, *Pipeline))
2660 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2662 formatv(
"unknown {} name '{}'",
2663 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2669 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2677 auto Pipeline = parsePipelineText(PipelineText);
2678 if (!Pipeline || Pipeline->empty())
2680 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2686 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2691 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2700 auto Pipeline = parsePipelineText(PipelineText);
2701 if (!Pipeline || Pipeline->empty())
2703 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2709 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2714 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2722 auto Pipeline = parsePipelineText(PipelineText);
2723 if (!Pipeline || Pipeline->empty())
2725 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2728 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2736 auto Pipeline = parsePipelineText(PipelineText);
2737 if (!Pipeline || Pipeline->empty())
2739 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2742 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2751 if (PipelineText ==
"default") {
2756 while (!PipelineText.
empty()) {
2758 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2759 if (!parseAAPassName(
AA, Name))
2761 formatv(
"unknown alias analysis name '{}'", Name).str(),
2768std::optional<RegAllocFilterFunc>
2770 if (FilterName ==
"all")
2772 for (
auto &
C : RegClassFilterParsingCallbacks)
2773 if (
auto F =
C(FilterName))
2775 return std::nullopt;
2783 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2789 OS <<
"Module passes:\n";
2790#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2791#include "PassRegistry.def"
2793 OS <<
"Module passes with params:\n";
2794#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2795 printPassName(NAME, PARAMS, OS);
2796#include "PassRegistry.def"
2798 OS <<
"Module analyses:\n";
2799#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2800#include "PassRegistry.def"
2802 OS <<
"Module alias analyses:\n";
2803#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2804#include "PassRegistry.def"
2806 OS <<
"CGSCC passes:\n";
2807#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2808#include "PassRegistry.def"
2810 OS <<
"CGSCC passes with params:\n";
2811#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2812 printPassName(NAME, PARAMS, OS);
2813#include "PassRegistry.def"
2815 OS <<
"CGSCC analyses:\n";
2816#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2817#include "PassRegistry.def"
2819 OS <<
"Function passes:\n";
2820#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2821#include "PassRegistry.def"
2823 OS <<
"Function passes with params:\n";
2824#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2825 printPassName(NAME, PARAMS, OS);
2826#include "PassRegistry.def"
2828 OS <<
"Function analyses:\n";
2829#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2830#include "PassRegistry.def"
2832 OS <<
"Function alias analyses:\n";
2833#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2834#include "PassRegistry.def"
2836 OS <<
"LoopNest passes:\n";
2837#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2838#include "PassRegistry.def"
2840 OS <<
"Loop passes:\n";
2841#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2842#include "PassRegistry.def"
2844 OS <<
"Loop passes with params:\n";
2845#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2846 printPassName(NAME, PARAMS, OS);
2847#include "PassRegistry.def"
2849 OS <<
"Loop analyses:\n";
2850#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2851#include "PassRegistry.def"
2853 OS <<
"Machine module passes (WIP):\n";
2854#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2855#include "llvm/Passes/MachinePassRegistry.def"
2857 OS <<
"Machine function passes (WIP):\n";
2858#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2859#include "llvm/Passes/MachinePassRegistry.def"
2861 OS <<
"Machine function analyses (WIP):\n";
2862#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2863#include "llvm/Passes/MachinePassRegistry.def"
2869 TopLevelPipelineParsingCallbacks.push_back(
C);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AggressiveInstCombiner - Combine expression patterns to form expressions with fewer,...
This file implements a simple N^2 alias analysis accuracy evaluator.
Provides passes to inlining "always_inline" functions.
This is the interface for LLVM's primary stateless and local alias analysis.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file provides the interface for LLVM's Call Graph Profile pass.
This header provides classes for managing passes over SCCs of the call graph.
Provides analysis for continuously CSEing during GISel passes.
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
Defines an IR pass for CodeGen Prepare.
This file declares an analysis pass that computes CycleInfo for LLVM IR, specialized from GenericCycl...
Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that ge...
This file provides the interface for a simple, fast CSE pass.
This file provides a pass which clones the current module and runs the provided pass pipeline on the ...
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
Provides passes for computing function attributes based on interprocedural analyses.
This file provides the interface for the GCOV style profiler pass.
Provides analysis for querying information about KnownBits during GISel passes.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
This is the interface for a simple mod/ref and alias analysis over globals.
Defines an IR pass for the creation of hardware loops.
AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...
This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder inte...
This file defines passes to print out IR in various granularities.
This header defines various interfaces for pass management in LLVM.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
This file provides the primary interface to the instcombine pass.
Defines passes for running instruction simplification across chunks of IR.
This file provides the interface for LLVM's PGO Instrumentation lowering pass.
This file contains the declaration of the InterleavedAccessPass class, its corresponding pass name is...
See the comments on JumpThreadingPass.
Implements a lazy call graph analysis and related passes for the new pass manager.
This file defines the interface for the loop cache analysis.
This file provides the interface for LLVM's Loop Data Prefetching Pass.
This file implements the Loop Fusion pass.
This header defines the LoopLoadEliminationPass object.
This file defines the interface for the loop nest analysis.
This header provides classes for managing a pipeline of passes over loops in LLVM IR.
This file provides the interface for the pass responsible for removing expensive ubsan checks.
The header file for the LowerConstantIntrinsics pass as used by the new pass manager.
The header file for the LowerExpectIntrinsic pass as used by the new pass manager.
Machine Check Debug Module
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
This pass performs merges of loads and stores on both sides of a.
This is the interface to build a ModuleSummaryIndex for a module.
Contains a collection of routines for determining if a given instruction is guaranteed to execute if ...
This file provides the interface for LLVM's Global Value Numbering pass.
This file declares a simple ARC-aware AliasAnalysis using special knowledge of Objective C to enhance...
This header enumerates the LLVM-provided high-level optimization levels.
This file provides the interface for IR based instrumentation passes ( (profile-gen,...
CGSCCAnalysisManager CGAM
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
static bool isModulePassName(StringRef Name, CallbacksT &Callbacks)
static bool callbacksAcceptPassName(StringRef Name, CallbacksT &Callbacks)
Tests whether registered callbacks will accept a given pass name.
static std::optional< int > parseDevirtPassName(StringRef Name)
static bool isLoopNestPassName(StringRef Name, CallbacksT &Callbacks, bool &UseMemorySSA)
static bool isMachineFunctionPassName(StringRef Name, CallbacksT &Callbacks)
static Expected< OptimizationLevel > parseOptLevelParam(StringRef S)
static std::optional< OptimizationLevel > parseOptLevel(StringRef S)
static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks, bool &UseMemorySSA)
static std::optional< std::pair< bool, bool > > parseFunctionPipelineName(StringRef Name)
static bool isCGSCCPassName(StringRef Name, CallbacksT &Callbacks)
static void printPassName(StringRef PassName, raw_ostream &OS)
static bool isFunctionPassName(StringRef Name, CallbacksT &Callbacks)
static void setupOptionsForPipelineAlias(PipelineTuningOptions &PTO, OptimizationLevel L)
This file implements the PredicateInfo analysis, which creates an Extended SSA form for operations us...
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This pass is required to take advantage of the interprocedural register allocation infrastructure.
This file implements relative lookup table converter that converts lookup tables to relative lookup t...
This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.
This file provides the interface for the pseudo probe implementation for AutoFDO.
This file provides the interface for the sampled PGO loader pass.
This is the interface for a SCEV-based alias analysis.
This pass converts vector operations into scalar operations (or, optionally, operations on smaller ve...
This is the interface for a metadata-based scoped no-alias analysis.
This file contains the declaration of the SelectOptimizePass class, its corresponding pass name is se...
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This pass strips convergence intrinsics and operand bundles as those are only useful when modifying t...
Target-Independent Code Generator Pass Configuration Options pass.
This is the interface for a metadata-based TBAA.
static const char PassName[]
A manager for alias analyses.
Class for arbitrary precision integers.
uint64_t getZExtValue() const
Get zero extended value.
int64_t getSExtValue() const
Get sign extended value.
bool registerPass(PassBuilderT &&PassBuilder)
Register an analysis pass with the manager.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
static LLVM_ABI GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const MachineFunctionProperties & getProperties() const
Get the function properties.
LLVM_ABI Register createGenericVirtualRegister(LLT Ty, StringRef Name="")
Create and return a new generic virtual register with low-level type Ty.
static LLVM_ABI const OptimizationLevel O3
Optimize for fast execution as much as possible.
static LLVM_ABI const OptimizationLevel Oz
A very specialized mode that will optimize for code size at any and all costs.
static LLVM_ABI const OptimizationLevel O0
Disable as many optimizations as possible.
static LLVM_ABI const OptimizationLevel Os
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
static LLVM_ABI const OptimizationLevel O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
static LLVM_ABI const OptimizationLevel O1
Optimize quickly without destroying debuggability.
This class provides access to building LLVM's passes.
LLVM_ABI void printPassNames(raw_ostream &OS)
Print pass names.
static bool checkParametrizedPassName(StringRef Name, StringRef PassName)
LLVM_ABI AAManager buildDefaultAAPipeline()
Build the default AAManager with the default alias analysis pipeline registered.
LLVM_ABI Error parseAAPipeline(AAManager &AA, StringRef PipelineText)
Parse a textual alias analysis pipeline into the provided AA manager.
LLVM_ABI void registerLoopAnalyses(LoopAnalysisManager &LAM)
Registers all available loop analysis passes.
LLVM_ABI std::optional< RegAllocFilterFunc > parseRegAllocFilter(StringRef RegAllocFilterName)
Parse RegAllocFilterName to get RegAllocFilterFunc.
LLVM_ABI void crossRegisterProxies(LoopAnalysisManager &LAM, FunctionAnalysisManager &FAM, CGSCCAnalysisManager &CGAM, ModuleAnalysisManager &MAM, MachineFunctionAnalysisManager *MFAM=nullptr)
Cross register the analysis managers through their proxies.
LLVM_ABI PassBuilder(TargetMachine *TM=nullptr, PipelineTuningOptions PTO=PipelineTuningOptions(), std::optional< PGOOptions > PGOOpt=std::nullopt, PassInstrumentationCallbacks *PIC=nullptr, IntrusiveRefCntPtr< vfs::FileSystem > FS=vfs::getRealFileSystem())
LLVM_ABI Error parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText)
Parse a textual pass pipeline description into a ModulePassManager.
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &C)
{{@ Register pipeline parsing callbacks with this pass builder instance.
LLVM_ABI void registerModuleAnalyses(ModuleAnalysisManager &MAM)
Registers all available module analysis passes.
LLVM_ABI void registerCGSCCAnalyses(CGSCCAnalysisManager &CGAM)
Registers all available CGSCC analysis passes.
static LLVM_ABI Expected< bool > parseSinglePassOption(StringRef Params, StringRef OptionName, StringRef PassName)
Handle passes only accept one bool-valued parameter.
LLVM_ABI void registerMachineFunctionAnalyses(MachineFunctionAnalysisManager &MFAM)
Registers all available machine function analysis passes.
LLVM_ABI void registerParseTopLevelPipelineCallback(const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >)> &C)
Register a callback for a top-level pipeline entry.
LLVM_ABI void registerFunctionAnalyses(FunctionAnalysisManager &FAM)
Registers all available function analysis passes.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
Tunable parameters for passes in the default pipelines.
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization, set based on opt level.
bool LoopVectorization
Tuning option to enable/disable loop vectorization, set based on opt level.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
std::string str() const
str - Get the contents as an std::string.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
empty - Check if the string is empty.
char front() const
front - Get the first character in the string.
bool consume_front(char Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Primary interface to the complete machine description for the target machine.
self_iterator getIterator()
This class implements an extremely fast bulk output stream that can only output to a stream.
Interfaces for registering analysis passes, producing common pass manager configurations,...
Abstract Attribute helper functions.
@ C
The default llvm calling convention, compatible with C.
std::optional< CodeGenOptLevel > getLevel(int OL)
Get the Level identified by the integer OL.
@ BasicBlock
Various leaf nodes.
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
DropTestKind
Specifies how to drop type tests.
@ All
Drop only llvm.assumes using type test value.
This is an optimization pass for GlobalISel generic memory operations.
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
DevirtSCCRepeatedPass createDevirtSCCRepeatedPass(CGSCCPassT &&Pass, int MaxIterations)
A function to deduce a function pass type and wrap it in the templated adaptor.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
InnerAnalysisManagerProxy< LoopAnalysisManager, Function > LoopAnalysisManagerFunctionProxy
A proxy from a LoopAnalysisManager to a Function.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager
The Loop pass manager.
ModuleToPostOrderCGSCCPassAdaptor createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
LLVM_ABI cl::opt< bool > PrintPipelinePasses
Common option used by multiple tools to print pipeline passes.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
FunctionToLoopPassAdaptor createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
FunctionToMachineFunctionPassAdaptor createFunctionToMachineFunctionPassAdaptor(MachineFunctionPassT &&Pass)
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
FunctionAddr VTableAddr Count
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Function > MachineFunctionAnalysisManagerFunctionProxy
OuterAnalysisManagerProxy< FunctionAnalysisManager, Loop, LoopStandardAnalysisResults & > FunctionAnalysisManagerLoopProxy
A proxy from a FunctionAnalysisManager to a Loop.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
OuterAnalysisManagerProxy< ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph & > ModuleAnalysisManagerCGSCCProxy
A proxy from a ModuleAnalysisManager to an SCC.
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Module > MachineFunctionAnalysisManagerModuleProxy
InnerAnalysisManagerProxy< CGSCCAnalysisManager, Module > CGSCCAnalysisManagerModuleProxy
A proxy from a CGSCCAnalysisManager to a Module.
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
MFPropsModifier(PassT &P, MachineFunction &MF) -> MFPropsModifier< PassT >
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
PassManager< MachineFunction > MachineFunctionPassManager
Convenience typedef for a pass manager over functions.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
LLVM_ABI std::optional< AllocTokenMode > getAllocTokenModeFromString(StringRef Name)
Returns the AllocTokenMode from its canonical string name; if an invalid name was provided returns nu...
@ Detailed
Hash with opcode only.
@ CallTargetIgnored
Hash with opcode and operands.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Implement std::hash so that hash_code can be used in STL containers.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A set of parameters to control various transforms performed by GVN pass.
HardwareLoopOptions & setForceNested(bool Force)
HardwareLoopOptions & setDecrement(unsigned Count)
HardwareLoopOptions & setForceGuard(bool Force)
HardwareLoopOptions & setForce(bool Force)
HardwareLoopOptions & setCounterBitwidth(unsigned Width)
HardwareLoopOptions & setForcePhi(bool Force)
A set of parameters to control various transforms performed by IPSCCP pass.
A set of parameters used to control various transforms performed by the LoopUnroll pass.
LoopUnrollOptions & setPeeling(bool Peeling)
Enables or disables loop peeling.
LoopUnrollOptions & setOptLevel(int O)
LoopUnrollOptions & setPartial(bool Partial)
Enables or disables partial unrolling.
LoopUnrollOptions & setFullUnrollMaxCount(unsigned O)
LoopUnrollOptions & setUpperBound(bool UpperBound)
Enables or disables the use of trip count upper bound in loop unrolling.
LoopUnrollOptions & setRuntime(bool Runtime)
Enables or disables unrolling of loops with runtime trip count.
LoopUnrollOptions & setProfileBasedPeeling(int O)
LoopVectorizeOptions & setVectorizeOnlyWhenForced(bool Value)
LoopVectorizeOptions & setInterleaveOnlyWhenForced(bool Value)
A CRTP mix-in to automatically provide informational APIs needed for passes.
RegAllocFilterFunc Filter