429 "Print string describing the pipeline (best-effort only).\n"
430 " - =text\tPrint a '-passes' compatible string describing the "
432 " - =tree\tPrint a tree-like structure describing the pipeline."));
436 std::optional<PrintPipelinePassesFormat> &Val) {
437 std::optional<PrintPipelinePassesFormat>
Format =
446 "'{0}' value invalid for print-pipeline-passes argument!", Arg));
460 for (
char C : Pipeline) {
468 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
498 return MFA ? &MFA->
getMF() :
nullptr;
504class TriggerVerifierErrorPass
510 auto *PtrTy = PointerType::getUnqual(
M.getContext());
512 GlobalValue::LinkageTypes::InternalLinkage,
513 "__bad_alias",
nullptr, &M);
533 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
538class RequireAllMachineFunctionPropertiesPass
546 static MachineFunctionProperties getRequiredProperties() {
547 return MachineFunctionProperties()
549 .setFailsVerification()
554 .setRegBankSelected()
556 .setTiedOpsRewritten()
557 .setTracksDebugUserValues()
558 .setTracksLiveness();
560 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
566 if (S ==
"Os" || S ==
"Oz")
568 Twine(
"The optimization level \"") + S +
569 "\" is no longer supported. Use O2 in conjunction with the " +
570 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
581 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
585 formatv(
"invalid optimization level '{}'", S).str(),
590 std::optional<PGOOptions> PGOOpt,
593 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
595 TM->registerPassBuilderCallbacks(*
this);
597 PIC->registerClassToPassNameCallback([
this, PIC]() {
601#define MODULE_PASS(NAME, CREATE_PASS) \
602 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
603#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
604 PIC->addClassToPassName(CLASS, NAME);
605#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
606 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
607#define FUNCTION_PASS(NAME, CREATE_PASS) \
608 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
609#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
610 PIC->addClassToPassName(CLASS, NAME);
611#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
612 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
613#define LOOPNEST_PASS(NAME, CREATE_PASS) \
614 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
615#define LOOP_PASS(NAME, CREATE_PASS) \
616 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
617#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
618 PIC->addClassToPassName(CLASS, NAME);
619#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
620 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
621#define CGSCC_PASS(NAME, CREATE_PASS) \
622 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
623#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
624 PIC->addClassToPassName(CLASS, NAME);
625#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
626 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
627#include "PassRegistry.def"
629#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
630 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
631#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
632 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
633#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
635 PIC->addClassToPassName(CLASS, NAME);
636#include "llvm/Passes/MachinePassRegistry.def"
644#define MODULE_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()); \
654#include "PassRegistry.def"
662#define MODULE_LTO_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(), ThinOrFullLTOPhase::None); \
672#include "PassRegistry.def"
680#define FUNCTION_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 CGSCC_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"
716#define LOOP_CALLBACK(NAME, INVOKE) \
717 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
718 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
720 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
723 INVOKE(PM, L.get()); \
726#include "PassRegistry.def"
732#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
733 MAM.registerPass([&] { return CREATE_PASS; });
734#include "PassRegistry.def"
736 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
741#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
742 CGAM.registerPass([&] { return CREATE_PASS; });
743#include "PassRegistry.def"
745 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
755#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
756 if constexpr (std::is_constructible_v< \
757 std::remove_reference_t<decltype(CREATE_PASS)>, \
758 const TargetMachine &>) { \
760 FAM.registerPass([&] { return CREATE_PASS; }); \
762 FAM.registerPass([&] { return CREATE_PASS; }); \
764#include "PassRegistry.def"
766 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
773#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
774 MFAM.registerPass([&] { return CREATE_PASS; });
775#include "llvm/Passes/MachinePassRegistry.def"
777 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
782#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
783 LAM.registerPass([&] { return CREATE_PASS; });
784#include "PassRegistry.def"
786 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
790static std::optional<std::pair<bool, bool>>
792 std::pair<bool, bool> Params;
793 if (!Name.consume_front(
"function"))
797 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
799 while (!Name.empty()) {
800 auto [Front, Back] = Name.split(
';');
802 if (Front ==
"eager-inv")
804 else if (Front ==
"no-rerun")
805 Params.second =
true;
813 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
825 while (!Params.
empty()) {
827 std::tie(ParamName, Params) = Params.
split(
';');
829 if (ParamName == OptionName) {
846 while (!Params.
empty()) {
848 std::tie(ParamName, Params) = Params.
split(
';');
853 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
858 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
862 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
867 if (ParamName ==
"force-hardware-loops") {
869 }
else if (ParamName ==
"force-hardware-loop-phi") {
871 }
else if (ParamName ==
"force-nested-hardware-loop") {
873 }
else if (ParamName ==
"force-hardware-loop-guard") {
877 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
881 return HardwareLoopOpts;
893 "FunctionPropertiesStatisticsPass");
904 while (!Params.
empty()) {
906 std::tie(ParamName, Params) = Params.
split(
';');
907 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
909 UnrollOpts.
setOptLevel(
static_cast<int>(*OptLevel));
916 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
923 if (ParamName ==
"partial") {
925 }
else if (ParamName ==
"peeling") {
927 }
else if (ParamName ==
"profile-peeling") {
929 }
else if (ParamName ==
"runtime") {
931 }
else if (ParamName ==
"upperbound") {
933 }
else if (ParamName ==
"prepare-for-lto") {
937 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
946 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
966 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
975 "EntryExitInstrumenter");
980 "DropUnnecessaryAssumes");
985 "LowerMatrixIntrinsics");
990 while (!Params.
empty()) {
992 std::tie(ParamName, Params) = Params.
split(
';');
995 if (ParamName ==
"preserve-order")
997 else if (ParamName ==
"rename-all")
999 else if (ParamName ==
"fold-all")
1001 else if (ParamName ==
"reorder-operands")
1005 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
1015 while (!Params.
empty()) {
1017 std::tie(ParamName, Params) = Params.
split(
';');
1019 if (ParamName ==
"kernel") {
1020 Result.CompileKernel =
true;
1021 }
else if (ParamName ==
"use-after-scope") {
1022 Result.UseAfterScope =
true;
1025 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1035 while (!Params.
empty()) {
1037 std::tie(ParamName, Params) = Params.
split(
';');
1039 if (ParamName ==
"recover") {
1041 }
else if (ParamName ==
"kernel") {
1042 Result.CompileKernel =
true;
1045 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1054parseDropTypeTestsPassOptions(
StringRef Params) {
1056 while (!Params.
empty()) {
1058 std::tie(ParamName, Params) = Params.
split(
';');
1060 if (ParamName ==
"all") {
1062 }
else if (ParamName ==
"assume") {
1066 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1075 while (!Params.
empty()) {
1077 std::tie(ParamName, Params) = Params.
split(
';');
1079 if (ParamName ==
"thinlto") {
1081 }
else if (ParamName ==
"emit-summary") {
1082 Result.EmitLTOSummary =
true;
1085 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1093parseLowerAllowCheckPassOptions(
StringRef Params) {
1095 while (!Params.
empty()) {
1097 std::tie(ParamName, Params) = Params.
split(
';');
1108 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1115 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1120 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1122 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1123 IndicesStr, CutoffStr)
1127 while (IndicesStr !=
"") {
1129 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1135 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1136 firstIndexStr, IndicesStr)
1143 if (index >=
Result.cutoffs.size())
1144 Result.cutoffs.resize(index + 1, 0);
1146 Result.cutoffs[index] = cutoff;
1148 }
else if (ParamName.
starts_with(
"runtime_check")) {
1150 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1154 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1156 ValueString, Params)
1160 Result.runtime_check = runtime_check;
1163 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1174 while (!Params.
empty()) {
1176 std::tie(ParamName, Params) = Params.
split(
';');
1178 if (ParamName ==
"recover") {
1180 }
else if (ParamName ==
"kernel") {
1185 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1190 }
else if (ParamName ==
"eager-checks") {
1191 Result.EagerChecks =
true;
1194 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1204 while (!Params.
empty()) {
1206 std::tie(ParamName, Params) = Params.
split(
';');
1213 formatv(
"invalid argument to AllocToken pass mode "
1220 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1230 while (!Params.
empty()) {
1232 std::tie(ParamName, Params) = Params.
split(
';');
1235 if (ParamName ==
"speculate-blocks") {
1237 }
else if (ParamName ==
"simplify-cond-branch") {
1239 }
else if (ParamName ==
"forward-switch-cond") {
1241 }
else if (ParamName ==
"switch-range-to-icmp") {
1243 }
else if (ParamName ==
"switch-to-arithmetic") {
1245 }
else if (ParamName ==
"switch-to-lookup") {
1247 }
else if (ParamName ==
"keep-loops") {
1249 }
else if (ParamName ==
"hoist-common-insts") {
1251 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1253 }
else if (ParamName ==
"sink-common-insts") {
1255 }
else if (ParamName ==
"speculate-unpredictables") {
1258 APInt BonusInstThreshold;
1261 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1269 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1280 Result.setVerifyFixpoint(
true);
1281 while (!Params.
empty()) {
1283 std::tie(ParamName, Params) = Params.
split(
';');
1286 if (ParamName ==
"verify-fixpoint") {
1289 APInt MaxIterations;
1292 formatv(
"invalid argument to InstCombine pass max-iterations "
1300 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1310 while (!Params.
empty()) {
1312 std::tie(ParamName, Params) = Params.
split(
';');
1315 if (ParamName ==
"interleave-forced-only") {
1317 }
else if (ParamName ==
"vectorize-forced-only") {
1321 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1329 std::pair<bool, bool>
Result = {
false,
true};
1330 while (!Params.
empty()) {
1332 std::tie(ParamName, Params) = Params.
split(
';');
1335 if (ParamName ==
"nontrivial") {
1337 }
else if (ParamName ==
"trivial") {
1341 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1350 while (!Params.
empty()) {
1352 std::tie(ParamName, Params) = Params.
split(
';');
1355 if (ParamName ==
"allowspeculation") {
1359 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1366struct LoopRotateOptions {
1367 bool EnableHeaderDuplication =
true;
1368 bool PrepareForLTO =
false;
1369 bool CheckExitCount =
false;
1373 LoopRotateOptions
Result;
1374 while (!Params.
empty()) {
1376 std::tie(ParamName, Params) = Params.
split(
';');
1379 if (ParamName ==
"header-duplication") {
1381 }
else if (ParamName ==
"prepare-for-lto") {
1383 }
else if (ParamName ==
"check-exit-count") {
1387 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1396 while (!Params.
empty()) {
1398 std::tie(ParamName, Params) = Params.
split(
';');
1401 if (ParamName ==
"split-footer-bb") {
1405 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1416 while (!Params.
empty()) {
1418 std::tie(ParamName, Params) = Params.
split(
';');
1421 if (ParamName ==
"scalar-pre") {
1423 }
else if (ParamName ==
"load-pre") {
1425 }
else if (ParamName ==
"split-backedge-load-pre") {
1427 }
else if (ParamName ==
"memdep") {
1431 }
else if (ParamName ==
"memoryssa") {
1437 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1446 while (!Params.
empty()) {
1448 std::tie(ParamName, Params) = Params.
split(
';');
1451 if (ParamName ==
"func-spec")
1455 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1463 while (!Params.
empty()) {
1465 std::tie(ParamName, Params) = Params.
split(
';');
1470 formatv(
"invalid argument to Scalarizer pass min-bits "
1481 if (ParamName ==
"load-store")
1483 else if (ParamName ==
"variable-insert-extract")
1487 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1497 bool SawCFGOption =
false;
1498 while (!Params.
empty()) {
1500 std::tie(ParamName, Params) = Params.
split(
';');
1502 if (ParamName ==
"modify-cfg") {
1507 SawCFGOption =
true;
1508 }
else if (ParamName ==
"preserve-cfg") {
1513 SawCFGOption =
true;
1514 }
else if (ParamName ==
"aggregate-to-vector") {
1515 Result.AggregateToVector =
true;
1518 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1519 "modify-cfg, or aggregate-to-vector)",
1529parseStackLifetimeOptions(
StringRef Params) {
1531 while (!Params.
empty()) {
1533 std::tie(ParamName, Params) = Params.
split(
';');
1535 if (ParamName ==
"may") {
1537 }
else if (ParamName ==
"must") {
1541 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1550 "DependenceAnalysisPrinter");
1555 "SeparateConstOffsetFromGEP");
1564parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1568 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1576 "MemorySSAPrinterPass");
1581 "SpeculativeExecutionPass");
1586 while (!Params.
empty()) {
1588 std::tie(ParamName, Params) = Params.
split(
';');
1594 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1602parseStructuralHashPrinterPassOptions(
StringRef Params) {
1605 if (Params ==
"detailed")
1607 if (Params ==
"call-target-ignored")
1610 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1616 "WinEHPreparePass");
1621 while (!Params.
empty()) {
1623 std::tie(ParamName, Params) = Params.
split(
';');
1626 if (ParamName ==
"group-by-use")
1628 else if (ParamName ==
"ignore-single-use")
1630 else if (ParamName ==
"merge-const")
1632 else if (ParamName ==
"merge-const-aggressive")
1634 else if (ParamName ==
"merge-external")
1639 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1643 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1652 while (!Params.
empty()) {
1654 std::tie(ParamName, Params) = Params.
split(
';');
1660 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1671 while (!Params.
empty()) {
1673 std::tie(ParamName, Params) = Params.
split(
';');
1676 std::optional<RegAllocFilterFunc>
Filter =
1680 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1689 if (ParamName ==
"no-clear-vregs") {
1695 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1702parseBoundsCheckingOptions(
StringRef Params) {
1704 while (!Params.
empty()) {
1706 std::tie(ParamName, Params) = Params.
split(
';');
1707 if (ParamName ==
"trap") {
1709 }
else if (ParamName ==
"rt") {
1715 }
else if (ParamName ==
"rt-abort") {
1721 }
else if (ParamName ==
"min-rt") {
1727 }
else if (ParamName ==
"min-rt-abort") {
1733 }
else if (ParamName ==
"merge") {
1735 }
else if (ParamName ==
"handler-preserve-all-regs") {
1737 Options.Rt->HandlerPreserveAllRegs =
true;
1741 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1747 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1764 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1766 Param.str().c_str());
1769 if (!
Level.has_value())
1771 "invalid optimization level for expand-ir-insts pass: %s",
1772 Digit.str().c_str());
1779 if (Params.
empty() || Params ==
"all")
1780 return RAGreedyPass::Options();
1784 return RAGreedyPass::Options{*
Filter, Params};
1787 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1793 "MachineSinkingPass");
1797 bool AllowTailMerge =
true;
1798 if (!Params.
empty()) {
1800 if (Params !=
"tail-merge")
1802 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1806 return AllowTailMerge;
1810 bool ClearVirtRegs =
true;
1811 if (!Params.
empty()) {
1813 if (Params !=
"clear-vregs")
1815 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1818 return ClearVirtRegs;
1821struct FatLTOOptions {
1823 bool ThinLTO =
false;
1824 bool EmitSummary =
false;
1829 bool HaveOptLevel =
false;
1830 while (!Params.
empty()) {
1832 std::tie(ParamName, Params) = Params.
split(
';');
1834 if (ParamName ==
"thinlto") {
1836 }
else if (ParamName ==
"emit-summary") {
1837 Result.EmitSummary =
true;
1838 }
else if (std::optional<OptimizationLevel> OptLevel =
1840 Result.OptLevel = *OptLevel;
1841 HaveOptLevel =
true;
1844 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1851 "missing optimization level for fatlto-pre-link pipeline",
1866template <
typename PassManagerT,
typename CallbacksT>
1868 if (!Callbacks.empty()) {
1869 PassManagerT DummyPM;
1870 for (
auto &CB : Callbacks)
1871 if (CB(Name, DummyPM, {}))
1877template <
typename CallbacksT>
1879 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1882 if (Name ==
"module")
1884 if (Name ==
"cgscc")
1886 if (NameNoBracket ==
"function")
1888 if (Name ==
"coro-cond")
1891#define MODULE_PASS(NAME, CREATE_PASS) \
1894#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1895 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1897#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1898 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1900#include "PassRegistry.def"
1905template <
typename CallbacksT>
1908 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1909 if (Name ==
"cgscc")
1911 if (NameNoBracket ==
"function")
1918#define CGSCC_PASS(NAME, CREATE_PASS) \
1921#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1922 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1924#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1925 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1927#include "PassRegistry.def"
1932template <
typename CallbacksT>
1935 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1936 if (NameNoBracket ==
"function")
1938 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1941#define FUNCTION_PASS(NAME, CREATE_PASS) \
1944#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1945 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1947#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1948 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1950#include "PassRegistry.def"
1955template <
typename CallbacksT>
1958 if (Name ==
"machine-function")
1961#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1964#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1966 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1969#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1970 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1973#include "llvm/Passes/MachinePassRegistry.def"
1978template <
typename CallbacksT>
1980 bool &UseMemorySSA) {
1981 UseMemorySSA =
false;
1984 UseMemorySSA =
true;
1988#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1991#include "PassRegistry.def"
1996template <
typename CallbacksT>
1998 bool &UseMemorySSA) {
1999 UseMemorySSA =
false;
2002 UseMemorySSA =
true;
2006#define LOOP_PASS(NAME, CREATE_PASS) \
2009#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2010 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
2012#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2013 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
2015#include "PassRegistry.def"
2020std::optional<std::vector<PassBuilder::PipelineElement>>
2022 std::vector<PipelineElement> ResultPipeline;
2027 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2028 size_t Pos =
Text.find_first_of(
",()");
2029 Pipeline.push_back({
Text.substr(0, Pos), {}});
2032 if (Pos ==
Text.npos)
2035 char Sep =
Text[Pos];
2043 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2047 assert(Sep ==
')' &&
"Bogus separator!");
2052 if (PipelineStack.
size() == 1)
2053 return std::nullopt;
2056 }
while (
Text.consume_front(
")"));
2064 if (!
Text.consume_front(
","))
2065 return std::nullopt;
2068 if (PipelineStack.
size() > 1)
2070 return std::nullopt;
2072 assert(PipelineStack.
back() == &ResultPipeline &&
2073 "Wrong pipeline at the bottom of the stack!");
2074 return {std::move(ResultPipeline)};
2084 const PipelineElement &
E) {
2085 auto &
Name =
E.Name;
2086 auto &InnerPipeline =
E.InnerPipeline;
2089 if (!InnerPipeline.empty()) {
2090 if (Name ==
"module") {
2092 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2094 MPM.
addPass(std::move(NestedMPM));
2097 if (Name ==
"coro-cond") {
2099 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2101 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2104 if (Name ==
"cgscc") {
2106 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2114 "cannot have a no-rerun module to function adaptor",
2117 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2124 for (
auto &
C : ModulePipelineParsingCallbacks)
2125 if (
C(Name, MPM, InnerPipeline))
2130 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2136#define MODULE_PASS(NAME, CREATE_PASS) \
2137 if (Name == NAME) { \
2138 MPM.addPass(CREATE_PASS); \
2139 return Error::success(); \
2141#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2142 if (checkParametrizedPassName(Name, NAME)) { \
2143 auto Params = parsePassParameters(PARSER, Name, NAME); \
2145 return Params.takeError(); \
2146 MPM.addPass(CREATE_PASS(Params.get())); \
2147 return Error::success(); \
2149#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2150 if (Name == "require<" NAME ">") { \
2152 RequireAnalysisPass< \
2153 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2154 return Error::success(); \
2156 if (Name == "invalidate<" NAME ">") { \
2157 MPM.addPass(InvalidateAnalysisPass< \
2158 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2159 return Error::success(); \
2161#define CGSCC_PASS(NAME, CREATE_PASS) \
2162 if (Name == NAME) { \
2163 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2164 return Error::success(); \
2166#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2167 if (checkParametrizedPassName(Name, NAME)) { \
2168 auto Params = parsePassParameters(PARSER, Name, NAME); \
2170 return Params.takeError(); \
2172 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2173 return Error::success(); \
2175#define FUNCTION_PASS(NAME, CREATE_PASS) \
2176 if (Name == NAME) { \
2177 if constexpr (std::is_constructible_v< \
2178 std::remove_reference_t<decltype(CREATE_PASS)>, \
2179 const TargetMachine &>) { \
2181 return make_error<StringError>( \
2182 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2183 inconvertibleErrorCode()); \
2185 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2186 return Error::success(); \
2188#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2189 if (checkParametrizedPassName(Name, NAME)) { \
2190 auto Params = parsePassParameters(PARSER, Name, NAME); \
2192 return Params.takeError(); \
2193 auto CreatePass = CREATE_PASS; \
2194 if constexpr (std::is_constructible_v< \
2195 std::remove_reference_t<decltype(CreatePass( \
2197 const TargetMachine &, \
2198 std::remove_reference_t<decltype(Params.get())>>) { \
2200 return make_error<StringError>( \
2201 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2202 inconvertibleErrorCode()); \
2205 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2206 return Error::success(); \
2208#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2209 if (Name == NAME) { \
2210 MPM.addPass(createModuleToFunctionPassAdaptor( \
2211 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2212 return Error::success(); \
2214#define LOOP_PASS(NAME, CREATE_PASS) \
2215 if (Name == NAME) { \
2216 MPM.addPass(createModuleToFunctionPassAdaptor( \
2217 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2218 return Error::success(); \
2220#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2221 if (checkParametrizedPassName(Name, NAME)) { \
2222 auto Params = parsePassParameters(PARSER, Name, NAME); \
2224 return Params.takeError(); \
2225 MPM.addPass(createModuleToFunctionPassAdaptor( \
2226 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2227 return Error::success(); \
2229#include "PassRegistry.def"
2231 for (
auto &
C : ModulePipelineParsingCallbacks)
2232 if (
C(Name, MPM, InnerPipeline))
2235 formatv(
"unknown module pass '{}'", Name).str(),
2240 const PipelineElement &
E) {
2241 auto &
Name =
E.Name;
2242 auto &InnerPipeline =
E.InnerPipeline;
2245 if (!InnerPipeline.empty()) {
2246 if (Name ==
"cgscc") {
2248 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2251 CGPM.
addPass(std::move(NestedCGPM));
2256 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2260 std::move(FPM), Params->first, Params->second));
2265 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2272 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2273 if (
C(Name, CGPM, InnerPipeline))
2278 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2283#define CGSCC_PASS(NAME, CREATE_PASS) \
2284 if (Name == NAME) { \
2285 CGPM.addPass(CREATE_PASS); \
2286 return Error::success(); \
2288#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2289 if (checkParametrizedPassName(Name, NAME)) { \
2290 auto Params = parsePassParameters(PARSER, Name, NAME); \
2292 return Params.takeError(); \
2293 CGPM.addPass(CREATE_PASS(Params.get())); \
2294 return Error::success(); \
2296#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2297 if (Name == "require<" NAME ">") { \
2298 CGPM.addPass(RequireAnalysisPass< \
2299 std::remove_reference_t<decltype(CREATE_PASS)>, \
2300 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2301 CGSCCUpdateResult &>()); \
2302 return Error::success(); \
2304 if (Name == "invalidate<" NAME ">") { \
2305 CGPM.addPass(InvalidateAnalysisPass< \
2306 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2307 return Error::success(); \
2309#define FUNCTION_PASS(NAME, CREATE_PASS) \
2310 if (Name == NAME) { \
2311 if constexpr (std::is_constructible_v< \
2312 std::remove_reference_t<decltype(CREATE_PASS)>, \
2313 const TargetMachine &>) { \
2315 return make_error<StringError>( \
2316 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2317 inconvertibleErrorCode()); \
2319 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2320 return Error::success(); \
2322#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2323 if (checkParametrizedPassName(Name, NAME)) { \
2324 auto Params = parsePassParameters(PARSER, Name, NAME); \
2326 return Params.takeError(); \
2327 auto CreatePass = CREATE_PASS; \
2328 if constexpr (std::is_constructible_v< \
2329 std::remove_reference_t<decltype(CreatePass( \
2331 const TargetMachine &, \
2332 std::remove_reference_t<decltype(Params.get())>>) { \
2334 return make_error<StringError>( \
2335 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2336 inconvertibleErrorCode()); \
2339 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2340 return Error::success(); \
2342#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2343 if (Name == NAME) { \
2344 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2345 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2346 return Error::success(); \
2348#define LOOP_PASS(NAME, CREATE_PASS) \
2349 if (Name == NAME) { \
2350 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2351 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2352 return Error::success(); \
2354#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2355 if (checkParametrizedPassName(Name, NAME)) { \
2356 auto Params = parsePassParameters(PARSER, Name, NAME); \
2358 return Params.takeError(); \
2359 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2360 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2361 return Error::success(); \
2363#include "PassRegistry.def"
2365 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2366 if (
C(Name, CGPM, InnerPipeline))
2373 const PipelineElement &
E) {
2374 auto &
Name =
E.Name;
2375 auto &InnerPipeline =
E.InnerPipeline;
2378 if (!InnerPipeline.empty()) {
2379 if (Name ==
"function") {
2381 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2384 FPM.
addPass(std::move(NestedFPM));
2387 if (Name ==
"loop" || Name ==
"loop-mssa") {
2389 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2392 bool UseMemorySSA = (
Name ==
"loop-mssa");
2397 if (Name ==
"machine-function") {
2399 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2405 for (
auto &
C : FunctionPipelineParsingCallbacks)
2406 if (
C(Name, FPM, InnerPipeline))
2411 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2416#define FUNCTION_PASS(NAME, CREATE_PASS) \
2417 if (Name == NAME) { \
2418 if constexpr (std::is_constructible_v< \
2419 std::remove_reference_t<decltype(CREATE_PASS)>, \
2420 const TargetMachine &>) { \
2422 return make_error<StringError>( \
2423 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2424 inconvertibleErrorCode()); \
2426 FPM.addPass(CREATE_PASS); \
2427 return Error::success(); \
2429#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2430 if (checkParametrizedPassName(Name, NAME)) { \
2431 auto Params = parsePassParameters(PARSER, Name, NAME); \
2433 return Params.takeError(); \
2434 auto CreatePass = CREATE_PASS; \
2435 if constexpr (std::is_constructible_v< \
2436 std::remove_reference_t<decltype(CreatePass( \
2438 const TargetMachine &, \
2439 std::remove_reference_t<decltype(Params.get())>>) { \
2441 return make_error<StringError>( \
2442 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2443 inconvertibleErrorCode()); \
2446 FPM.addPass(CREATE_PASS(Params.get())); \
2447 return Error::success(); \
2449#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2450 if (Name == "require<" NAME ">") { \
2451 if constexpr (std::is_constructible_v< \
2452 std::remove_reference_t<decltype(CREATE_PASS)>, \
2453 const TargetMachine &>) { \
2455 return make_error<StringError>( \
2456 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2457 inconvertibleErrorCode()); \
2460 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2462 return Error::success(); \
2464 if (Name == "invalidate<" NAME ">") { \
2465 FPM.addPass(InvalidateAnalysisPass< \
2466 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2467 return Error::success(); \
2473#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2474 if (Name == NAME) { \
2475 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2476 return Error::success(); \
2478#define LOOP_PASS(NAME, CREATE_PASS) \
2479 if (Name == NAME) { \
2480 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2481 return Error::success(); \
2483#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2484 if (checkParametrizedPassName(Name, NAME)) { \
2485 auto Params = parsePassParameters(PARSER, Name, NAME); \
2487 return Params.takeError(); \
2489 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2490 return Error::success(); \
2492#include "PassRegistry.def"
2494 for (
auto &
C : FunctionPipelineParsingCallbacks)
2495 if (
C(Name, FPM, InnerPipeline))
2498 formatv(
"unknown function pass '{}'", Name).str(),
2503 const PipelineElement &
E) {
2504 StringRef
Name =
E.Name;
2505 auto &InnerPipeline =
E.InnerPipeline;
2508 if (!InnerPipeline.empty()) {
2509 if (Name ==
"loop") {
2511 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2514 LPM.addPass(std::move(NestedLPM));
2518 for (
auto &
C : LoopPipelineParsingCallbacks)
2519 if (
C(Name, LPM, InnerPipeline))
2524 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2529#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2530 if (Name == NAME) { \
2531 LPM.addPass(CREATE_PASS); \
2532 return Error::success(); \
2534#define LOOP_PASS(NAME, CREATE_PASS) \
2535 if (Name == NAME) { \
2536 LPM.addPass(CREATE_PASS); \
2537 return Error::success(); \
2539#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2540 if (checkParametrizedPassName(Name, NAME)) { \
2541 auto Params = parsePassParameters(PARSER, Name, NAME); \
2543 return Params.takeError(); \
2544 LPM.addPass(CREATE_PASS(Params.get())); \
2545 return Error::success(); \
2547#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2548 if (Name == "require<" NAME ">") { \
2549 LPM.addPass(RequireAnalysisPass< \
2550 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2551 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2553 return Error::success(); \
2555 if (Name == "invalidate<" NAME ">") { \
2556 LPM.addPass(InvalidateAnalysisPass< \
2557 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2558 return Error::success(); \
2560#include "PassRegistry.def"
2562 for (
auto &
C : LoopPipelineParsingCallbacks)
2563 if (
C(Name, LPM, InnerPipeline))
2570 const PipelineElement &
E) {
2571 StringRef
Name =
E.Name;
2573 if (!
E.InnerPipeline.empty()) {
2574 if (
E.Name ==
"machine-function") {
2576 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2578 MFPM.
addPass(std::move(NestedPM));
2585#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2586 if (Name == NAME) { \
2587 MFPM.addPass(CREATE_PASS); \
2588 return Error::success(); \
2590#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2591 if (Name == NAME) { \
2592 MFPM.addPass(CREATE_PASS); \
2593 return Error::success(); \
2595#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2597 if (checkParametrizedPassName(Name, NAME)) { \
2598 auto Params = parsePassParameters(PARSER, Name, NAME); \
2600 return Params.takeError(); \
2601 MFPM.addPass(CREATE_PASS(Params.get())); \
2602 return Error::success(); \
2604#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2605 if (Name == "require<" NAME ">") { \
2607 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2608 MachineFunction>()); \
2609 return Error::success(); \
2611 if (Name == "invalidate<" NAME ">") { \
2612 MFPM.addPass(InvalidateAnalysisPass< \
2613 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2614 return Error::success(); \
2616#include "llvm/Passes/MachinePassRegistry.def"
2618 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2619 if (
C(Name, MFPM,
E.InnerPipeline))
2622 formatv(
"unknown machine pass '{}'", Name).str(),
2627#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2628 if (Name == NAME) { \
2629 AA.registerModuleAnalysis< \
2630 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2633#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2634 if (Name == NAME) { \
2635 AA.registerFunctionAnalysis< \
2636 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2639#include "PassRegistry.def"
2641 for (
auto &
C : AAParsingCallbacks)
2647Error PassBuilder::parseMachinePassPipeline(
2649 for (
const auto &Element : Pipeline) {
2650 if (
auto Err = parseMachinePass(MFPM, Element))
2658 for (
const auto &Element : Pipeline) {
2659 if (
auto Err = parseLoopPass(LPM, Element))
2665Error PassBuilder::parseFunctionPassPipeline(
2667 for (
const auto &Element : Pipeline) {
2668 if (
auto Err = parseFunctionPass(FPM, Element))
2676 for (
const auto &Element : Pipeline) {
2677 if (
auto Err = parseCGSCCPass(CGPM, Element))
2709 for (
const auto &Element : Pipeline) {
2710 if (
auto Err = parseModulePass(MPM, Element))
2721 auto Pipeline = parsePipelineText(PipelineText);
2722 if (!Pipeline || Pipeline->empty())
2724 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2734 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2736 FunctionPipelineParsingCallbacks)) {
2737 Pipeline = {{
"function", std::move(*Pipeline)}};
2740 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2741 std::move(*Pipeline)}}}};
2742 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2744 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2745 std::move(*Pipeline)}}}};
2747 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2748 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2750 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2751 if (
C(MPM, *Pipeline))
2755 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2757 formatv(
"unknown {} name '{}'",
2758 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2764 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2772 auto Pipeline = parsePipelineText(PipelineText);
2773 if (!Pipeline || Pipeline->empty())
2775 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2781 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2786 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2795 auto Pipeline = parsePipelineText(PipelineText);
2796 if (!Pipeline || Pipeline->empty())
2798 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2804 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2809 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2817 auto Pipeline = parsePipelineText(PipelineText);
2818 if (!Pipeline || Pipeline->empty())
2820 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2823 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2831 auto Pipeline = parsePipelineText(PipelineText);
2832 if (!Pipeline || Pipeline->empty())
2834 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2837 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2846 if (PipelineText ==
"default") {
2851 while (!PipelineText.
empty()) {
2853 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2854 if (!parseAAPassName(
AA, Name))
2856 formatv(
"unknown alias analysis name '{}'", Name).str(),
2863std::optional<RegAllocFilterFunc>
2865 if (FilterName ==
"all")
2867 for (
auto &
C : RegClassFilterParsingCallbacks)
2868 if (
auto F =
C(FilterName))
2870 return std::nullopt;
2881 auto I = PassNames.
begin();
2882 auto End = PassNames.
end();
2889 OS <<
" " << Name <<
'<' << Params <<
">\n";
2896 OS <<
"Module passes:\n";
2897 static constexpr char ModulePassNames[] = {
"\0"
2898#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2899#include "PassRegistry.def"
2903 OS <<
"Module passes with params:\n";
2904 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2905#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2906 NAME "\0" PARAMS "\0"
2907#include "PassRegistry.def"
2911 OS <<
"Module analyses:\n";
2912 static constexpr char ModuleAnalysisNames[] = {
"\0"
2913#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2914#include "PassRegistry.def"
2918 OS <<
"Module alias analyses:\n";
2919 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2920#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2921#include "PassRegistry.def"
2925 OS <<
"CGSCC passes:\n";
2926 static constexpr char CGSCCPassNames[] = {
"\0"
2927#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2928#include "PassRegistry.def"
2932 OS <<
"CGSCC passes with params:\n";
2933 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2934#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2935 NAME "\0" PARAMS "\0"
2936#include "PassRegistry.def"
2940 OS <<
"CGSCC analyses:\n";
2941 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2942#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2943#include "PassRegistry.def"
2947 OS <<
"Function passes:\n";
2948 static constexpr char FunctionPassNames[] = {
"\0"
2949#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2950#include "PassRegistry.def"
2954 OS <<
"Function passes with params:\n";
2955 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2956#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2957 NAME "\0" PARAMS "\0"
2958#include "PassRegistry.def"
2962 OS <<
"Function analyses:\n";
2963 static constexpr char FunctionAnalysisNames[] = {
"\0"
2964#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2965#include "PassRegistry.def"
2969 OS <<
"Function alias analyses:\n";
2970 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2971#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2972#include "PassRegistry.def"
2976 OS <<
"LoopNest passes:\n";
2977 static constexpr char LoopNestPassNames[] = {
"\0"
2978#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2979#include "PassRegistry.def"
2983 OS <<
"Loop passes:\n";
2984 static constexpr char LoopPassNames[] = {
"\0"
2985#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2986#include "PassRegistry.def"
2990 OS <<
"Loop passes with params:\n";
2991 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2992#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2993 NAME "\0" PARAMS "\0"
2994#include "PassRegistry.def"
2998 OS <<
"Loop analyses:\n";
2999 static constexpr char LoopAnalysisNames[] = {
"\0"
3000#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3001#include "PassRegistry.def"
3005 OS <<
"Machine module passes (WIP):\n";
3006 static constexpr char MachineModulePassNames[] = {
"\0"
3007#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
3008#include "llvm/Passes/MachinePassRegistry.def"
3012 OS <<
"Machine function passes (WIP):\n";
3013 static constexpr char MachineFunctionPassNames[] = {
"\0"
3014#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3015#include "llvm/Passes/MachinePassRegistry.def"
3019 OS <<
"Machine function analyses (WIP):\n";
3020 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3021#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3022#include "llvm/Passes/MachinePassRegistry.def"
3030 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< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
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 file declares the IRTranslator pass.
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 provides the interface for LLVM's Logical Scalar Replacement of Aggregates pass.
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 contains the declaration of the CheckDebugMachineModulePass class, used by the new pass man...
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 file describes the interface of the MachineFunctionPass responsible for assigning the generic vi...
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.
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.
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.
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.
@ O1
Optimize quickly without destroying debuggability.
@ O0
Disable as many optimizations as possible.
@ O3
Optimize for fast execution as much as possible.
@ O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
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.
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
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
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 & setPrepareForLTO(bool V)
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