416 "Print string describing the pipeline (best-effort only).\n"
417 " - =text\tPrint a '-passes' compatible string describing the "
419 " - =tree\tPrint a tree-like structure describing the pipeline."));
423 std::optional<PrintPipelinePassesFormat> &Val) {
424 std::optional<PrintPipelinePassesFormat>
Format =
433 "'{0}' value invalid for print-pipeline-passes argument!", Arg));
447 for (
char C : Pipeline) {
455 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
485 return MFA ? &MFA->
getMF() :
nullptr;
491class TriggerVerifierErrorPass
497 auto *PtrTy = PointerType::getUnqual(
M.getContext());
499 GlobalValue::LinkageTypes::InternalLinkage,
500 "__bad_alias",
nullptr, &M);
520 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
525class RequireAllMachineFunctionPropertiesPass
533 static MachineFunctionProperties getRequiredProperties() {
534 return MachineFunctionProperties()
536 .setFailsVerification()
541 .setRegBankSelected()
543 .setTiedOpsRewritten()
544 .setTracksDebugUserValues()
545 .setTracksLiveness();
547 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
553 if (S ==
"Os" || S ==
"Oz")
555 Twine(
"The optimization level \"") + S +
556 "\" is no longer supported. Use O2 in conjunction with the " +
557 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
568 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
572 formatv(
"invalid optimization level '{}'", S).str(),
577 std::optional<PGOOptions> PGOOpt,
580 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
582 TM->registerPassBuilderCallbacks(*
this);
584 PIC->registerClassToPassNameCallback([
this, PIC]() {
588#define MODULE_PASS(NAME, CREATE_PASS) \
589 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
590#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
591 PIC->addClassToPassName(CLASS, NAME);
592#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
593 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
594#define FUNCTION_PASS(NAME, CREATE_PASS) \
595 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
596#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
597 PIC->addClassToPassName(CLASS, NAME);
598#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
599 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
600#define LOOPNEST_PASS(NAME, CREATE_PASS) \
601 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
602#define LOOP_PASS(NAME, CREATE_PASS) \
603 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
604#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
605 PIC->addClassToPassName(CLASS, NAME);
606#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
607 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
608#define CGSCC_PASS(NAME, CREATE_PASS) \
609 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
610#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
611 PIC->addClassToPassName(CLASS, NAME);
612#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
613 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
614#include "PassRegistry.def"
616#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
617 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
618#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
619 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
620#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
622 PIC->addClassToPassName(CLASS, NAME);
623#include "llvm/Passes/MachinePassRegistry.def"
631#define MODULE_CALLBACK(NAME, INVOKE) \
632 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
633 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
635 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
638 INVOKE(PM, L.get()); \
641#include "PassRegistry.def"
649#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
650 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
651 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
653 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
656 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
659#include "PassRegistry.def"
667#define FUNCTION_CALLBACK(NAME, INVOKE) \
668 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
669 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
671 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
674 INVOKE(PM, L.get()); \
677#include "PassRegistry.def"
685#define CGSCC_CALLBACK(NAME, INVOKE) \
686 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
687 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
689 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
692 INVOKE(PM, L.get()); \
695#include "PassRegistry.def"
703#define LOOP_CALLBACK(NAME, INVOKE) \
704 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
705 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
707 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
710 INVOKE(PM, L.get()); \
713#include "PassRegistry.def"
719#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
720 MAM.registerPass([&] { return CREATE_PASS; });
721#include "PassRegistry.def"
723 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
728#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
729 CGAM.registerPass([&] { return CREATE_PASS; });
730#include "PassRegistry.def"
732 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
742#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
743 if constexpr (std::is_constructible_v< \
744 std::remove_reference_t<decltype(CREATE_PASS)>, \
745 const TargetMachine &>) { \
747 FAM.registerPass([&] { return CREATE_PASS; }); \
749 FAM.registerPass([&] { return CREATE_PASS; }); \
751#include "PassRegistry.def"
753 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
760#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
761 MFAM.registerPass([&] { return CREATE_PASS; });
762#include "llvm/Passes/MachinePassRegistry.def"
764 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
769#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
770 LAM.registerPass([&] { return CREATE_PASS; });
771#include "PassRegistry.def"
773 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
777static std::optional<std::pair<bool, bool>>
779 std::pair<bool, bool> Params;
780 if (!Name.consume_front(
"function"))
784 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
786 while (!Name.empty()) {
787 auto [Front, Back] = Name.split(
';');
789 if (Front ==
"eager-inv")
791 else if (Front ==
"no-rerun")
792 Params.second =
true;
800 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
812 while (!Params.
empty()) {
814 std::tie(ParamName, Params) = Params.
split(
';');
816 if (ParamName == OptionName) {
833 while (!Params.
empty()) {
835 std::tie(ParamName, Params) = Params.
split(
';');
840 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
845 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
849 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
854 if (ParamName ==
"force-hardware-loops") {
856 }
else if (ParamName ==
"force-hardware-loop-phi") {
858 }
else if (ParamName ==
"force-nested-hardware-loop") {
860 }
else if (ParamName ==
"force-hardware-loop-guard") {
864 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
868 return HardwareLoopOpts;
880 "FunctionPropertiesStatisticsPass");
891 while (!Params.
empty()) {
893 std::tie(ParamName, Params) = Params.
split(
';');
894 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
896 UnrollOpts.
setOptLevel(
static_cast<int>(*OptLevel));
903 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
910 if (ParamName ==
"partial") {
912 }
else if (ParamName ==
"peeling") {
914 }
else if (ParamName ==
"profile-peeling") {
916 }
else if (ParamName ==
"runtime") {
918 }
else if (ParamName ==
"upperbound") {
920 }
else if (ParamName ==
"prepare-for-lto") {
924 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
933 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
953 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
962 "EntryExitInstrumenter");
967 "DropUnnecessaryAssumes");
972 "LowerMatrixIntrinsics");
977 while (!Params.
empty()) {
979 std::tie(ParamName, Params) = Params.
split(
';');
982 if (ParamName ==
"preserve-order")
984 else if (ParamName ==
"rename-all")
986 else if (ParamName ==
"fold-all")
988 else if (ParamName ==
"reorder-operands")
992 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
1002 while (!Params.
empty()) {
1004 std::tie(ParamName, Params) = Params.
split(
';');
1006 if (ParamName ==
"kernel") {
1007 Result.CompileKernel =
true;
1008 }
else if (ParamName ==
"use-after-scope") {
1009 Result.UseAfterScope =
true;
1012 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1022 while (!Params.
empty()) {
1024 std::tie(ParamName, Params) = Params.
split(
';');
1026 if (ParamName ==
"recover") {
1028 }
else if (ParamName ==
"kernel") {
1029 Result.CompileKernel =
true;
1032 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1041parseDropTypeTestsPassOptions(
StringRef Params) {
1043 while (!Params.
empty()) {
1045 std::tie(ParamName, Params) = Params.
split(
';');
1047 if (ParamName ==
"all") {
1049 }
else if (ParamName ==
"assume") {
1053 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1062 while (!Params.
empty()) {
1064 std::tie(ParamName, Params) = Params.
split(
';');
1066 if (ParamName ==
"thinlto") {
1068 }
else if (ParamName ==
"emit-summary") {
1069 Result.EmitLTOSummary =
true;
1072 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1080parseLowerAllowCheckPassOptions(
StringRef Params) {
1082 while (!Params.
empty()) {
1084 std::tie(ParamName, Params) = Params.
split(
';');
1095 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1102 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1107 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1109 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1110 IndicesStr, CutoffStr)
1114 while (IndicesStr !=
"") {
1116 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1122 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1123 firstIndexStr, IndicesStr)
1130 if (index >=
Result.cutoffs.size())
1131 Result.cutoffs.resize(index + 1, 0);
1133 Result.cutoffs[index] = cutoff;
1135 }
else if (ParamName.
starts_with(
"runtime_check")) {
1137 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1141 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1143 ValueString, Params)
1147 Result.runtime_check = runtime_check;
1150 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1161 while (!Params.
empty()) {
1163 std::tie(ParamName, Params) = Params.
split(
';');
1165 if (ParamName ==
"recover") {
1167 }
else if (ParamName ==
"kernel") {
1172 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1177 }
else if (ParamName ==
"eager-checks") {
1178 Result.EagerChecks =
true;
1181 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1191 while (!Params.
empty()) {
1193 std::tie(ParamName, Params) = Params.
split(
';');
1200 formatv(
"invalid argument to AllocToken pass mode "
1207 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1217 while (!Params.
empty()) {
1219 std::tie(ParamName, Params) = Params.
split(
';');
1222 if (ParamName ==
"speculate-blocks") {
1224 }
else if (ParamName ==
"simplify-cond-branch") {
1226 }
else if (ParamName ==
"forward-switch-cond") {
1228 }
else if (ParamName ==
"switch-range-to-icmp") {
1230 }
else if (ParamName ==
"switch-to-arithmetic") {
1232 }
else if (ParamName ==
"switch-to-lookup") {
1234 }
else if (ParamName ==
"keep-loops") {
1236 }
else if (ParamName ==
"hoist-common-insts") {
1238 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1240 }
else if (ParamName ==
"sink-common-insts") {
1242 }
else if (ParamName ==
"speculate-unpredictables") {
1245 APInt BonusInstThreshold;
1248 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1256 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1267 Result.setVerifyFixpoint(
true);
1268 while (!Params.
empty()) {
1270 std::tie(ParamName, Params) = Params.
split(
';');
1273 if (ParamName ==
"verify-fixpoint") {
1276 APInt MaxIterations;
1279 formatv(
"invalid argument to InstCombine pass max-iterations "
1287 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1297 while (!Params.
empty()) {
1299 std::tie(ParamName, Params) = Params.
split(
';');
1302 if (ParamName ==
"interleave-forced-only") {
1304 }
else if (ParamName ==
"vectorize-forced-only") {
1308 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1316 std::pair<bool, bool>
Result = {
false,
true};
1317 while (!Params.
empty()) {
1319 std::tie(ParamName, Params) = Params.
split(
';');
1322 if (ParamName ==
"nontrivial") {
1324 }
else if (ParamName ==
"trivial") {
1328 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1337 while (!Params.
empty()) {
1339 std::tie(ParamName, Params) = Params.
split(
';');
1342 if (ParamName ==
"allowspeculation") {
1346 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1353struct LoopRotateOptions {
1354 bool EnableHeaderDuplication =
true;
1355 bool PrepareForLTO =
false;
1356 bool CheckExitCount =
false;
1360 LoopRotateOptions
Result;
1361 while (!Params.
empty()) {
1363 std::tie(ParamName, Params) = Params.
split(
';');
1366 if (ParamName ==
"header-duplication") {
1368 }
else if (ParamName ==
"prepare-for-lto") {
1370 }
else if (ParamName ==
"check-exit-count") {
1374 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1383 while (!Params.
empty()) {
1385 std::tie(ParamName, Params) = Params.
split(
';');
1388 if (ParamName ==
"split-footer-bb") {
1392 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1403 while (!Params.
empty()) {
1405 std::tie(ParamName, Params) = Params.
split(
';');
1408 if (ParamName ==
"scalar-pre") {
1410 }
else if (ParamName ==
"load-pre") {
1412 }
else if (ParamName ==
"split-backedge-load-pre") {
1414 }
else if (ParamName ==
"memdep") {
1418 }
else if (ParamName ==
"memoryssa") {
1424 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1433 while (!Params.
empty()) {
1435 std::tie(ParamName, Params) = Params.
split(
';');
1438 if (ParamName ==
"func-spec")
1442 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1450 while (!Params.
empty()) {
1452 std::tie(ParamName, Params) = Params.
split(
';');
1457 formatv(
"invalid argument to Scalarizer pass min-bits "
1468 if (ParamName ==
"load-store")
1470 else if (ParamName ==
"variable-insert-extract")
1474 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1484 bool SawCFGOption =
false;
1485 while (!Params.
empty()) {
1487 std::tie(ParamName, Params) = Params.
split(
';');
1489 if (ParamName ==
"modify-cfg") {
1494 SawCFGOption =
true;
1495 }
else if (ParamName ==
"preserve-cfg") {
1500 SawCFGOption =
true;
1501 }
else if (ParamName ==
"aggregate-to-vector") {
1502 Result.AggregateToVector =
true;
1505 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1506 "modify-cfg, or aggregate-to-vector)",
1516parseStackLifetimeOptions(
StringRef Params) {
1518 while (!Params.
empty()) {
1520 std::tie(ParamName, Params) = Params.
split(
';');
1522 if (ParamName ==
"may") {
1524 }
else if (ParamName ==
"must") {
1528 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1537 "DependenceAnalysisPrinter");
1542 "SeparateConstOffsetFromGEP");
1551parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1555 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1563 "MemorySSAPrinterPass");
1568 "SpeculativeExecutionPass");
1573 while (!Params.
empty()) {
1575 std::tie(ParamName, Params) = Params.
split(
';');
1581 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1589parseStructuralHashPrinterPassOptions(
StringRef Params) {
1592 if (Params ==
"detailed")
1594 if (Params ==
"call-target-ignored")
1597 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1603 "WinEHPreparePass");
1608 while (!Params.
empty()) {
1610 std::tie(ParamName, Params) = Params.
split(
';');
1613 if (ParamName ==
"group-by-use")
1615 else if (ParamName ==
"ignore-single-use")
1617 else if (ParamName ==
"merge-const")
1619 else if (ParamName ==
"merge-const-aggressive")
1621 else if (ParamName ==
"merge-external")
1626 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1630 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1639 while (!Params.
empty()) {
1641 std::tie(ParamName, Params) = Params.
split(
';');
1647 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1658 while (!Params.
empty()) {
1660 std::tie(ParamName, Params) = Params.
split(
';');
1663 std::optional<RegAllocFilterFunc>
Filter =
1667 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1676 if (ParamName ==
"no-clear-vregs") {
1682 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1689parseBoundsCheckingOptions(
StringRef Params) {
1691 while (!Params.
empty()) {
1693 std::tie(ParamName, Params) = Params.
split(
';');
1694 if (ParamName ==
"trap") {
1696 }
else if (ParamName ==
"rt") {
1702 }
else if (ParamName ==
"rt-abort") {
1708 }
else if (ParamName ==
"min-rt") {
1714 }
else if (ParamName ==
"min-rt-abort") {
1720 }
else if (ParamName ==
"merge") {
1722 }
else if (ParamName ==
"handler-preserve-all-regs") {
1724 Options.Rt->HandlerPreserveAllRegs =
true;
1728 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1734 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1751 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1753 Param.str().c_str());
1756 if (!
Level.has_value())
1758 "invalid optimization level for expand-ir-insts pass: %s",
1759 Digit.str().c_str());
1766 if (Params.
empty() || Params ==
"all")
1767 return RAGreedyPass::Options();
1771 return RAGreedyPass::Options{*
Filter, Params};
1774 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1780 "MachineSinkingPass");
1784 bool AllowTailMerge =
true;
1785 if (!Params.
empty()) {
1787 if (Params !=
"tail-merge")
1789 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1793 return AllowTailMerge;
1797 bool ClearVirtRegs =
true;
1798 if (!Params.
empty()) {
1800 if (Params !=
"clear-vregs")
1802 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1805 return ClearVirtRegs;
1808struct FatLTOOptions {
1810 bool ThinLTO =
false;
1811 bool EmitSummary =
false;
1816 bool HaveOptLevel =
false;
1817 while (!Params.
empty()) {
1819 std::tie(ParamName, Params) = Params.
split(
';');
1821 if (ParamName ==
"thinlto") {
1823 }
else if (ParamName ==
"emit-summary") {
1824 Result.EmitSummary =
true;
1825 }
else if (std::optional<OptimizationLevel> OptLevel =
1827 Result.OptLevel = *OptLevel;
1828 HaveOptLevel =
true;
1831 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1838 "missing optimization level for fatlto-pre-link pipeline",
1853template <
typename PassManagerT,
typename CallbacksT>
1855 if (!Callbacks.empty()) {
1856 PassManagerT DummyPM;
1857 for (
auto &CB : Callbacks)
1858 if (CB(Name, DummyPM, {}))
1864template <
typename CallbacksT>
1866 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1869 if (Name ==
"module")
1871 if (Name ==
"cgscc")
1873 if (NameNoBracket ==
"function")
1875 if (Name ==
"coro-cond")
1878#define MODULE_PASS(NAME, CREATE_PASS) \
1881#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1882 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1884#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1885 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1887#include "PassRegistry.def"
1892template <
typename CallbacksT>
1895 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1896 if (Name ==
"cgscc")
1898 if (NameNoBracket ==
"function")
1905#define CGSCC_PASS(NAME, CREATE_PASS) \
1908#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1909 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1911#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1912 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1914#include "PassRegistry.def"
1919template <
typename CallbacksT>
1922 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1923 if (NameNoBracket ==
"function")
1925 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1928#define FUNCTION_PASS(NAME, CREATE_PASS) \
1931#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1932 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1934#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1935 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1937#include "PassRegistry.def"
1942template <
typename CallbacksT>
1945 if (Name ==
"machine-function")
1948#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1951#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1953 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1956#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1957 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1960#include "llvm/Passes/MachinePassRegistry.def"
1965template <
typename CallbacksT>
1967 bool &UseMemorySSA) {
1968 UseMemorySSA =
false;
1971 UseMemorySSA =
true;
1975#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1978#include "PassRegistry.def"
1983template <
typename CallbacksT>
1985 bool &UseMemorySSA) {
1986 UseMemorySSA =
false;
1989 UseMemorySSA =
true;
1993#define LOOP_PASS(NAME, CREATE_PASS) \
1996#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1997 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1999#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2000 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
2002#include "PassRegistry.def"
2007std::optional<std::vector<PassBuilder::PipelineElement>>
2009 std::vector<PipelineElement> ResultPipeline;
2014 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2015 size_t Pos =
Text.find_first_of(
",()");
2016 Pipeline.push_back({
Text.substr(0, Pos), {}});
2019 if (Pos ==
Text.npos)
2022 char Sep =
Text[Pos];
2030 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2034 assert(Sep ==
')' &&
"Bogus separator!");
2039 if (PipelineStack.
size() == 1)
2040 return std::nullopt;
2043 }
while (
Text.consume_front(
")"));
2051 if (!
Text.consume_front(
","))
2052 return std::nullopt;
2055 if (PipelineStack.
size() > 1)
2057 return std::nullopt;
2059 assert(PipelineStack.
back() == &ResultPipeline &&
2060 "Wrong pipeline at the bottom of the stack!");
2061 return {std::move(ResultPipeline)};
2071 const PipelineElement &
E) {
2072 auto &
Name =
E.Name;
2073 auto &InnerPipeline =
E.InnerPipeline;
2076 if (!InnerPipeline.empty()) {
2077 if (Name ==
"module") {
2079 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2081 MPM.
addPass(std::move(NestedMPM));
2084 if (Name ==
"coro-cond") {
2086 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2088 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2091 if (Name ==
"cgscc") {
2093 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2101 "cannot have a no-rerun module to function adaptor",
2104 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2111 for (
auto &
C : ModulePipelineParsingCallbacks)
2112 if (
C(Name, MPM, InnerPipeline))
2117 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2123#define MODULE_PASS(NAME, CREATE_PASS) \
2124 if (Name == NAME) { \
2125 MPM.addPass(CREATE_PASS); \
2126 return Error::success(); \
2128#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2129 if (checkParametrizedPassName(Name, NAME)) { \
2130 auto Params = parsePassParameters(PARSER, Name, NAME); \
2132 return Params.takeError(); \
2133 MPM.addPass(CREATE_PASS(Params.get())); \
2134 return Error::success(); \
2136#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2137 if (Name == "require<" NAME ">") { \
2139 RequireAnalysisPass< \
2140 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2141 return Error::success(); \
2143 if (Name == "invalidate<" NAME ">") { \
2144 MPM.addPass(InvalidateAnalysisPass< \
2145 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2146 return Error::success(); \
2148#define CGSCC_PASS(NAME, CREATE_PASS) \
2149 if (Name == NAME) { \
2150 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2151 return Error::success(); \
2153#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2154 if (checkParametrizedPassName(Name, NAME)) { \
2155 auto Params = parsePassParameters(PARSER, Name, NAME); \
2157 return Params.takeError(); \
2159 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2160 return Error::success(); \
2162#define FUNCTION_PASS(NAME, CREATE_PASS) \
2163 if (Name == NAME) { \
2164 if constexpr (std::is_constructible_v< \
2165 std::remove_reference_t<decltype(CREATE_PASS)>, \
2166 const TargetMachine &>) { \
2168 return make_error<StringError>( \
2169 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2170 inconvertibleErrorCode()); \
2172 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2173 return Error::success(); \
2175#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2176 if (checkParametrizedPassName(Name, NAME)) { \
2177 auto Params = parsePassParameters(PARSER, Name, NAME); \
2179 return Params.takeError(); \
2180 auto CreatePass = CREATE_PASS; \
2181 if constexpr (std::is_constructible_v< \
2182 std::remove_reference_t<decltype(CreatePass( \
2184 const TargetMachine &, \
2185 std::remove_reference_t<decltype(Params.get())>>) { \
2187 return make_error<StringError>( \
2188 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2189 inconvertibleErrorCode()); \
2192 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2193 return Error::success(); \
2195#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2196 if (Name == NAME) { \
2197 MPM.addPass(createModuleToFunctionPassAdaptor( \
2198 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2199 return Error::success(); \
2201#define LOOP_PASS(NAME, CREATE_PASS) \
2202 if (Name == NAME) { \
2203 MPM.addPass(createModuleToFunctionPassAdaptor( \
2204 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2205 return Error::success(); \
2207#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2208 if (checkParametrizedPassName(Name, NAME)) { \
2209 auto Params = parsePassParameters(PARSER, Name, NAME); \
2211 return Params.takeError(); \
2212 MPM.addPass(createModuleToFunctionPassAdaptor( \
2213 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2214 return Error::success(); \
2216#include "PassRegistry.def"
2218 for (
auto &
C : ModulePipelineParsingCallbacks)
2219 if (
C(Name, MPM, InnerPipeline))
2222 formatv(
"unknown module pass '{}'", Name).str(),
2227 const PipelineElement &
E) {
2228 auto &
Name =
E.Name;
2229 auto &InnerPipeline =
E.InnerPipeline;
2232 if (!InnerPipeline.empty()) {
2233 if (Name ==
"cgscc") {
2235 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2238 CGPM.
addPass(std::move(NestedCGPM));
2243 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2247 std::move(FPM), Params->first, Params->second));
2252 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2259 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2260 if (
C(Name, CGPM, InnerPipeline))
2265 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2270#define CGSCC_PASS(NAME, CREATE_PASS) \
2271 if (Name == NAME) { \
2272 CGPM.addPass(CREATE_PASS); \
2273 return Error::success(); \
2275#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2276 if (checkParametrizedPassName(Name, NAME)) { \
2277 auto Params = parsePassParameters(PARSER, Name, NAME); \
2279 return Params.takeError(); \
2280 CGPM.addPass(CREATE_PASS(Params.get())); \
2281 return Error::success(); \
2283#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2284 if (Name == "require<" NAME ">") { \
2285 CGPM.addPass(RequireAnalysisPass< \
2286 std::remove_reference_t<decltype(CREATE_PASS)>, \
2287 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2288 CGSCCUpdateResult &>()); \
2289 return Error::success(); \
2291 if (Name == "invalidate<" NAME ">") { \
2292 CGPM.addPass(InvalidateAnalysisPass< \
2293 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2294 return Error::success(); \
2296#define FUNCTION_PASS(NAME, CREATE_PASS) \
2297 if (Name == NAME) { \
2298 if constexpr (std::is_constructible_v< \
2299 std::remove_reference_t<decltype(CREATE_PASS)>, \
2300 const TargetMachine &>) { \
2302 return make_error<StringError>( \
2303 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2304 inconvertibleErrorCode()); \
2306 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2307 return Error::success(); \
2309#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2310 if (checkParametrizedPassName(Name, NAME)) { \
2311 auto Params = parsePassParameters(PARSER, Name, NAME); \
2313 return Params.takeError(); \
2314 auto CreatePass = CREATE_PASS; \
2315 if constexpr (std::is_constructible_v< \
2316 std::remove_reference_t<decltype(CreatePass( \
2318 const TargetMachine &, \
2319 std::remove_reference_t<decltype(Params.get())>>) { \
2321 return make_error<StringError>( \
2322 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2323 inconvertibleErrorCode()); \
2326 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2327 return Error::success(); \
2329#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2330 if (Name == NAME) { \
2331 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2332 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2333 return Error::success(); \
2335#define LOOP_PASS(NAME, CREATE_PASS) \
2336 if (Name == NAME) { \
2337 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2338 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2339 return Error::success(); \
2341#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2342 if (checkParametrizedPassName(Name, NAME)) { \
2343 auto Params = parsePassParameters(PARSER, Name, NAME); \
2345 return Params.takeError(); \
2346 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2347 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2348 return Error::success(); \
2350#include "PassRegistry.def"
2352 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2353 if (
C(Name, CGPM, InnerPipeline))
2360 const PipelineElement &
E) {
2361 auto &
Name =
E.Name;
2362 auto &InnerPipeline =
E.InnerPipeline;
2365 if (!InnerPipeline.empty()) {
2366 if (Name ==
"function") {
2368 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2371 FPM.
addPass(std::move(NestedFPM));
2374 if (Name ==
"loop" || Name ==
"loop-mssa") {
2376 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2379 bool UseMemorySSA = (
Name ==
"loop-mssa");
2384 if (Name ==
"machine-function") {
2386 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2392 for (
auto &
C : FunctionPipelineParsingCallbacks)
2393 if (
C(Name, FPM, InnerPipeline))
2398 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2403#define FUNCTION_PASS(NAME, CREATE_PASS) \
2404 if (Name == NAME) { \
2405 if constexpr (std::is_constructible_v< \
2406 std::remove_reference_t<decltype(CREATE_PASS)>, \
2407 const TargetMachine &>) { \
2409 return make_error<StringError>( \
2410 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2411 inconvertibleErrorCode()); \
2413 FPM.addPass(CREATE_PASS); \
2414 return Error::success(); \
2416#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2417 if (checkParametrizedPassName(Name, NAME)) { \
2418 auto Params = parsePassParameters(PARSER, Name, NAME); \
2420 return Params.takeError(); \
2421 auto CreatePass = CREATE_PASS; \
2422 if constexpr (std::is_constructible_v< \
2423 std::remove_reference_t<decltype(CreatePass( \
2425 const TargetMachine &, \
2426 std::remove_reference_t<decltype(Params.get())>>) { \
2428 return make_error<StringError>( \
2429 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2430 inconvertibleErrorCode()); \
2433 FPM.addPass(CREATE_PASS(Params.get())); \
2434 return Error::success(); \
2436#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2437 if (Name == "require<" NAME ">") { \
2438 if constexpr (std::is_constructible_v< \
2439 std::remove_reference_t<decltype(CREATE_PASS)>, \
2440 const TargetMachine &>) { \
2442 return make_error<StringError>( \
2443 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2444 inconvertibleErrorCode()); \
2447 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2449 return Error::success(); \
2451 if (Name == "invalidate<" NAME ">") { \
2452 FPM.addPass(InvalidateAnalysisPass< \
2453 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2454 return Error::success(); \
2460#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2461 if (Name == NAME) { \
2462 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2463 return Error::success(); \
2465#define LOOP_PASS(NAME, CREATE_PASS) \
2466 if (Name == NAME) { \
2467 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2468 return Error::success(); \
2470#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2471 if (checkParametrizedPassName(Name, NAME)) { \
2472 auto Params = parsePassParameters(PARSER, Name, NAME); \
2474 return Params.takeError(); \
2476 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2477 return Error::success(); \
2479#include "PassRegistry.def"
2481 for (
auto &
C : FunctionPipelineParsingCallbacks)
2482 if (
C(Name, FPM, InnerPipeline))
2485 formatv(
"unknown function pass '{}'", Name).str(),
2490 const PipelineElement &
E) {
2491 StringRef
Name =
E.Name;
2492 auto &InnerPipeline =
E.InnerPipeline;
2495 if (!InnerPipeline.empty()) {
2496 if (Name ==
"loop") {
2498 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2501 LPM.addPass(std::move(NestedLPM));
2505 for (
auto &
C : LoopPipelineParsingCallbacks)
2506 if (
C(Name, LPM, InnerPipeline))
2511 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2516#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2517 if (Name == NAME) { \
2518 LPM.addPass(CREATE_PASS); \
2519 return Error::success(); \
2521#define LOOP_PASS(NAME, CREATE_PASS) \
2522 if (Name == NAME) { \
2523 LPM.addPass(CREATE_PASS); \
2524 return Error::success(); \
2526#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2527 if (checkParametrizedPassName(Name, NAME)) { \
2528 auto Params = parsePassParameters(PARSER, Name, NAME); \
2530 return Params.takeError(); \
2531 LPM.addPass(CREATE_PASS(Params.get())); \
2532 return Error::success(); \
2534#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2535 if (Name == "require<" NAME ">") { \
2536 LPM.addPass(RequireAnalysisPass< \
2537 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2538 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2540 return Error::success(); \
2542 if (Name == "invalidate<" NAME ">") { \
2543 LPM.addPass(InvalidateAnalysisPass< \
2544 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2545 return Error::success(); \
2547#include "PassRegistry.def"
2549 for (
auto &
C : LoopPipelineParsingCallbacks)
2550 if (
C(Name, LPM, InnerPipeline))
2557 const PipelineElement &
E) {
2558 StringRef
Name =
E.Name;
2560 if (!
E.InnerPipeline.empty()) {
2561 if (
E.Name ==
"machine-function") {
2563 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2565 MFPM.
addPass(std::move(NestedPM));
2572#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2573 if (Name == NAME) { \
2574 MFPM.addPass(CREATE_PASS); \
2575 return Error::success(); \
2577#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2578 if (Name == NAME) { \
2579 MFPM.addPass(CREATE_PASS); \
2580 return Error::success(); \
2582#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2584 if (checkParametrizedPassName(Name, NAME)) { \
2585 auto Params = parsePassParameters(PARSER, Name, NAME); \
2587 return Params.takeError(); \
2588 MFPM.addPass(CREATE_PASS(Params.get())); \
2589 return Error::success(); \
2591#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2592 if (Name == "require<" NAME ">") { \
2594 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2595 MachineFunction>()); \
2596 return Error::success(); \
2598 if (Name == "invalidate<" NAME ">") { \
2599 MFPM.addPass(InvalidateAnalysisPass< \
2600 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2601 return Error::success(); \
2603#include "llvm/Passes/MachinePassRegistry.def"
2605 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2606 if (
C(Name, MFPM,
E.InnerPipeline))
2609 formatv(
"unknown machine pass '{}'", Name).str(),
2614#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2615 if (Name == NAME) { \
2616 AA.registerModuleAnalysis< \
2617 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2620#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2621 if (Name == NAME) { \
2622 AA.registerFunctionAnalysis< \
2623 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2626#include "PassRegistry.def"
2628 for (
auto &
C : AAParsingCallbacks)
2634Error PassBuilder::parseMachinePassPipeline(
2636 for (
const auto &Element : Pipeline) {
2637 if (
auto Err = parseMachinePass(MFPM, Element))
2645 for (
const auto &Element : Pipeline) {
2646 if (
auto Err = parseLoopPass(LPM, Element))
2652Error PassBuilder::parseFunctionPassPipeline(
2654 for (
const auto &Element : Pipeline) {
2655 if (
auto Err = parseFunctionPass(FPM, Element))
2663 for (
const auto &Element : Pipeline) {
2664 if (
auto Err = parseCGSCCPass(CGPM, Element))
2696 for (
const auto &Element : Pipeline) {
2697 if (
auto Err = parseModulePass(MPM, Element))
2708 auto Pipeline = parsePipelineText(PipelineText);
2709 if (!Pipeline || Pipeline->empty())
2711 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2721 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2723 FunctionPipelineParsingCallbacks)) {
2724 Pipeline = {{
"function", std::move(*Pipeline)}};
2727 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2728 std::move(*Pipeline)}}}};
2729 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2731 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2732 std::move(*Pipeline)}}}};
2734 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2735 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2737 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2738 if (
C(MPM, *Pipeline))
2742 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2744 formatv(
"unknown {} name '{}'",
2745 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2751 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2759 auto Pipeline = parsePipelineText(PipelineText);
2760 if (!Pipeline || Pipeline->empty())
2762 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2768 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2773 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2782 auto Pipeline = parsePipelineText(PipelineText);
2783 if (!Pipeline || Pipeline->empty())
2785 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2791 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2796 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2804 auto Pipeline = parsePipelineText(PipelineText);
2805 if (!Pipeline || Pipeline->empty())
2807 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2810 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2818 auto Pipeline = parsePipelineText(PipelineText);
2819 if (!Pipeline || Pipeline->empty())
2821 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2824 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2833 if (PipelineText ==
"default") {
2838 while (!PipelineText.
empty()) {
2840 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2841 if (!parseAAPassName(
AA, Name))
2843 formatv(
"unknown alias analysis name '{}'", Name).str(),
2850std::optional<RegAllocFilterFunc>
2852 if (FilterName ==
"all")
2854 for (
auto &
C : RegClassFilterParsingCallbacks)
2855 if (
auto F =
C(FilterName))
2857 return std::nullopt;
2868 auto I = PassNames.
begin();
2869 auto End = PassNames.
end();
2876 OS <<
" " << Name <<
'<' << Params <<
">\n";
2883 OS <<
"Module passes:\n";
2884 static constexpr char ModulePassNames[] = {
"\0"
2885#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2886#include "PassRegistry.def"
2890 OS <<
"Module passes with params:\n";
2891 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2892#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2893 NAME "\0" PARAMS "\0"
2894#include "PassRegistry.def"
2898 OS <<
"Module analyses:\n";
2899 static constexpr char ModuleAnalysisNames[] = {
"\0"
2900#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2901#include "PassRegistry.def"
2905 OS <<
"Module alias analyses:\n";
2906 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2907#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2908#include "PassRegistry.def"
2912 OS <<
"CGSCC passes:\n";
2913 static constexpr char CGSCCPassNames[] = {
"\0"
2914#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2915#include "PassRegistry.def"
2919 OS <<
"CGSCC passes with params:\n";
2920 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2921#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2922 NAME "\0" PARAMS "\0"
2923#include "PassRegistry.def"
2927 OS <<
"CGSCC analyses:\n";
2928 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2929#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2930#include "PassRegistry.def"
2934 OS <<
"Function passes:\n";
2935 static constexpr char FunctionPassNames[] = {
"\0"
2936#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2937#include "PassRegistry.def"
2941 OS <<
"Function passes with params:\n";
2942 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2943#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2944 NAME "\0" PARAMS "\0"
2945#include "PassRegistry.def"
2949 OS <<
"Function analyses:\n";
2950 static constexpr char FunctionAnalysisNames[] = {
"\0"
2951#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2952#include "PassRegistry.def"
2956 OS <<
"Function alias analyses:\n";
2957 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2958#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2959#include "PassRegistry.def"
2963 OS <<
"LoopNest passes:\n";
2964 static constexpr char LoopNestPassNames[] = {
"\0"
2965#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2966#include "PassRegistry.def"
2970 OS <<
"Loop passes:\n";
2971 static constexpr char LoopPassNames[] = {
"\0"
2972#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2973#include "PassRegistry.def"
2977 OS <<
"Loop passes with params:\n";
2978 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2979#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2980 NAME "\0" PARAMS "\0"
2981#include "PassRegistry.def"
2985 OS <<
"Loop analyses:\n";
2986 static constexpr char LoopAnalysisNames[] = {
"\0"
2987#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2988#include "PassRegistry.def"
2992 OS <<
"Machine module passes (WIP):\n";
2993 static constexpr char MachineModulePassNames[] = {
"\0"
2994#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2995#include "llvm/Passes/MachinePassRegistry.def"
2999 OS <<
"Machine function passes (WIP):\n";
3000 static constexpr char MachineFunctionPassNames[] = {
"\0"
3001#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3002#include "llvm/Passes/MachinePassRegistry.def"
3006 OS <<
"Machine function analyses (WIP):\n";
3007 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3008#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3009#include "llvm/Passes/MachinePassRegistry.def"
3017 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 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 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.
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.
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