432 "Print string describing the pipeline (best-effort only).\n"
433 " - =text\tPrint a '-passes' compatible string describing the "
435 " - =tree\tPrint a tree-like structure describing the pipeline."));
439 std::optional<PrintPipelinePassesFormat> &Val) {
440 std::optional<PrintPipelinePassesFormat>
Format =
449 "'{0}' value invalid for print-pipeline-passes argument!", Arg));
463 for (
char C : Pipeline) {
471 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
501 return MFA ? &MFA->
getMF() :
nullptr;
507class TriggerVerifierErrorPass
513 auto *PtrTy = PointerType::getUnqual(
M.getContext());
515 GlobalValue::LinkageTypes::InternalLinkage,
516 "__bad_alias",
nullptr, &M);
536 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
541class RequireAllMachineFunctionPropertiesPass
549 static MachineFunctionProperties getRequiredProperties() {
550 return MachineFunctionProperties()
552 .setFailsVerification()
557 .setRegBankSelected()
559 .setTiedOpsRewritten()
560 .setTracksDebugUserValues()
561 .setTracksLiveness();
563 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
569 if (S ==
"Os" || S ==
"Oz")
571 Twine(
"The optimization level \"") + S +
572 "\" is no longer supported. Use O2 in conjunction with the " +
573 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
584 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
588 formatv(
"invalid optimization level '{}'", S).str(),
593 std::optional<PGOOptions> PGOOpt,
596 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
598 TM->registerPassBuilderCallbacks(*
this);
600 PIC->registerClassToPassNameCallback([
this, PIC]() {
604#define MODULE_PASS(NAME, CREATE_PASS) \
605 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
606#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
607 PIC->addClassToPassName(CLASS, NAME);
608#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
609 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
610#define FUNCTION_PASS(NAME, CREATE_PASS) \
611 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
612#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
613 PIC->addClassToPassName(CLASS, NAME);
614#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
615 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
616#define LOOPNEST_PASS(NAME, CREATE_PASS) \
617 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
618#define LOOP_PASS(NAME, CREATE_PASS) \
619 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
620#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
621 PIC->addClassToPassName(CLASS, NAME);
622#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
623 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
624#define CGSCC_PASS(NAME, CREATE_PASS) \
625 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
626#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
627 PIC->addClassToPassName(CLASS, NAME);
628#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
629 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
630#include "PassRegistry.def"
632#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
633 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
634#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
635 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
636#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
638 PIC->addClassToPassName(CLASS, NAME);
639#include "llvm/Passes/MachinePassRegistry.def"
647#define MODULE_CALLBACK(NAME, INVOKE) \
648 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
649 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
651 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
654 INVOKE(PM, L.get()); \
657#include "PassRegistry.def"
665#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
666 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
667 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
669 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
672 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
675#include "PassRegistry.def"
683#define FUNCTION_CALLBACK(NAME, INVOKE) \
684 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
685 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
687 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
690 INVOKE(PM, L.get()); \
693#include "PassRegistry.def"
701#define CGSCC_CALLBACK(NAME, INVOKE) \
702 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
703 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
705 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
708 INVOKE(PM, L.get()); \
711#include "PassRegistry.def"
719#define LOOP_CALLBACK(NAME, INVOKE) \
720 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
721 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
723 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
726 INVOKE(PM, L.get()); \
729#include "PassRegistry.def"
735#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
736 MAM.registerPass([&] { return CREATE_PASS; });
737#include "PassRegistry.def"
739 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
744#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
745 CGAM.registerPass([&] { return CREATE_PASS; });
746#include "PassRegistry.def"
748 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
758#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
759 if constexpr (std::is_constructible_v< \
760 std::remove_reference_t<decltype(CREATE_PASS)>, \
761 const TargetMachine &>) { \
763 FAM.registerPass([&] { return CREATE_PASS; }); \
765 FAM.registerPass([&] { return CREATE_PASS; }); \
767#include "PassRegistry.def"
769 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
776#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
777 MFAM.registerPass([&] { return CREATE_PASS; });
778#include "llvm/Passes/MachinePassRegistry.def"
780 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
785#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
786 LAM.registerPass([&] { return CREATE_PASS; });
787#include "PassRegistry.def"
789 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
793static std::optional<std::pair<bool, bool>>
795 std::pair<bool, bool> Params;
796 if (!Name.consume_front(
"function"))
800 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
802 while (!Name.empty()) {
803 auto [Front, Back] = Name.split(
';');
805 if (Front ==
"eager-inv")
807 else if (Front ==
"no-rerun")
808 Params.second =
true;
816 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
828 while (!Params.
empty()) {
830 std::tie(ParamName, Params) = Params.
split(
';');
832 if (ParamName == OptionName) {
849 while (!Params.
empty()) {
851 std::tie(ParamName, Params) = Params.
split(
';');
856 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
861 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
865 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
870 if (ParamName ==
"force-hardware-loops") {
872 }
else if (ParamName ==
"force-hardware-loop-phi") {
874 }
else if (ParamName ==
"force-nested-hardware-loop") {
876 }
else if (ParamName ==
"force-hardware-loop-guard") {
880 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
884 return HardwareLoopOpts;
896 "FunctionPropertiesStatisticsPass");
906 Params,
"assume-default-is-flat-addrspace",
"InferAddressSpacesPass");
912 while (!Params.
empty()) {
914 std::tie(ParamName, Params) = Params.
split(
';');
915 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
917 UnrollOpts.
setOptLevel(
static_cast<int>(*OptLevel));
924 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
931 if (ParamName ==
"partial") {
933 }
else if (ParamName ==
"peeling") {
935 }
else if (ParamName ==
"profile-peeling") {
937 }
else if (ParamName ==
"runtime") {
939 }
else if (ParamName ==
"upperbound") {
941 }
else if (ParamName ==
"prepare-for-lto") {
945 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
954 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
974 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
983 "EntryExitInstrumenter");
988 "DropUnnecessaryAssumes");
993 "LowerMatrixIntrinsics");
998 while (!Params.
empty()) {
1000 std::tie(ParamName, Params) = Params.
split(
';');
1003 if (ParamName ==
"preserve-order")
1005 else if (ParamName ==
"rename-all")
1007 else if (ParamName ==
"fold-all")
1009 else if (ParamName ==
"reorder-operands")
1013 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
1023 while (!Params.
empty()) {
1025 std::tie(ParamName, Params) = Params.
split(
';');
1027 if (ParamName ==
"kernel") {
1028 Result.CompileKernel =
true;
1029 }
else if (ParamName ==
"use-after-scope") {
1030 Result.UseAfterScope =
true;
1033 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1043 while (!Params.
empty()) {
1045 std::tie(ParamName, Params) = Params.
split(
';');
1047 if (ParamName ==
"recover") {
1049 }
else if (ParamName ==
"kernel") {
1050 Result.CompileKernel =
true;
1053 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1062parseDropTypeTestsPassOptions(
StringRef Params) {
1064 while (!Params.
empty()) {
1066 std::tie(ParamName, Params) = Params.
split(
';');
1068 if (ParamName ==
"all") {
1070 }
else if (ParamName ==
"assume") {
1074 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1083 while (!Params.
empty()) {
1085 std::tie(ParamName, Params) = Params.
split(
';');
1087 if (ParamName ==
"thinlto") {
1089 }
else if (ParamName ==
"emit-summary") {
1090 Result.EmitLTOSummary =
true;
1093 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1101parseLowerAllowCheckPassOptions(
StringRef Params) {
1103 while (!Params.
empty()) {
1105 std::tie(ParamName, Params) = Params.
split(
';');
1116 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1123 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1128 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1130 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1131 IndicesStr, CutoffStr)
1135 while (IndicesStr !=
"") {
1137 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1143 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1144 firstIndexStr, IndicesStr)
1151 if (index >=
Result.cutoffs.size())
1152 Result.cutoffs.resize(index + 1, 0);
1154 Result.cutoffs[index] = cutoff;
1156 }
else if (ParamName.
starts_with(
"runtime_check")) {
1158 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1162 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1164 ValueString, Params)
1168 Result.runtime_check = runtime_check;
1171 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1182 while (!Params.
empty()) {
1184 std::tie(ParamName, Params) = Params.
split(
';');
1186 if (ParamName ==
"recover") {
1188 }
else if (ParamName ==
"kernel") {
1193 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1198 }
else if (ParamName ==
"eager-checks") {
1199 Result.EagerChecks =
true;
1202 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1212 while (!Params.
empty()) {
1214 std::tie(ParamName, Params) = Params.
split(
';');
1221 formatv(
"invalid argument to AllocToken pass mode "
1228 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1238 while (!Params.
empty()) {
1240 std::tie(ParamName, Params) = Params.
split(
';');
1243 if (ParamName ==
"speculate-blocks") {
1245 }
else if (ParamName ==
"simplify-cond-branch") {
1247 }
else if (ParamName ==
"forward-switch-cond") {
1249 }
else if (ParamName ==
"switch-range-to-icmp") {
1251 }
else if (ParamName ==
"switch-to-arithmetic") {
1253 }
else if (ParamName ==
"switch-to-lookup") {
1255 }
else if (ParamName ==
"keep-loops") {
1257 }
else if (ParamName ==
"hoist-common-insts") {
1259 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1261 }
else if (ParamName ==
"sink-common-insts") {
1263 }
else if (ParamName ==
"speculate-unpredictables") {
1266 APInt BonusInstThreshold;
1269 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1277 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1288 Result.setVerifyFixpoint(
true);
1289 while (!Params.
empty()) {
1291 std::tie(ParamName, Params) = Params.
split(
';');
1294 if (ParamName ==
"verify-fixpoint") {
1297 APInt MaxIterations;
1300 formatv(
"invalid argument to InstCombine pass max-iterations "
1308 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1318 while (!Params.
empty()) {
1320 std::tie(ParamName, Params) = Params.
split(
';');
1323 if (ParamName ==
"interleave-forced-only") {
1325 }
else if (ParamName ==
"vectorize-forced-only") {
1329 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1337 std::pair<bool, bool>
Result = {
false,
true};
1338 while (!Params.
empty()) {
1340 std::tie(ParamName, Params) = Params.
split(
';');
1343 if (ParamName ==
"nontrivial") {
1345 }
else if (ParamName ==
"trivial") {
1349 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1358 while (!Params.
empty()) {
1360 std::tie(ParamName, Params) = Params.
split(
';');
1363 if (ParamName ==
"allowspeculation") {
1367 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1374struct LoopRotateOptions {
1375 bool EnableHeaderDuplication =
true;
1376 bool PrepareForLTO =
false;
1377 bool CheckExitCount =
false;
1381 LoopRotateOptions
Result;
1382 while (!Params.
empty()) {
1384 std::tie(ParamName, Params) = Params.
split(
';');
1387 if (ParamName ==
"header-duplication") {
1389 }
else if (ParamName ==
"prepare-for-lto") {
1391 }
else if (ParamName ==
"check-exit-count") {
1395 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1404 while (!Params.
empty()) {
1406 std::tie(ParamName, Params) = Params.
split(
';');
1409 if (ParamName ==
"split-footer-bb") {
1413 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1424 while (!Params.
empty()) {
1426 std::tie(ParamName, Params) = Params.
split(
';');
1429 if (ParamName ==
"scalar-pre") {
1431 }
else if (ParamName ==
"load-pre") {
1433 }
else if (ParamName ==
"split-backedge-load-pre") {
1435 }
else if (ParamName ==
"memdep") {
1439 }
else if (ParamName ==
"memoryssa") {
1445 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1454 while (!Params.
empty()) {
1456 std::tie(ParamName, Params) = Params.
split(
';');
1459 if (ParamName ==
"func-spec")
1463 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1471 while (!Params.
empty()) {
1473 std::tie(ParamName, Params) = Params.
split(
';');
1478 formatv(
"invalid argument to Scalarizer pass min-bits "
1489 if (ParamName ==
"load-store")
1491 else if (ParamName ==
"variable-insert-extract")
1495 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1505 bool SawCFGOption =
false;
1506 while (!Params.
empty()) {
1508 std::tie(ParamName, Params) = Params.
split(
';');
1510 if (ParamName ==
"modify-cfg") {
1515 SawCFGOption =
true;
1516 }
else if (ParamName ==
"preserve-cfg") {
1521 SawCFGOption =
true;
1522 }
else if (ParamName ==
"aggregate-to-vector") {
1523 Result.AggregateToVector =
true;
1526 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1527 "modify-cfg, or aggregate-to-vector)",
1537parseStackLifetimeOptions(
StringRef Params) {
1539 while (!Params.
empty()) {
1541 std::tie(ParamName, Params) = Params.
split(
';');
1543 if (ParamName ==
"may") {
1545 }
else if (ParamName ==
"must") {
1549 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1558 "DependenceAnalysisPrinter");
1563 "SeparateConstOffsetFromGEP");
1572parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1576 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1584 "MemorySSAPrinterPass");
1589 "SpeculativeExecutionPass");
1594 while (!Params.
empty()) {
1596 std::tie(ParamName, Params) = Params.
split(
';');
1602 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1610parseStructuralHashPrinterPassOptions(
StringRef Params) {
1613 if (Params ==
"detailed")
1615 if (Params ==
"call-target-ignored")
1618 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1624 while (!Params.
empty()) {
1626 std::tie(ParamName, Params) = Params.
split(
';');
1629 if (ParamName ==
"group-by-use")
1631 else if (ParamName ==
"ignore-single-use")
1633 else if (ParamName ==
"merge-const")
1635 else if (ParamName ==
"merge-const-aggressive")
1637 else if (ParamName ==
"merge-external")
1642 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1646 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1655 while (!Params.
empty()) {
1657 std::tie(ParamName, Params) = Params.
split(
';');
1663 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1674 while (!Params.
empty()) {
1676 std::tie(ParamName, Params) = Params.
split(
';');
1679 std::optional<RegAllocFilterFunc>
Filter =
1683 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1692 if (ParamName ==
"no-clear-vregs") {
1698 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1705parseBoundsCheckingOptions(
StringRef Params) {
1707 while (!Params.
empty()) {
1709 std::tie(ParamName, Params) = Params.
split(
';');
1710 if (ParamName ==
"trap") {
1712 }
else if (ParamName ==
"rt") {
1718 }
else if (ParamName ==
"rt-abort") {
1724 }
else if (ParamName ==
"min-rt") {
1730 }
else if (ParamName ==
"min-rt-abort") {
1736 }
else if (ParamName ==
"merge") {
1738 }
else if (ParamName ==
"handler-preserve-all-regs") {
1740 Options.Rt->HandlerPreserveAllRegs =
true;
1744 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1750 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1767 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1769 Param.str().c_str());
1772 if (!
Level.has_value())
1774 "invalid optimization level for expand-ir-insts pass: %s",
1775 Digit.str().c_str());
1782 if (Params.
empty() || Params ==
"all")
1783 return RAGreedyPass::Options();
1787 return RAGreedyPass::Options{*
Filter, Params};
1790 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1796 "MachineSinkingPass");
1800 bool AllowTailMerge =
true;
1801 if (!Params.
empty()) {
1803 if (Params !=
"tail-merge")
1805 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1809 return AllowTailMerge;
1813 bool ClearVirtRegs =
true;
1814 if (!Params.
empty()) {
1816 if (Params !=
"clear-vregs")
1818 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1821 return ClearVirtRegs;
1824struct FatLTOOptions {
1826 bool ThinLTO =
false;
1827 bool EmitSummary =
false;
1832 bool HaveOptLevel =
false;
1833 while (!Params.
empty()) {
1835 std::tie(ParamName, Params) = Params.
split(
';');
1837 if (ParamName ==
"thinlto") {
1839 }
else if (ParamName ==
"emit-summary") {
1840 Result.EmitSummary =
true;
1841 }
else if (std::optional<OptimizationLevel> OptLevel =
1843 Result.OptLevel = *OptLevel;
1844 HaveOptLevel =
true;
1847 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1854 "missing optimization level for fatlto-pre-link pipeline",
1869template <
typename PassManagerT,
typename CallbacksT>
1871 if (!Callbacks.empty()) {
1872 PassManagerT DummyPM;
1873 for (
auto &CB : Callbacks)
1874 if (CB(Name, DummyPM, {}))
1880template <
typename CallbacksT>
1882 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1885 if (Name ==
"module")
1887 if (Name ==
"cgscc")
1889 if (NameNoBracket ==
"function")
1891 if (Name ==
"coro-cond")
1894#define MODULE_PASS(NAME, CREATE_PASS) \
1897#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1898 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1900#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1901 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1903#include "PassRegistry.def"
1908template <
typename CallbacksT>
1911 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1912 if (Name ==
"cgscc")
1914 if (NameNoBracket ==
"function")
1921#define CGSCC_PASS(NAME, CREATE_PASS) \
1924#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1925 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1927#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1928 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1930#include "PassRegistry.def"
1935template <
typename CallbacksT>
1938 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1939 if (NameNoBracket ==
"function")
1941 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1944#define FUNCTION_PASS(NAME, CREATE_PASS) \
1947#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1948 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1950#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1951 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1953#include "PassRegistry.def"
1958template <
typename CallbacksT>
1961 if (Name ==
"machine-function")
1964#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1967#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1969 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1972#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1973 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1976#include "llvm/Passes/MachinePassRegistry.def"
1981template <
typename CallbacksT>
1983 bool &UseMemorySSA) {
1984 UseMemorySSA =
false;
1987 UseMemorySSA =
true;
1991#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1994#include "PassRegistry.def"
1999template <
typename CallbacksT>
2001 bool &UseMemorySSA) {
2002 UseMemorySSA =
false;
2005 UseMemorySSA =
true;
2009#define LOOP_PASS(NAME, CREATE_PASS) \
2012#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2013 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
2015#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2016 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
2018#include "PassRegistry.def"
2023std::optional<std::vector<PassBuilder::PipelineElement>>
2025 std::vector<PipelineElement> ResultPipeline;
2030 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2031 size_t Pos =
Text.find_first_of(
",()");
2032 Pipeline.push_back({
Text.substr(0, Pos), {}});
2035 if (Pos ==
Text.npos)
2038 char Sep =
Text[Pos];
2046 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2050 assert(Sep ==
')' &&
"Bogus separator!");
2055 if (PipelineStack.
size() == 1)
2056 return std::nullopt;
2059 }
while (
Text.consume_front(
")"));
2067 if (!
Text.consume_front(
","))
2068 return std::nullopt;
2071 if (PipelineStack.
size() > 1)
2073 return std::nullopt;
2075 assert(PipelineStack.
back() == &ResultPipeline &&
2076 "Wrong pipeline at the bottom of the stack!");
2077 return {std::move(ResultPipeline)};
2087 const PipelineElement &
E) {
2088 auto &
Name =
E.Name;
2089 auto &InnerPipeline =
E.InnerPipeline;
2092 if (!InnerPipeline.empty()) {
2093 if (Name ==
"module") {
2095 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2097 MPM.
addPass(std::move(NestedMPM));
2100 if (Name ==
"coro-cond") {
2102 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2104 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2107 if (Name ==
"cgscc") {
2109 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2117 "cannot have a no-rerun module to function adaptor",
2120 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2127 for (
auto &
C : ModulePipelineParsingCallbacks)
2128 if (
C(Name, MPM, InnerPipeline))
2133 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2139#define MODULE_PASS(NAME, CREATE_PASS) \
2140 if (Name == NAME) { \
2141 MPM.addPass(CREATE_PASS); \
2142 return Error::success(); \
2144#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2145 if (checkParametrizedPassName(Name, NAME)) { \
2146 auto Params = parsePassParameters(PARSER, Name, NAME); \
2148 return Params.takeError(); \
2149 MPM.addPass(CREATE_PASS(Params.get())); \
2150 return Error::success(); \
2152#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2153 if (Name == "require<" NAME ">") { \
2155 RequireAnalysisPass< \
2156 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2157 return Error::success(); \
2159 if (Name == "invalidate<" NAME ">") { \
2160 MPM.addPass(InvalidateAnalysisPass< \
2161 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2162 return Error::success(); \
2164#define CGSCC_PASS(NAME, CREATE_PASS) \
2165 if (Name == NAME) { \
2166 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2167 return Error::success(); \
2169#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2170 if (checkParametrizedPassName(Name, NAME)) { \
2171 auto Params = parsePassParameters(PARSER, Name, NAME); \
2173 return Params.takeError(); \
2175 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2176 return Error::success(); \
2178#define FUNCTION_PASS(NAME, CREATE_PASS) \
2179 if (Name == NAME) { \
2180 if constexpr (std::is_constructible_v< \
2181 std::remove_reference_t<decltype(CREATE_PASS)>, \
2182 const TargetMachine &>) { \
2184 return make_error<StringError>( \
2185 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2186 inconvertibleErrorCode()); \
2188 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2189 return Error::success(); \
2191#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2192 if (checkParametrizedPassName(Name, NAME)) { \
2193 auto Params = parsePassParameters(PARSER, Name, NAME); \
2195 return Params.takeError(); \
2196 auto CreatePass = CREATE_PASS; \
2197 if constexpr (std::is_constructible_v< \
2198 std::remove_reference_t<decltype(CreatePass( \
2200 const TargetMachine &, \
2201 std::remove_reference_t<decltype(Params.get())>>) { \
2203 return make_error<StringError>( \
2204 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2205 inconvertibleErrorCode()); \
2208 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2209 return Error::success(); \
2211#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2212 if (Name == NAME) { \
2213 MPM.addPass(createModuleToFunctionPassAdaptor( \
2214 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2215 return Error::success(); \
2217#define LOOP_PASS(NAME, CREATE_PASS) \
2218 if (Name == NAME) { \
2219 MPM.addPass(createModuleToFunctionPassAdaptor( \
2220 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2221 return Error::success(); \
2223#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2224 if (checkParametrizedPassName(Name, NAME)) { \
2225 auto Params = parsePassParameters(PARSER, Name, NAME); \
2227 return Params.takeError(); \
2228 MPM.addPass(createModuleToFunctionPassAdaptor( \
2229 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2230 return Error::success(); \
2232#include "PassRegistry.def"
2234 for (
auto &
C : ModulePipelineParsingCallbacks)
2235 if (
C(Name, MPM, InnerPipeline))
2238 formatv(
"unknown module pass '{}'", Name).str(),
2243 const PipelineElement &
E) {
2244 auto &
Name =
E.Name;
2245 auto &InnerPipeline =
E.InnerPipeline;
2248 if (!InnerPipeline.empty()) {
2249 if (Name ==
"cgscc") {
2251 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2254 CGPM.
addPass(std::move(NestedCGPM));
2259 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2263 std::move(FPM), Params->first, Params->second));
2268 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2275 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2276 if (
C(Name, CGPM, InnerPipeline))
2281 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2286#define CGSCC_PASS(NAME, CREATE_PASS) \
2287 if (Name == NAME) { \
2288 CGPM.addPass(CREATE_PASS); \
2289 return Error::success(); \
2291#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2292 if (checkParametrizedPassName(Name, NAME)) { \
2293 auto Params = parsePassParameters(PARSER, Name, NAME); \
2295 return Params.takeError(); \
2296 CGPM.addPass(CREATE_PASS(Params.get())); \
2297 return Error::success(); \
2299#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2300 if (Name == "require<" NAME ">") { \
2301 CGPM.addPass(RequireAnalysisPass< \
2302 std::remove_reference_t<decltype(CREATE_PASS)>, \
2303 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2304 CGSCCUpdateResult &>()); \
2305 return Error::success(); \
2307 if (Name == "invalidate<" NAME ">") { \
2308 CGPM.addPass(InvalidateAnalysisPass< \
2309 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2310 return Error::success(); \
2312#define FUNCTION_PASS(NAME, CREATE_PASS) \
2313 if (Name == NAME) { \
2314 if constexpr (std::is_constructible_v< \
2315 std::remove_reference_t<decltype(CREATE_PASS)>, \
2316 const TargetMachine &>) { \
2318 return make_error<StringError>( \
2319 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2320 inconvertibleErrorCode()); \
2322 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2323 return Error::success(); \
2325#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2326 if (checkParametrizedPassName(Name, NAME)) { \
2327 auto Params = parsePassParameters(PARSER, Name, NAME); \
2329 return Params.takeError(); \
2330 auto CreatePass = CREATE_PASS; \
2331 if constexpr (std::is_constructible_v< \
2332 std::remove_reference_t<decltype(CreatePass( \
2334 const TargetMachine &, \
2335 std::remove_reference_t<decltype(Params.get())>>) { \
2337 return make_error<StringError>( \
2338 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2339 inconvertibleErrorCode()); \
2342 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2343 return Error::success(); \
2345#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2346 if (Name == NAME) { \
2347 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2348 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2349 return Error::success(); \
2351#define LOOP_PASS(NAME, CREATE_PASS) \
2352 if (Name == NAME) { \
2353 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2354 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2355 return Error::success(); \
2357#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2358 if (checkParametrizedPassName(Name, NAME)) { \
2359 auto Params = parsePassParameters(PARSER, Name, NAME); \
2361 return Params.takeError(); \
2362 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2363 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2364 return Error::success(); \
2366#include "PassRegistry.def"
2368 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2369 if (
C(Name, CGPM, InnerPipeline))
2376 const PipelineElement &
E) {
2377 auto &
Name =
E.Name;
2378 auto &InnerPipeline =
E.InnerPipeline;
2381 if (!InnerPipeline.empty()) {
2382 if (Name ==
"function") {
2384 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2387 FPM.
addPass(std::move(NestedFPM));
2390 if (Name ==
"loop" || Name ==
"loop-mssa") {
2392 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2395 bool UseMemorySSA = (
Name ==
"loop-mssa");
2400 if (Name ==
"machine-function") {
2402 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2408 for (
auto &
C : FunctionPipelineParsingCallbacks)
2409 if (
C(Name, FPM, InnerPipeline))
2414 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2419#define FUNCTION_PASS(NAME, CREATE_PASS) \
2420 if (Name == NAME) { \
2421 if constexpr (std::is_constructible_v< \
2422 std::remove_reference_t<decltype(CREATE_PASS)>, \
2423 const TargetMachine &>) { \
2425 return make_error<StringError>( \
2426 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2427 inconvertibleErrorCode()); \
2429 FPM.addPass(CREATE_PASS); \
2430 return Error::success(); \
2432#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2433 if (checkParametrizedPassName(Name, NAME)) { \
2434 auto Params = parsePassParameters(PARSER, Name, NAME); \
2436 return Params.takeError(); \
2437 auto CreatePass = CREATE_PASS; \
2438 if constexpr (std::is_constructible_v< \
2439 std::remove_reference_t<decltype(CreatePass( \
2441 const TargetMachine &, \
2442 std::remove_reference_t<decltype(Params.get())>>) { \
2444 return make_error<StringError>( \
2445 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2446 inconvertibleErrorCode()); \
2449 FPM.addPass(CREATE_PASS(Params.get())); \
2450 return Error::success(); \
2452#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2453 if (Name == "require<" NAME ">") { \
2454 if constexpr (std::is_constructible_v< \
2455 std::remove_reference_t<decltype(CREATE_PASS)>, \
2456 const TargetMachine &>) { \
2458 return make_error<StringError>( \
2459 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2460 inconvertibleErrorCode()); \
2463 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2465 return Error::success(); \
2467 if (Name == "invalidate<" NAME ">") { \
2468 FPM.addPass(InvalidateAnalysisPass< \
2469 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2470 return Error::success(); \
2476#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2477 if (Name == NAME) { \
2478 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2479 return Error::success(); \
2481#define LOOP_PASS(NAME, CREATE_PASS) \
2482 if (Name == NAME) { \
2483 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2484 return Error::success(); \
2486#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2487 if (checkParametrizedPassName(Name, NAME)) { \
2488 auto Params = parsePassParameters(PARSER, Name, NAME); \
2490 return Params.takeError(); \
2492 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2493 return Error::success(); \
2495#include "PassRegistry.def"
2497 for (
auto &
C : FunctionPipelineParsingCallbacks)
2498 if (
C(Name, FPM, InnerPipeline))
2501 formatv(
"unknown function pass '{}'", Name).str(),
2506 const PipelineElement &
E) {
2507 StringRef
Name =
E.Name;
2508 auto &InnerPipeline =
E.InnerPipeline;
2511 if (!InnerPipeline.empty()) {
2512 if (Name ==
"loop") {
2514 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2517 LPM.addPass(std::move(NestedLPM));
2521 for (
auto &
C : LoopPipelineParsingCallbacks)
2522 if (
C(Name, LPM, InnerPipeline))
2527 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2532#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2533 if (Name == NAME) { \
2534 LPM.addPass(CREATE_PASS); \
2535 return Error::success(); \
2537#define LOOP_PASS(NAME, CREATE_PASS) \
2538 if (Name == NAME) { \
2539 LPM.addPass(CREATE_PASS); \
2540 return Error::success(); \
2542#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2543 if (checkParametrizedPassName(Name, NAME)) { \
2544 auto Params = parsePassParameters(PARSER, Name, NAME); \
2546 return Params.takeError(); \
2547 LPM.addPass(CREATE_PASS(Params.get())); \
2548 return Error::success(); \
2550#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2551 if (Name == "require<" NAME ">") { \
2552 LPM.addPass(RequireAnalysisPass< \
2553 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2554 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2556 return Error::success(); \
2558 if (Name == "invalidate<" NAME ">") { \
2559 LPM.addPass(InvalidateAnalysisPass< \
2560 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2561 return Error::success(); \
2563#include "PassRegistry.def"
2565 for (
auto &
C : LoopPipelineParsingCallbacks)
2566 if (
C(Name, LPM, InnerPipeline))
2573 const PipelineElement &
E) {
2574 StringRef
Name =
E.Name;
2576 if (!
E.InnerPipeline.empty()) {
2577 if (
E.Name ==
"machine-function") {
2579 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2581 MFPM.
addPass(std::move(NestedPM));
2588#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2589 if (Name == NAME) { \
2590 MFPM.addPass(CREATE_PASS); \
2591 return Error::success(); \
2593#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2594 if (Name == NAME) { \
2595 MFPM.addPass(CREATE_PASS); \
2596 return Error::success(); \
2598#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2600 if (checkParametrizedPassName(Name, NAME)) { \
2601 auto Params = parsePassParameters(PARSER, Name, NAME); \
2603 return Params.takeError(); \
2604 MFPM.addPass(CREATE_PASS(Params.get())); \
2605 return Error::success(); \
2607#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2608 if (Name == "require<" NAME ">") { \
2610 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2611 MachineFunction>()); \
2612 return Error::success(); \
2614 if (Name == "invalidate<" NAME ">") { \
2615 MFPM.addPass(InvalidateAnalysisPass< \
2616 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2617 return Error::success(); \
2619#include "llvm/Passes/MachinePassRegistry.def"
2621 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2622 if (
C(Name, MFPM,
E.InnerPipeline))
2625 formatv(
"unknown machine pass '{}'", Name).str(),
2630#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2631 if (Name == NAME) { \
2632 AA.registerModuleAnalysis< \
2633 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2636#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2637 if (Name == NAME) { \
2638 AA.registerFunctionAnalysis< \
2639 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2642#include "PassRegistry.def"
2644 for (
auto &
C : AAParsingCallbacks)
2650Error PassBuilder::parseMachinePassPipeline(
2652 for (
const auto &Element : Pipeline) {
2653 if (
auto Err = parseMachinePass(MFPM, Element))
2661 for (
const auto &Element : Pipeline) {
2662 if (
auto Err = parseLoopPass(LPM, Element))
2668Error PassBuilder::parseFunctionPassPipeline(
2670 for (
const auto &Element : Pipeline) {
2671 if (
auto Err = parseFunctionPass(FPM, Element))
2679 for (
const auto &Element : Pipeline) {
2680 if (
auto Err = parseCGSCCPass(CGPM, Element))
2712 for (
const auto &Element : Pipeline) {
2713 if (
auto Err = parseModulePass(MPM, Element))
2724 auto Pipeline = parsePipelineText(PipelineText);
2725 if (!Pipeline || Pipeline->empty())
2727 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2737 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2739 FunctionPipelineParsingCallbacks)) {
2740 Pipeline = {{
"function", std::move(*Pipeline)}};
2743 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2744 std::move(*Pipeline)}}}};
2745 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2747 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2748 std::move(*Pipeline)}}}};
2750 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2751 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2753 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2754 if (
C(MPM, *Pipeline))
2758 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2760 formatv(
"unknown {} name '{}'",
2761 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2767 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2775 auto Pipeline = parsePipelineText(PipelineText);
2776 if (!Pipeline || Pipeline->empty())
2778 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2784 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2789 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2798 auto Pipeline = parsePipelineText(PipelineText);
2799 if (!Pipeline || Pipeline->empty())
2801 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2807 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2812 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2820 auto Pipeline = parsePipelineText(PipelineText);
2821 if (!Pipeline || Pipeline->empty())
2823 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2826 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2834 auto Pipeline = parsePipelineText(PipelineText);
2835 if (!Pipeline || Pipeline->empty())
2837 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2840 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2849 if (PipelineText ==
"default") {
2854 while (!PipelineText.
empty()) {
2856 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2857 if (!parseAAPassName(
AA, Name))
2859 formatv(
"unknown alias analysis name '{}'", Name).str(),
2866std::optional<RegAllocFilterFunc>
2868 if (FilterName ==
"all")
2870 for (
auto &
C : RegClassFilterParsingCallbacks)
2871 if (
auto F =
C(FilterName))
2873 return std::nullopt;
2884 auto I = PassNames.
begin();
2885 auto End = PassNames.
end();
2892 OS <<
" " << Name <<
'<' << Params <<
">\n";
2899 OS <<
"Module passes:\n";
2900 static constexpr char ModulePassNames[] = {
"\0"
2901#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2902#include "PassRegistry.def"
2906 OS <<
"Module passes with params:\n";
2907 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2908#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2909 NAME "\0" PARAMS "\0"
2910#include "PassRegistry.def"
2914 OS <<
"Module analyses:\n";
2915 static constexpr char ModuleAnalysisNames[] = {
"\0"
2916#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2917#include "PassRegistry.def"
2921 OS <<
"Module alias analyses:\n";
2922 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2923#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2924#include "PassRegistry.def"
2928 OS <<
"CGSCC passes:\n";
2929 static constexpr char CGSCCPassNames[] = {
"\0"
2930#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2931#include "PassRegistry.def"
2935 OS <<
"CGSCC passes with params:\n";
2936 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2937#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2938 NAME "\0" PARAMS "\0"
2939#include "PassRegistry.def"
2943 OS <<
"CGSCC analyses:\n";
2944 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2945#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2946#include "PassRegistry.def"
2950 OS <<
"Function passes:\n";
2951 static constexpr char FunctionPassNames[] = {
"\0"
2952#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2953#include "PassRegistry.def"
2957 OS <<
"Function passes with params:\n";
2958 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2959#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2960 NAME "\0" PARAMS "\0"
2961#include "PassRegistry.def"
2965 OS <<
"Function analyses:\n";
2966 static constexpr char FunctionAnalysisNames[] = {
"\0"
2967#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2968#include "PassRegistry.def"
2972 OS <<
"Function alias analyses:\n";
2973 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2974#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2975#include "PassRegistry.def"
2979 OS <<
"LoopNest passes:\n";
2980 static constexpr char LoopNestPassNames[] = {
"\0"
2981#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2982#include "PassRegistry.def"
2986 OS <<
"Loop passes:\n";
2987 static constexpr char LoopPassNames[] = {
"\0"
2988#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2989#include "PassRegistry.def"
2993 OS <<
"Loop passes with params:\n";
2994 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2995#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2996 NAME "\0" PARAMS "\0"
2997#include "PassRegistry.def"
3001 OS <<
"Loop analyses:\n";
3002 static constexpr char LoopAnalysisNames[] = {
"\0"
3003#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3004#include "PassRegistry.def"
3008 OS <<
"Machine module passes (WIP):\n";
3009 static constexpr char MachineModulePassNames[] = {
"\0"
3010#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
3011#include "llvm/Passes/MachinePassRegistry.def"
3015 OS <<
"Machine function passes (WIP):\n";
3016 static constexpr char MachineFunctionPassNames[] = {
"\0"
3017#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3018#include "llvm/Passes/MachinePassRegistry.def"
3022 OS <<
"Machine function analyses (WIP):\n";
3023 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3024#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3025#include "llvm/Passes/MachinePassRegistry.def"
3033 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 the GVNHoist pass.
This file provides the interface for the GVNSink pass.
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 contains the declaration of the ResetMachineFunctionPass class.
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