411 "Print string describing the pipeline (best-effort only).\n"
412 " - =text\tPrint a '-passes' compatible string describing the "
414 " - =tree\tPrint a tree-like structure describing the pipeline."));
418 std::optional<PrintPipelinePassesFormat> &Val) {
419 std::optional<PrintPipelinePassesFormat>
Format =
428 "'{0}' value invalid for print-pipeline-passes argument!", Arg));
442 for (
char C : Pipeline) {
450 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
480 return MFA ? &MFA->
getMF() :
nullptr;
486class TriggerVerifierErrorPass
492 auto *PtrTy = PointerType::getUnqual(
M.getContext());
494 GlobalValue::LinkageTypes::InternalLinkage,
495 "__bad_alias",
nullptr, &M);
515 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
520class RequireAllMachineFunctionPropertiesPass
528 static MachineFunctionProperties getRequiredProperties() {
529 return MachineFunctionProperties()
531 .setFailsVerification()
536 .setRegBankSelected()
538 .setTiedOpsRewritten()
539 .setTracksDebugUserValues()
540 .setTracksLiveness();
542 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
548 if (S ==
"Os" || S ==
"Oz")
550 Twine(
"The optimization level \"") + S +
551 "\" is no longer supported. Use O2 in conjunction with the " +
552 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
563 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
567 formatv(
"invalid optimization level '{}'", S).str(),
572 std::optional<PGOOptions> PGOOpt,
575 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
577 TM->registerPassBuilderCallbacks(*
this);
579 PIC->registerClassToPassNameCallback([
this, PIC]() {
583#define MODULE_PASS(NAME, CREATE_PASS) \
584 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
585#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
586 PIC->addClassToPassName(CLASS, NAME);
587#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
588 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
589#define FUNCTION_PASS(NAME, CREATE_PASS) \
590 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
591#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
592 PIC->addClassToPassName(CLASS, NAME);
593#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
594 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
595#define LOOPNEST_PASS(NAME, CREATE_PASS) \
596 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
597#define LOOP_PASS(NAME, CREATE_PASS) \
598 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
599#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
600 PIC->addClassToPassName(CLASS, NAME);
601#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
602 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
603#define CGSCC_PASS(NAME, CREATE_PASS) \
604 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
605#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
606 PIC->addClassToPassName(CLASS, NAME);
607#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
608 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
609#include "PassRegistry.def"
611#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
612 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
613#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
614 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
615#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
617 PIC->addClassToPassName(CLASS, NAME);
618#include "llvm/Passes/MachinePassRegistry.def"
626#define MODULE_CALLBACK(NAME, INVOKE) \
627 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
628 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
630 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
633 INVOKE(PM, L.get()); \
636#include "PassRegistry.def"
644#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
645 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
646 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
648 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
651 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
654#include "PassRegistry.def"
662#define FUNCTION_CALLBACK(NAME, INVOKE) \
663 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
664 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
666 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
669 INVOKE(PM, L.get()); \
672#include "PassRegistry.def"
680#define CGSCC_CALLBACK(NAME, INVOKE) \
681 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
682 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
684 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
687 INVOKE(PM, L.get()); \
690#include "PassRegistry.def"
698#define LOOP_CALLBACK(NAME, INVOKE) \
699 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
700 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
702 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
705 INVOKE(PM, L.get()); \
708#include "PassRegistry.def"
714#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
715 MAM.registerPass([&] { return CREATE_PASS; });
716#include "PassRegistry.def"
718 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
723#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
724 CGAM.registerPass([&] { return CREATE_PASS; });
725#include "PassRegistry.def"
727 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
737#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
738 if constexpr (std::is_constructible_v< \
739 std::remove_reference_t<decltype(CREATE_PASS)>, \
740 const TargetMachine &>) { \
742 FAM.registerPass([&] { return CREATE_PASS; }); \
744 FAM.registerPass([&] { return CREATE_PASS; }); \
746#include "PassRegistry.def"
748 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
755#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
756 MFAM.registerPass([&] { return CREATE_PASS; });
757#include "llvm/Passes/MachinePassRegistry.def"
759 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
764#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
765 LAM.registerPass([&] { return CREATE_PASS; });
766#include "PassRegistry.def"
768 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
772static std::optional<std::pair<bool, bool>>
774 std::pair<bool, bool> Params;
775 if (!Name.consume_front(
"function"))
779 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
781 while (!Name.empty()) {
782 auto [Front, Back] = Name.split(
';');
784 if (Front ==
"eager-inv")
786 else if (Front ==
"no-rerun")
787 Params.second =
true;
795 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
807 while (!Params.
empty()) {
809 std::tie(ParamName, Params) = Params.
split(
';');
811 if (ParamName == OptionName) {
828 while (!Params.
empty()) {
830 std::tie(ParamName, Params) = Params.
split(
';');
835 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
840 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
844 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
849 if (ParamName ==
"force-hardware-loops") {
851 }
else if (ParamName ==
"force-hardware-loop-phi") {
853 }
else if (ParamName ==
"force-nested-hardware-loop") {
855 }
else if (ParamName ==
"force-hardware-loop-guard") {
859 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
863 return HardwareLoopOpts;
875 "FunctionPropertiesStatisticsPass");
886 while (!Params.
empty()) {
888 std::tie(ParamName, Params) = Params.
split(
';');
889 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
891 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
898 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
905 if (ParamName ==
"partial") {
907 }
else if (ParamName ==
"peeling") {
909 }
else if (ParamName ==
"profile-peeling") {
911 }
else if (ParamName ==
"runtime") {
913 }
else if (ParamName ==
"upperbound") {
917 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
926 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
946 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
955 "EntryExitInstrumenter");
960 "DropUnnecessaryAssumes");
969 "LowerMatrixIntrinsics");
974 while (!Params.
empty()) {
976 std::tie(ParamName, Params) = Params.
split(
';');
979 if (ParamName ==
"preserve-order")
981 else if (ParamName ==
"rename-all")
983 else if (ParamName ==
"fold-all")
985 else if (ParamName ==
"reorder-operands")
989 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
999 while (!Params.
empty()) {
1001 std::tie(ParamName, Params) = Params.
split(
';');
1003 if (ParamName ==
"kernel") {
1004 Result.CompileKernel =
true;
1005 }
else if (ParamName ==
"use-after-scope") {
1006 Result.UseAfterScope =
true;
1009 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1019 while (!Params.
empty()) {
1021 std::tie(ParamName, Params) = Params.
split(
';');
1023 if (ParamName ==
"recover") {
1025 }
else if (ParamName ==
"kernel") {
1026 Result.CompileKernel =
true;
1029 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1038parseDropTypeTestsPassOptions(
StringRef Params) {
1040 while (!Params.
empty()) {
1042 std::tie(ParamName, Params) = Params.
split(
';');
1044 if (ParamName ==
"all") {
1046 }
else if (ParamName ==
"assume") {
1050 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1059 while (!Params.
empty()) {
1061 std::tie(ParamName, Params) = Params.
split(
';');
1063 if (ParamName ==
"thinlto") {
1065 }
else if (ParamName ==
"emit-summary") {
1066 Result.EmitLTOSummary =
true;
1069 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1077parseLowerAllowCheckPassOptions(
StringRef Params) {
1079 while (!Params.
empty()) {
1081 std::tie(ParamName, Params) = Params.
split(
';');
1092 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1099 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1104 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1106 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1107 IndicesStr, CutoffStr)
1111 while (IndicesStr !=
"") {
1113 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1119 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1120 firstIndexStr, IndicesStr)
1127 if (index >=
Result.cutoffs.size())
1128 Result.cutoffs.resize(index + 1, 0);
1130 Result.cutoffs[index] = cutoff;
1132 }
else if (ParamName.
starts_with(
"runtime_check")) {
1134 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1138 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1140 ValueString, Params)
1144 Result.runtime_check = runtime_check;
1147 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1158 while (!Params.
empty()) {
1160 std::tie(ParamName, Params) = Params.
split(
';');
1162 if (ParamName ==
"recover") {
1164 }
else if (ParamName ==
"kernel") {
1169 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1174 }
else if (ParamName ==
"eager-checks") {
1175 Result.EagerChecks =
true;
1178 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1188 while (!Params.
empty()) {
1190 std::tie(ParamName, Params) = Params.
split(
';');
1197 formatv(
"invalid argument to AllocToken pass mode "
1204 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1214 while (!Params.
empty()) {
1216 std::tie(ParamName, Params) = Params.
split(
';');
1219 if (ParamName ==
"speculate-blocks") {
1221 }
else if (ParamName ==
"simplify-cond-branch") {
1223 }
else if (ParamName ==
"forward-switch-cond") {
1225 }
else if (ParamName ==
"switch-range-to-icmp") {
1227 }
else if (ParamName ==
"switch-to-arithmetic") {
1229 }
else if (ParamName ==
"switch-to-lookup") {
1231 }
else if (ParamName ==
"keep-loops") {
1233 }
else if (ParamName ==
"hoist-common-insts") {
1235 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1237 }
else if (ParamName ==
"sink-common-insts") {
1239 }
else if (ParamName ==
"speculate-unpredictables") {
1242 APInt BonusInstThreshold;
1245 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1253 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1264 Result.setVerifyFixpoint(
true);
1265 while (!Params.
empty()) {
1267 std::tie(ParamName, Params) = Params.
split(
';');
1270 if (ParamName ==
"verify-fixpoint") {
1273 APInt MaxIterations;
1276 formatv(
"invalid argument to InstCombine pass max-iterations "
1284 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1294 while (!Params.
empty()) {
1296 std::tie(ParamName, Params) = Params.
split(
';');
1299 if (ParamName ==
"interleave-forced-only") {
1301 }
else if (ParamName ==
"vectorize-forced-only") {
1305 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1313 std::pair<bool, bool>
Result = {
false,
true};
1314 while (!Params.
empty()) {
1316 std::tie(ParamName, Params) = Params.
split(
';');
1319 if (ParamName ==
"nontrivial") {
1321 }
else if (ParamName ==
"trivial") {
1325 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1334 while (!Params.
empty()) {
1336 std::tie(ParamName, Params) = Params.
split(
';');
1339 if (ParamName ==
"allowspeculation") {
1343 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1350struct LoopRotateOptions {
1351 bool EnableHeaderDuplication =
true;
1352 bool PrepareForLTO =
false;
1353 bool CheckExitCount =
false;
1357 LoopRotateOptions
Result;
1358 while (!Params.
empty()) {
1360 std::tie(ParamName, Params) = Params.
split(
';');
1363 if (ParamName ==
"header-duplication") {
1365 }
else if (ParamName ==
"prepare-for-lto") {
1367 }
else if (ParamName ==
"check-exit-count") {
1371 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1380 while (!Params.
empty()) {
1382 std::tie(ParamName, Params) = Params.
split(
';');
1385 if (ParamName ==
"split-footer-bb") {
1389 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1400 while (!Params.
empty()) {
1402 std::tie(ParamName, Params) = Params.
split(
';');
1405 if (ParamName ==
"scalar-pre") {
1407 }
else if (ParamName ==
"load-pre") {
1409 }
else if (ParamName ==
"split-backedge-load-pre") {
1411 }
else if (ParamName ==
"memdep") {
1415 }
else if (ParamName ==
"memoryssa") {
1421 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1430 while (!Params.
empty()) {
1432 std::tie(ParamName, Params) = Params.
split(
';');
1435 if (ParamName ==
"func-spec")
1439 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1447 while (!Params.
empty()) {
1449 std::tie(ParamName, Params) = Params.
split(
';');
1454 formatv(
"invalid argument to Scalarizer pass min-bits "
1465 if (ParamName ==
"load-store")
1467 else if (ParamName ==
"variable-insert-extract")
1471 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1481 bool SawCFGOption =
false;
1482 while (!Params.
empty()) {
1484 std::tie(ParamName, Params) = Params.
split(
';');
1486 if (ParamName ==
"modify-cfg") {
1491 SawCFGOption =
true;
1492 }
else if (ParamName ==
"preserve-cfg") {
1497 SawCFGOption =
true;
1498 }
else if (ParamName ==
"aggregate-to-vector") {
1499 Result.AggregateToVector =
true;
1502 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1503 "modify-cfg, or aggregate-to-vector)",
1513parseStackLifetimeOptions(
StringRef Params) {
1515 while (!Params.
empty()) {
1517 std::tie(ParamName, Params) = Params.
split(
';');
1519 if (ParamName ==
"may") {
1521 }
else if (ParamName ==
"must") {
1525 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1534 "DependenceAnalysisPrinter");
1539 "SeparateConstOffsetFromGEP");
1548parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1552 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1560 "MemorySSAPrinterPass");
1565 "SpeculativeExecutionPass");
1570 while (!Params.
empty()) {
1572 std::tie(ParamName, Params) = Params.
split(
';');
1578 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1586parseStructuralHashPrinterPassOptions(
StringRef Params) {
1589 if (Params ==
"detailed")
1591 if (Params ==
"call-target-ignored")
1594 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1600 "WinEHPreparePass");
1605 while (!Params.
empty()) {
1607 std::tie(ParamName, Params) = Params.
split(
';');
1610 if (ParamName ==
"group-by-use")
1612 else if (ParamName ==
"ignore-single-use")
1614 else if (ParamName ==
"merge-const")
1616 else if (ParamName ==
"merge-const-aggressive")
1618 else if (ParamName ==
"merge-external")
1623 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1627 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1636 while (!Params.
empty()) {
1638 std::tie(ParamName, Params) = Params.
split(
';');
1644 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1655 while (!Params.
empty()) {
1657 std::tie(ParamName, Params) = Params.
split(
';');
1660 std::optional<RegAllocFilterFunc>
Filter =
1664 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1673 if (ParamName ==
"no-clear-vregs") {
1679 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1686parseBoundsCheckingOptions(
StringRef Params) {
1688 while (!Params.
empty()) {
1690 std::tie(ParamName, Params) = Params.
split(
';');
1691 if (ParamName ==
"trap") {
1693 }
else if (ParamName ==
"rt") {
1699 }
else if (ParamName ==
"rt-abort") {
1705 }
else if (ParamName ==
"min-rt") {
1711 }
else if (ParamName ==
"min-rt-abort") {
1717 }
else if (ParamName ==
"merge") {
1719 }
else if (ParamName ==
"handler-preserve-all-regs") {
1721 Options.Rt->HandlerPreserveAllRegs =
true;
1725 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1731 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1748 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1750 Param.str().c_str());
1753 if (!
Level.has_value())
1755 "invalid optimization level for expand-ir-insts pass: %s",
1756 Digit.str().c_str());
1763 if (Params.
empty() || Params ==
"all")
1764 return RAGreedyPass::Options();
1768 return RAGreedyPass::Options{*
Filter, Params};
1771 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1777 "MachineSinkingPass");
1781 bool AllowTailMerge =
true;
1782 if (!Params.
empty()) {
1784 if (Params !=
"tail-merge")
1786 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1790 return AllowTailMerge;
1794 bool ClearVirtRegs =
true;
1795 if (!Params.
empty()) {
1797 if (Params !=
"clear-vregs")
1799 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1802 return ClearVirtRegs;
1805struct FatLTOOptions {
1806 OptimizationLevel OptLevel;
1807 bool ThinLTO =
false;
1808 bool EmitSummary =
false;
1813 bool HaveOptLevel =
false;
1814 while (!Params.
empty()) {
1816 std::tie(ParamName, Params) = Params.
split(
';');
1818 if (ParamName ==
"thinlto") {
1820 }
else if (ParamName ==
"emit-summary") {
1821 Result.EmitSummary =
true;
1822 }
else if (std::optional<OptimizationLevel> OptLevel =
1824 Result.OptLevel = *OptLevel;
1825 HaveOptLevel =
true;
1828 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1835 "missing optimization level for fatlto-pre-link pipeline",
1850template <
typename PassManagerT,
typename CallbacksT>
1852 if (!Callbacks.empty()) {
1853 PassManagerT DummyPM;
1854 for (
auto &CB : Callbacks)
1855 if (CB(Name, DummyPM, {}))
1861template <
typename CallbacksT>
1863 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1866 if (Name ==
"module")
1868 if (Name ==
"cgscc")
1870 if (NameNoBracket ==
"function")
1872 if (Name ==
"coro-cond")
1875#define MODULE_PASS(NAME, CREATE_PASS) \
1878#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1879 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1881#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1882 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1884#include "PassRegistry.def"
1889template <
typename CallbacksT>
1892 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1893 if (Name ==
"cgscc")
1895 if (NameNoBracket ==
"function")
1902#define CGSCC_PASS(NAME, CREATE_PASS) \
1905#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1906 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1908#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1909 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1911#include "PassRegistry.def"
1916template <
typename CallbacksT>
1919 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1920 if (NameNoBracket ==
"function")
1922 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1925#define FUNCTION_PASS(NAME, CREATE_PASS) \
1928#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1929 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1931#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1932 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1934#include "PassRegistry.def"
1939template <
typename CallbacksT>
1942 if (Name ==
"machine-function")
1945#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1948#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1950 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1953#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1954 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1957#include "llvm/Passes/MachinePassRegistry.def"
1962template <
typename CallbacksT>
1964 bool &UseMemorySSA) {
1965 UseMemorySSA =
false;
1968 UseMemorySSA =
true;
1972#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1975#include "PassRegistry.def"
1980template <
typename CallbacksT>
1982 bool &UseMemorySSA) {
1983 UseMemorySSA =
false;
1986 UseMemorySSA =
true;
1990#define LOOP_PASS(NAME, CREATE_PASS) \
1993#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1994 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1996#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1997 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1999#include "PassRegistry.def"
2004std::optional<std::vector<PassBuilder::PipelineElement>>
2006 std::vector<PipelineElement> ResultPipeline;
2011 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2012 size_t Pos =
Text.find_first_of(
",()");
2013 Pipeline.push_back({
Text.substr(0, Pos), {}});
2016 if (Pos ==
Text.npos)
2019 char Sep =
Text[Pos];
2027 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2031 assert(Sep ==
')' &&
"Bogus separator!");
2036 if (PipelineStack.
size() == 1)
2037 return std::nullopt;
2040 }
while (
Text.consume_front(
")"));
2048 if (!
Text.consume_front(
","))
2049 return std::nullopt;
2052 if (PipelineStack.
size() > 1)
2054 return std::nullopt;
2056 assert(PipelineStack.
back() == &ResultPipeline &&
2057 "Wrong pipeline at the bottom of the stack!");
2058 return {std::move(ResultPipeline)};
2068 const PipelineElement &
E) {
2069 auto &
Name =
E.Name;
2070 auto &InnerPipeline =
E.InnerPipeline;
2073 if (!InnerPipeline.empty()) {
2074 if (Name ==
"module") {
2076 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2078 MPM.
addPass(std::move(NestedMPM));
2081 if (Name ==
"coro-cond") {
2083 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2085 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2088 if (Name ==
"cgscc") {
2090 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2098 "cannot have a no-rerun module to function adaptor",
2101 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2108 for (
auto &
C : ModulePipelineParsingCallbacks)
2109 if (
C(Name, MPM, InnerPipeline))
2114 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2120#define MODULE_PASS(NAME, CREATE_PASS) \
2121 if (Name == NAME) { \
2122 MPM.addPass(CREATE_PASS); \
2123 return Error::success(); \
2125#define MODULE_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(CREATE_PASS(Params.get())); \
2131 return Error::success(); \
2133#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2134 if (Name == "require<" NAME ">") { \
2136 RequireAnalysisPass< \
2137 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2138 return Error::success(); \
2140 if (Name == "invalidate<" NAME ">") { \
2141 MPM.addPass(InvalidateAnalysisPass< \
2142 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2143 return Error::success(); \
2145#define CGSCC_PASS(NAME, CREATE_PASS) \
2146 if (Name == NAME) { \
2147 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2148 return Error::success(); \
2150#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2151 if (checkParametrizedPassName(Name, NAME)) { \
2152 auto Params = parsePassParameters(PARSER, Name, NAME); \
2154 return Params.takeError(); \
2156 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2157 return Error::success(); \
2159#define FUNCTION_PASS(NAME, CREATE_PASS) \
2160 if (Name == NAME) { \
2161 if constexpr (std::is_constructible_v< \
2162 std::remove_reference_t<decltype(CREATE_PASS)>, \
2163 const TargetMachine &>) { \
2165 return make_error<StringError>( \
2166 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2167 inconvertibleErrorCode()); \
2169 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2170 return Error::success(); \
2172#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2173 if (checkParametrizedPassName(Name, NAME)) { \
2174 auto Params = parsePassParameters(PARSER, Name, NAME); \
2176 return Params.takeError(); \
2177 auto CreatePass = CREATE_PASS; \
2178 if constexpr (std::is_constructible_v< \
2179 std::remove_reference_t<decltype(CreatePass( \
2181 const TargetMachine &, \
2182 std::remove_reference_t<decltype(Params.get())>>) { \
2184 return make_error<StringError>( \
2185 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2186 inconvertibleErrorCode()); \
2189 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2190 return Error::success(); \
2192#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2193 if (Name == NAME) { \
2194 MPM.addPass(createModuleToFunctionPassAdaptor( \
2195 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2196 return Error::success(); \
2198#define LOOP_PASS(NAME, CREATE_PASS) \
2199 if (Name == NAME) { \
2200 MPM.addPass(createModuleToFunctionPassAdaptor( \
2201 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2202 return Error::success(); \
2204#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2205 if (checkParametrizedPassName(Name, NAME)) { \
2206 auto Params = parsePassParameters(PARSER, Name, NAME); \
2208 return Params.takeError(); \
2209 MPM.addPass(createModuleToFunctionPassAdaptor( \
2210 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2211 return Error::success(); \
2213#include "PassRegistry.def"
2215 for (
auto &
C : ModulePipelineParsingCallbacks)
2216 if (
C(Name, MPM, InnerPipeline))
2219 formatv(
"unknown module pass '{}'", Name).str(),
2224 const PipelineElement &
E) {
2225 auto &
Name =
E.Name;
2226 auto &InnerPipeline =
E.InnerPipeline;
2229 if (!InnerPipeline.empty()) {
2230 if (Name ==
"cgscc") {
2232 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2235 CGPM.
addPass(std::move(NestedCGPM));
2240 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2244 std::move(FPM), Params->first, Params->second));
2249 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2256 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2257 if (
C(Name, CGPM, InnerPipeline))
2262 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2267#define CGSCC_PASS(NAME, CREATE_PASS) \
2268 if (Name == NAME) { \
2269 CGPM.addPass(CREATE_PASS); \
2270 return Error::success(); \
2272#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2273 if (checkParametrizedPassName(Name, NAME)) { \
2274 auto Params = parsePassParameters(PARSER, Name, NAME); \
2276 return Params.takeError(); \
2277 CGPM.addPass(CREATE_PASS(Params.get())); \
2278 return Error::success(); \
2280#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2281 if (Name == "require<" NAME ">") { \
2282 CGPM.addPass(RequireAnalysisPass< \
2283 std::remove_reference_t<decltype(CREATE_PASS)>, \
2284 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2285 CGSCCUpdateResult &>()); \
2286 return Error::success(); \
2288 if (Name == "invalidate<" NAME ">") { \
2289 CGPM.addPass(InvalidateAnalysisPass< \
2290 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2291 return Error::success(); \
2293#define FUNCTION_PASS(NAME, CREATE_PASS) \
2294 if (Name == NAME) { \
2295 if constexpr (std::is_constructible_v< \
2296 std::remove_reference_t<decltype(CREATE_PASS)>, \
2297 const TargetMachine &>) { \
2299 return make_error<StringError>( \
2300 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2301 inconvertibleErrorCode()); \
2303 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2304 return Error::success(); \
2306#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2307 if (checkParametrizedPassName(Name, NAME)) { \
2308 auto Params = parsePassParameters(PARSER, Name, NAME); \
2310 return Params.takeError(); \
2311 auto CreatePass = CREATE_PASS; \
2312 if constexpr (std::is_constructible_v< \
2313 std::remove_reference_t<decltype(CreatePass( \
2315 const TargetMachine &, \
2316 std::remove_reference_t<decltype(Params.get())>>) { \
2318 return make_error<StringError>( \
2319 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2320 inconvertibleErrorCode()); \
2323 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2324 return Error::success(); \
2326#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2327 if (Name == NAME) { \
2328 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2329 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2330 return Error::success(); \
2332#define LOOP_PASS(NAME, CREATE_PASS) \
2333 if (Name == NAME) { \
2334 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2335 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2336 return Error::success(); \
2338#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2339 if (checkParametrizedPassName(Name, NAME)) { \
2340 auto Params = parsePassParameters(PARSER, Name, NAME); \
2342 return Params.takeError(); \
2343 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2344 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2345 return Error::success(); \
2347#include "PassRegistry.def"
2349 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2350 if (
C(Name, CGPM, InnerPipeline))
2357 const PipelineElement &
E) {
2358 auto &
Name =
E.Name;
2359 auto &InnerPipeline =
E.InnerPipeline;
2362 if (!InnerPipeline.empty()) {
2363 if (Name ==
"function") {
2365 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2368 FPM.
addPass(std::move(NestedFPM));
2371 if (Name ==
"loop" || Name ==
"loop-mssa") {
2373 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2376 bool UseMemorySSA = (
Name ==
"loop-mssa");
2381 if (Name ==
"machine-function") {
2383 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2389 for (
auto &
C : FunctionPipelineParsingCallbacks)
2390 if (
C(Name, FPM, InnerPipeline))
2395 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2400#define FUNCTION_PASS(NAME, CREATE_PASS) \
2401 if (Name == NAME) { \
2402 if constexpr (std::is_constructible_v< \
2403 std::remove_reference_t<decltype(CREATE_PASS)>, \
2404 const TargetMachine &>) { \
2406 return make_error<StringError>( \
2407 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2408 inconvertibleErrorCode()); \
2410 FPM.addPass(CREATE_PASS); \
2411 return Error::success(); \
2413#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2414 if (checkParametrizedPassName(Name, NAME)) { \
2415 auto Params = parsePassParameters(PARSER, Name, NAME); \
2417 return Params.takeError(); \
2418 auto CreatePass = CREATE_PASS; \
2419 if constexpr (std::is_constructible_v< \
2420 std::remove_reference_t<decltype(CreatePass( \
2422 const TargetMachine &, \
2423 std::remove_reference_t<decltype(Params.get())>>) { \
2425 return make_error<StringError>( \
2426 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2427 inconvertibleErrorCode()); \
2430 FPM.addPass(CREATE_PASS(Params.get())); \
2431 return Error::success(); \
2433#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2434 if (Name == "require<" NAME ">") { \
2435 if constexpr (std::is_constructible_v< \
2436 std::remove_reference_t<decltype(CREATE_PASS)>, \
2437 const TargetMachine &>) { \
2439 return make_error<StringError>( \
2440 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2441 inconvertibleErrorCode()); \
2444 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2446 return Error::success(); \
2448 if (Name == "invalidate<" NAME ">") { \
2449 FPM.addPass(InvalidateAnalysisPass< \
2450 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2451 return Error::success(); \
2457#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2458 if (Name == NAME) { \
2459 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2460 return Error::success(); \
2462#define LOOP_PASS(NAME, CREATE_PASS) \
2463 if (Name == NAME) { \
2464 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2465 return Error::success(); \
2467#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2468 if (checkParametrizedPassName(Name, NAME)) { \
2469 auto Params = parsePassParameters(PARSER, Name, NAME); \
2471 return Params.takeError(); \
2473 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2474 return Error::success(); \
2476#include "PassRegistry.def"
2478 for (
auto &
C : FunctionPipelineParsingCallbacks)
2479 if (
C(Name, FPM, InnerPipeline))
2482 formatv(
"unknown function pass '{}'", Name).str(),
2487 const PipelineElement &
E) {
2488 StringRef
Name =
E.Name;
2489 auto &InnerPipeline =
E.InnerPipeline;
2492 if (!InnerPipeline.empty()) {
2493 if (Name ==
"loop") {
2495 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2498 LPM.addPass(std::move(NestedLPM));
2502 for (
auto &
C : LoopPipelineParsingCallbacks)
2503 if (
C(Name, LPM, InnerPipeline))
2508 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2513#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2514 if (Name == NAME) { \
2515 LPM.addPass(CREATE_PASS); \
2516 return Error::success(); \
2518#define LOOP_PASS(NAME, CREATE_PASS) \
2519 if (Name == NAME) { \
2520 LPM.addPass(CREATE_PASS); \
2521 return Error::success(); \
2523#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2524 if (checkParametrizedPassName(Name, NAME)) { \
2525 auto Params = parsePassParameters(PARSER, Name, NAME); \
2527 return Params.takeError(); \
2528 LPM.addPass(CREATE_PASS(Params.get())); \
2529 return Error::success(); \
2531#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2532 if (Name == "require<" NAME ">") { \
2533 LPM.addPass(RequireAnalysisPass< \
2534 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2535 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2537 return Error::success(); \
2539 if (Name == "invalidate<" NAME ">") { \
2540 LPM.addPass(InvalidateAnalysisPass< \
2541 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2542 return Error::success(); \
2544#include "PassRegistry.def"
2546 for (
auto &
C : LoopPipelineParsingCallbacks)
2547 if (
C(Name, LPM, InnerPipeline))
2554 const PipelineElement &
E) {
2555 StringRef
Name =
E.Name;
2557 if (!
E.InnerPipeline.empty()) {
2558 if (
E.Name ==
"machine-function") {
2560 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2562 MFPM.
addPass(std::move(NestedPM));
2569#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2570 if (Name == NAME) { \
2571 MFPM.addPass(CREATE_PASS); \
2572 return Error::success(); \
2574#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2575 if (Name == NAME) { \
2576 MFPM.addPass(CREATE_PASS); \
2577 return Error::success(); \
2579#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2581 if (checkParametrizedPassName(Name, NAME)) { \
2582 auto Params = parsePassParameters(PARSER, Name, NAME); \
2584 return Params.takeError(); \
2585 MFPM.addPass(CREATE_PASS(Params.get())); \
2586 return Error::success(); \
2588#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2589 if (Name == "require<" NAME ">") { \
2591 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2592 MachineFunction>()); \
2593 return Error::success(); \
2595 if (Name == "invalidate<" NAME ">") { \
2596 MFPM.addPass(InvalidateAnalysisPass< \
2597 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2598 return Error::success(); \
2600#include "llvm/Passes/MachinePassRegistry.def"
2602 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2603 if (
C(Name, MFPM,
E.InnerPipeline))
2606 formatv(
"unknown machine pass '{}'", Name).str(),
2611#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2612 if (Name == NAME) { \
2613 AA.registerModuleAnalysis< \
2614 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2617#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2618 if (Name == NAME) { \
2619 AA.registerFunctionAnalysis< \
2620 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2623#include "PassRegistry.def"
2625 for (
auto &
C : AAParsingCallbacks)
2631Error PassBuilder::parseMachinePassPipeline(
2633 for (
const auto &Element : Pipeline) {
2634 if (
auto Err = parseMachinePass(MFPM, Element))
2642 for (
const auto &Element : Pipeline) {
2643 if (
auto Err = parseLoopPass(LPM, Element))
2649Error PassBuilder::parseFunctionPassPipeline(
2651 for (
const auto &Element : Pipeline) {
2652 if (
auto Err = parseFunctionPass(FPM, Element))
2660 for (
const auto &Element : Pipeline) {
2661 if (
auto Err = parseCGSCCPass(CGPM, Element))
2693 for (
const auto &Element : Pipeline) {
2694 if (
auto Err = parseModulePass(MPM, Element))
2705 auto Pipeline = parsePipelineText(PipelineText);
2706 if (!Pipeline || Pipeline->empty())
2708 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2718 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2720 FunctionPipelineParsingCallbacks)) {
2721 Pipeline = {{
"function", std::move(*Pipeline)}};
2724 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2725 std::move(*Pipeline)}}}};
2726 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2728 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2729 std::move(*Pipeline)}}}};
2731 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2732 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2734 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2735 if (
C(MPM, *Pipeline))
2739 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2741 formatv(
"unknown {} name '{}'",
2742 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2748 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2756 auto Pipeline = parsePipelineText(PipelineText);
2757 if (!Pipeline || Pipeline->empty())
2759 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2765 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2770 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2779 auto Pipeline = parsePipelineText(PipelineText);
2780 if (!Pipeline || Pipeline->empty())
2782 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2788 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2793 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2801 auto Pipeline = parsePipelineText(PipelineText);
2802 if (!Pipeline || Pipeline->empty())
2804 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2807 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2815 auto Pipeline = parsePipelineText(PipelineText);
2816 if (!Pipeline || Pipeline->empty())
2818 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2821 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2830 if (PipelineText ==
"default") {
2835 while (!PipelineText.
empty()) {
2837 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2838 if (!parseAAPassName(
AA, Name))
2840 formatv(
"unknown alias analysis name '{}'", Name).str(),
2847std::optional<RegAllocFilterFunc>
2849 if (FilterName ==
"all")
2851 for (
auto &
C : RegClassFilterParsingCallbacks)
2852 if (
auto F =
C(FilterName))
2854 return std::nullopt;
2865 auto I = PassNames.
begin();
2866 auto End = PassNames.
end();
2874 OS <<
" " << Name <<
'<' << Params <<
">\n";
2881 OS <<
"Module passes:\n";
2882 static constexpr char ModulePassNames[] = {
"\0"
2883#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2884#include "PassRegistry.def"
2888 OS <<
"Module passes with params:\n";
2889 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2890#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2891 NAME "\0" PARAMS "\0"
2892#include "PassRegistry.def"
2896 OS <<
"Module analyses:\n";
2897 static constexpr char ModuleAnalysisNames[] = {
"\0"
2898#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2899#include "PassRegistry.def"
2903 OS <<
"Module alias analyses:\n";
2904 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2905#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2906#include "PassRegistry.def"
2910 OS <<
"CGSCC passes:\n";
2911 static constexpr char CGSCCPassNames[] = {
"\0"
2912#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2913#include "PassRegistry.def"
2917 OS <<
"CGSCC passes with params:\n";
2918 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2919#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2920 NAME "\0" PARAMS "\0"
2921#include "PassRegistry.def"
2925 OS <<
"CGSCC analyses:\n";
2926 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2927#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2928#include "PassRegistry.def"
2932 OS <<
"Function passes:\n";
2933 static constexpr char FunctionPassNames[] = {
"\0"
2934#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2935#include "PassRegistry.def"
2939 OS <<
"Function passes with params:\n";
2940 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2941#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2942 NAME "\0" PARAMS "\0"
2943#include "PassRegistry.def"
2947 OS <<
"Function analyses:\n";
2948 static constexpr char FunctionAnalysisNames[] = {
"\0"
2949#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2950#include "PassRegistry.def"
2954 OS <<
"Function alias analyses:\n";
2955 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2956#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2957#include "PassRegistry.def"
2961 OS <<
"LoopNest passes:\n";
2962 static constexpr char LoopNestPassNames[] = {
"\0"
2963#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2964#include "PassRegistry.def"
2968 OS <<
"Loop passes:\n";
2969 static constexpr char LoopPassNames[] = {
"\0"
2970#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2971#include "PassRegistry.def"
2975 OS <<
"Loop passes with params:\n";
2976 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2977#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2978 NAME "\0" PARAMS "\0"
2979#include "PassRegistry.def"
2983 OS <<
"Loop analyses:\n";
2984 static constexpr char LoopAnalysisNames[] = {
"\0"
2985#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2986#include "PassRegistry.def"
2990 OS <<
"Machine module passes (WIP):\n";
2991 static constexpr char MachineModulePassNames[] = {
"\0"
2992#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2993#include "llvm/Passes/MachinePassRegistry.def"
2997 OS <<
"Machine function passes (WIP):\n";
2998 static constexpr char MachineFunctionPassNames[] = {
"\0"
2999#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3000#include "llvm/Passes/MachinePassRegistry.def"
3004 OS <<
"Machine function analyses (WIP):\n";
3005 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3006#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3007#include "llvm/Passes/MachinePassRegistry.def"
3015 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.
This file contains the declaration of the BreakFalseDepsPass class, used to identify and avoid false ...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Contains definition of the base CFIFixup pass.
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 contains the declaration of the MachineKCFI class, which is a Machine Pass that implements ...
#define LLVM_ATTRIBUTE_NOINLINE
LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so, mark a method "not for inl...
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 LLVM_ATTRIBUTE_NOINLINE void printPassNameList(StringTable PassNames, raw_ostream &OS)
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 LLVM_ATTRIBUTE_NOINLINE void printPassNameListWithParams(StringTable PassNames, 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.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
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".
MachineFunction & getMF()
This analysis create MachineFunction for given Function.
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 O0
Disable as many optimizations as possible.
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.
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
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
Check if the string is empty.
char front() const
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)
A table of densely packed, null-terminated strings indexed by offset.
constexpr Iterator begin() const
constexpr Iterator end() const
Primary interface to the complete machine description for the target machine.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
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.
DXILDebugInfoMap run(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.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI cl::opt< std::optional< PrintPipelinePassesFormat >, false, PrintPipelinePassesFormatParser > PrintPipelinePasses
Common option used by multiple tools to print pipeline passes.
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.
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.
support::detail::RepeatAdapter< T > fmt_repeat(T &&Item, size_t Count)
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 >
LLVM_ABI void printFormattedPipelinePasses(raw_ostream &OS, StringRef Pipeline, PrintPipelinePassesFormat Format=PrintPipelinePassesFormat::Text)
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.
LLVM_ABI bool applyDebugifyMetadataToMachineFunction(DIBuilder &DIB, Function &F, llvm::function_ref< MachineFunction *(Function &)> GetMF)
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...
PrintPipelinePassesFormat
@ Detailed
Hash with opcode only.
@ CallTargetIgnored
Hash with opcode and operands.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
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 for passes that can be skipped.
RegAllocFilterFunc Filter