429 "Print string describing the pipeline (best-effort only).\n"
430 " - =text\tPrint a '-passes' compatible string describing the "
432 " - =tree\tPrint a tree-like structure describing the pipeline."));
436 std::optional<PrintPipelinePassesFormat> &Val) {
437 std::optional<PrintPipelinePassesFormat>
Format =
446 "'{0}' value invalid for print-pipeline-passes argument!", Arg));
460 for (
char C : Pipeline) {
468 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
498 return MFA ? &MFA->
getMF() :
nullptr;
504class TriggerVerifierErrorPass
510 auto *PtrTy = PointerType::getUnqual(
M.getContext());
512 GlobalValue::LinkageTypes::InternalLinkage,
513 "__bad_alias",
nullptr, &M);
533 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
538class RequireAllMachineFunctionPropertiesPass
546 static MachineFunctionProperties getRequiredProperties() {
547 return MachineFunctionProperties()
549 .setFailsVerification()
554 .setRegBankSelected()
556 .setTiedOpsRewritten()
557 .setTracksDebugUserValues()
558 .setTracksLiveness();
560 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
566 if (S ==
"Os" || S ==
"Oz")
568 Twine(
"The optimization level \"") + S +
569 "\" is no longer supported. Use O2 in conjunction with the " +
570 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
581 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
585 formatv(
"invalid optimization level '{}'", S).str(),
590 std::optional<PGOOptions> PGOOpt,
593 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
595 TM->registerPassBuilderCallbacks(*
this);
597 PIC->registerClassToPassNameCallback([
this, PIC]() {
601#define MODULE_PASS(NAME, CREATE_PASS) \
602 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
603#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
604 PIC->addClassToPassName(CLASS, NAME);
605#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
606 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
607#define FUNCTION_PASS(NAME, CREATE_PASS) \
608 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
609#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
610 PIC->addClassToPassName(CLASS, NAME);
611#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
612 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
613#define LOOPNEST_PASS(NAME, CREATE_PASS) \
614 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
615#define LOOP_PASS(NAME, CREATE_PASS) \
616 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
617#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
618 PIC->addClassToPassName(CLASS, NAME);
619#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
620 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
621#define CGSCC_PASS(NAME, CREATE_PASS) \
622 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
623#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
624 PIC->addClassToPassName(CLASS, NAME);
625#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
626 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
627#include "PassRegistry.def"
629#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
630 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
631#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
632 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
633#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
635 PIC->addClassToPassName(CLASS, NAME);
636#include "llvm/Passes/MachinePassRegistry.def"
644#define MODULE_CALLBACK(NAME, INVOKE) \
645 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
646 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
648 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
651 INVOKE(PM, L.get()); \
654#include "PassRegistry.def"
662#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
663 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
664 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
666 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
669 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
672#include "PassRegistry.def"
680#define FUNCTION_CALLBACK(NAME, INVOKE) \
681 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
682 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
684 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
687 INVOKE(PM, L.get()); \
690#include "PassRegistry.def"
698#define CGSCC_CALLBACK(NAME, INVOKE) \
699 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
700 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
702 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
705 INVOKE(PM, L.get()); \
708#include "PassRegistry.def"
716#define LOOP_CALLBACK(NAME, INVOKE) \
717 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
718 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
720 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
723 INVOKE(PM, L.get()); \
726#include "PassRegistry.def"
732#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
733 MAM.registerPass([&] { return CREATE_PASS; });
734#include "PassRegistry.def"
736 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
741#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
742 CGAM.registerPass([&] { return CREATE_PASS; });
743#include "PassRegistry.def"
745 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
755#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
756 if constexpr (std::is_constructible_v< \
757 std::remove_reference_t<decltype(CREATE_PASS)>, \
758 const TargetMachine &>) { \
760 FAM.registerPass([&] { return CREATE_PASS; }); \
762 FAM.registerPass([&] { return CREATE_PASS; }); \
764#include "PassRegistry.def"
766 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
773#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
774 MFAM.registerPass([&] { return CREATE_PASS; });
775#include "llvm/Passes/MachinePassRegistry.def"
777 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
782#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
783 LAM.registerPass([&] { return CREATE_PASS; });
784#include "PassRegistry.def"
786 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
790static std::optional<std::pair<bool, bool>>
792 std::pair<bool, bool> Params;
793 if (!Name.consume_front(
"function"))
797 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
799 while (!Name.empty()) {
800 auto [Front, Back] = Name.split(
';');
802 if (Front ==
"eager-inv")
804 else if (Front ==
"no-rerun")
805 Params.second =
true;
813 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
825 while (!Params.
empty()) {
827 std::tie(ParamName, Params) = Params.
split(
';');
829 if (ParamName == OptionName) {
846 while (!Params.
empty()) {
848 std::tie(ParamName, Params) = Params.
split(
';');
853 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
858 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
862 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
867 if (ParamName ==
"force-hardware-loops") {
869 }
else if (ParamName ==
"force-hardware-loop-phi") {
871 }
else if (ParamName ==
"force-nested-hardware-loop") {
873 }
else if (ParamName ==
"force-hardware-loop-guard") {
877 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
881 return HardwareLoopOpts;
893 "FunctionPropertiesStatisticsPass");
903 Params,
"assume-default-is-flat-addrspace",
"InferAddressSpacesPass");
909 while (!Params.
empty()) {
911 std::tie(ParamName, Params) = Params.
split(
';');
912 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
914 UnrollOpts.
setOptLevel(
static_cast<int>(*OptLevel));
921 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
928 if (ParamName ==
"partial") {
930 }
else if (ParamName ==
"peeling") {
932 }
else if (ParamName ==
"profile-peeling") {
934 }
else if (ParamName ==
"runtime") {
936 }
else if (ParamName ==
"upperbound") {
938 }
else if (ParamName ==
"prepare-for-lto") {
942 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
951 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
971 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
980 "EntryExitInstrumenter");
985 "DropUnnecessaryAssumes");
990 "LowerMatrixIntrinsics");
995 while (!Params.
empty()) {
997 std::tie(ParamName, Params) = Params.
split(
';');
1000 if (ParamName ==
"preserve-order")
1002 else if (ParamName ==
"rename-all")
1004 else if (ParamName ==
"fold-all")
1006 else if (ParamName ==
"reorder-operands")
1010 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
1020 while (!Params.
empty()) {
1022 std::tie(ParamName, Params) = Params.
split(
';');
1024 if (ParamName ==
"kernel") {
1025 Result.CompileKernel =
true;
1026 }
else if (ParamName ==
"use-after-scope") {
1027 Result.UseAfterScope =
true;
1030 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1040 while (!Params.
empty()) {
1042 std::tie(ParamName, Params) = Params.
split(
';');
1044 if (ParamName ==
"recover") {
1046 }
else if (ParamName ==
"kernel") {
1047 Result.CompileKernel =
true;
1050 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1059parseDropTypeTestsPassOptions(
StringRef Params) {
1061 while (!Params.
empty()) {
1063 std::tie(ParamName, Params) = Params.
split(
';');
1065 if (ParamName ==
"all") {
1067 }
else if (ParamName ==
"assume") {
1071 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1080 while (!Params.
empty()) {
1082 std::tie(ParamName, Params) = Params.
split(
';');
1084 if (ParamName ==
"thinlto") {
1086 }
else if (ParamName ==
"emit-summary") {
1087 Result.EmitLTOSummary =
true;
1090 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1098parseLowerAllowCheckPassOptions(
StringRef Params) {
1100 while (!Params.
empty()) {
1102 std::tie(ParamName, Params) = Params.
split(
';');
1113 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1120 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1125 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1127 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1128 IndicesStr, CutoffStr)
1132 while (IndicesStr !=
"") {
1134 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1140 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1141 firstIndexStr, IndicesStr)
1148 if (index >=
Result.cutoffs.size())
1149 Result.cutoffs.resize(index + 1, 0);
1151 Result.cutoffs[index] = cutoff;
1153 }
else if (ParamName.
starts_with(
"runtime_check")) {
1155 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1159 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1161 ValueString, Params)
1165 Result.runtime_check = runtime_check;
1168 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1179 while (!Params.
empty()) {
1181 std::tie(ParamName, Params) = Params.
split(
';');
1183 if (ParamName ==
"recover") {
1185 }
else if (ParamName ==
"kernel") {
1190 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1195 }
else if (ParamName ==
"eager-checks") {
1196 Result.EagerChecks =
true;
1199 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1209 while (!Params.
empty()) {
1211 std::tie(ParamName, Params) = Params.
split(
';');
1218 formatv(
"invalid argument to AllocToken pass mode "
1225 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1235 while (!Params.
empty()) {
1237 std::tie(ParamName, Params) = Params.
split(
';');
1240 if (ParamName ==
"speculate-blocks") {
1242 }
else if (ParamName ==
"simplify-cond-branch") {
1244 }
else if (ParamName ==
"forward-switch-cond") {
1246 }
else if (ParamName ==
"switch-range-to-icmp") {
1248 }
else if (ParamName ==
"switch-to-arithmetic") {
1250 }
else if (ParamName ==
"switch-to-lookup") {
1252 }
else if (ParamName ==
"keep-loops") {
1254 }
else if (ParamName ==
"hoist-common-insts") {
1256 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1258 }
else if (ParamName ==
"sink-common-insts") {
1260 }
else if (ParamName ==
"speculate-unpredictables") {
1263 APInt BonusInstThreshold;
1266 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1274 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1285 Result.setVerifyFixpoint(
true);
1286 while (!Params.
empty()) {
1288 std::tie(ParamName, Params) = Params.
split(
';');
1291 if (ParamName ==
"verify-fixpoint") {
1294 APInt MaxIterations;
1297 formatv(
"invalid argument to InstCombine pass max-iterations "
1305 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1315 while (!Params.
empty()) {
1317 std::tie(ParamName, Params) = Params.
split(
';');
1320 if (ParamName ==
"interleave-forced-only") {
1322 }
else if (ParamName ==
"vectorize-forced-only") {
1326 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1334 std::pair<bool, bool>
Result = {
false,
true};
1335 while (!Params.
empty()) {
1337 std::tie(ParamName, Params) = Params.
split(
';');
1340 if (ParamName ==
"nontrivial") {
1342 }
else if (ParamName ==
"trivial") {
1346 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1355 while (!Params.
empty()) {
1357 std::tie(ParamName, Params) = Params.
split(
';');
1360 if (ParamName ==
"allowspeculation") {
1364 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1371struct LoopRotateOptions {
1372 bool EnableHeaderDuplication =
true;
1373 bool PrepareForLTO =
false;
1374 bool CheckExitCount =
false;
1378 LoopRotateOptions
Result;
1379 while (!Params.
empty()) {
1381 std::tie(ParamName, Params) = Params.
split(
';');
1384 if (ParamName ==
"header-duplication") {
1386 }
else if (ParamName ==
"prepare-for-lto") {
1388 }
else if (ParamName ==
"check-exit-count") {
1392 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1401 while (!Params.
empty()) {
1403 std::tie(ParamName, Params) = Params.
split(
';');
1406 if (ParamName ==
"split-footer-bb") {
1410 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1421 while (!Params.
empty()) {
1423 std::tie(ParamName, Params) = Params.
split(
';');
1426 if (ParamName ==
"scalar-pre") {
1428 }
else if (ParamName ==
"load-pre") {
1430 }
else if (ParamName ==
"split-backedge-load-pre") {
1432 }
else if (ParamName ==
"memdep") {
1436 }
else if (ParamName ==
"memoryssa") {
1442 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1451 while (!Params.
empty()) {
1453 std::tie(ParamName, Params) = Params.
split(
';');
1456 if (ParamName ==
"func-spec")
1460 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1468 while (!Params.
empty()) {
1470 std::tie(ParamName, Params) = Params.
split(
';');
1475 formatv(
"invalid argument to Scalarizer pass min-bits "
1486 if (ParamName ==
"load-store")
1488 else if (ParamName ==
"variable-insert-extract")
1492 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1502 bool SawCFGOption =
false;
1503 while (!Params.
empty()) {
1505 std::tie(ParamName, Params) = Params.
split(
';');
1507 if (ParamName ==
"modify-cfg") {
1512 SawCFGOption =
true;
1513 }
else if (ParamName ==
"preserve-cfg") {
1518 SawCFGOption =
true;
1519 }
else if (ParamName ==
"aggregate-to-vector") {
1520 Result.AggregateToVector =
true;
1523 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1524 "modify-cfg, or aggregate-to-vector)",
1534parseStackLifetimeOptions(
StringRef Params) {
1536 while (!Params.
empty()) {
1538 std::tie(ParamName, Params) = Params.
split(
';');
1540 if (ParamName ==
"may") {
1542 }
else if (ParamName ==
"must") {
1546 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1555 "DependenceAnalysisPrinter");
1560 "SeparateConstOffsetFromGEP");
1569parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1573 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1581 "MemorySSAPrinterPass");
1586 "SpeculativeExecutionPass");
1591 while (!Params.
empty()) {
1593 std::tie(ParamName, Params) = Params.
split(
';');
1599 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1607parseStructuralHashPrinterPassOptions(
StringRef Params) {
1610 if (Params ==
"detailed")
1612 if (Params ==
"call-target-ignored")
1615 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1621 "WinEHPreparePass");
1626 while (!Params.
empty()) {
1628 std::tie(ParamName, Params) = Params.
split(
';');
1631 if (ParamName ==
"group-by-use")
1633 else if (ParamName ==
"ignore-single-use")
1635 else if (ParamName ==
"merge-const")
1637 else if (ParamName ==
"merge-const-aggressive")
1639 else if (ParamName ==
"merge-external")
1644 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1648 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1657 while (!Params.
empty()) {
1659 std::tie(ParamName, Params) = Params.
split(
';');
1665 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1676 while (!Params.
empty()) {
1678 std::tie(ParamName, Params) = Params.
split(
';');
1681 std::optional<RegAllocFilterFunc>
Filter =
1685 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1694 if (ParamName ==
"no-clear-vregs") {
1700 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1707parseBoundsCheckingOptions(
StringRef Params) {
1709 while (!Params.
empty()) {
1711 std::tie(ParamName, Params) = Params.
split(
';');
1712 if (ParamName ==
"trap") {
1714 }
else if (ParamName ==
"rt") {
1720 }
else if (ParamName ==
"rt-abort") {
1726 }
else if (ParamName ==
"min-rt") {
1732 }
else if (ParamName ==
"min-rt-abort") {
1738 }
else if (ParamName ==
"merge") {
1740 }
else if (ParamName ==
"handler-preserve-all-regs") {
1742 Options.Rt->HandlerPreserveAllRegs =
true;
1746 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1752 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1769 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1771 Param.str().c_str());
1774 if (!
Level.has_value())
1776 "invalid optimization level for expand-ir-insts pass: %s",
1777 Digit.str().c_str());
1784 if (Params.
empty() || Params ==
"all")
1785 return RAGreedyPass::Options();
1789 return RAGreedyPass::Options{*
Filter, Params};
1792 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1798 "MachineSinkingPass");
1802 bool AllowTailMerge =
true;
1803 if (!Params.
empty()) {
1805 if (Params !=
"tail-merge")
1807 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1811 return AllowTailMerge;
1815 bool ClearVirtRegs =
true;
1816 if (!Params.
empty()) {
1818 if (Params !=
"clear-vregs")
1820 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1823 return ClearVirtRegs;
1826struct FatLTOOptions {
1828 bool ThinLTO =
false;
1829 bool EmitSummary =
false;
1834 bool HaveOptLevel =
false;
1835 while (!Params.
empty()) {
1837 std::tie(ParamName, Params) = Params.
split(
';');
1839 if (ParamName ==
"thinlto") {
1841 }
else if (ParamName ==
"emit-summary") {
1842 Result.EmitSummary =
true;
1843 }
else if (std::optional<OptimizationLevel> OptLevel =
1845 Result.OptLevel = *OptLevel;
1846 HaveOptLevel =
true;
1849 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1856 "missing optimization level for fatlto-pre-link pipeline",
1871template <
typename PassManagerT,
typename CallbacksT>
1873 if (!Callbacks.empty()) {
1874 PassManagerT DummyPM;
1875 for (
auto &CB : Callbacks)
1876 if (CB(Name, DummyPM, {}))
1882template <
typename CallbacksT>
1884 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1887 if (Name ==
"module")
1889 if (Name ==
"cgscc")
1891 if (NameNoBracket ==
"function")
1893 if (Name ==
"coro-cond")
1896#define MODULE_PASS(NAME, CREATE_PASS) \
1899#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1900 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1902#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1903 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1905#include "PassRegistry.def"
1910template <
typename CallbacksT>
1913 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1914 if (Name ==
"cgscc")
1916 if (NameNoBracket ==
"function")
1923#define CGSCC_PASS(NAME, CREATE_PASS) \
1926#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1927 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1929#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1930 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1932#include "PassRegistry.def"
1937template <
typename CallbacksT>
1940 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1941 if (NameNoBracket ==
"function")
1943 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1946#define FUNCTION_PASS(NAME, CREATE_PASS) \
1949#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1950 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1952#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1953 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1955#include "PassRegistry.def"
1960template <
typename CallbacksT>
1963 if (Name ==
"machine-function")
1966#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1969#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1971 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1974#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1975 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1978#include "llvm/Passes/MachinePassRegistry.def"
1983template <
typename CallbacksT>
1985 bool &UseMemorySSA) {
1986 UseMemorySSA =
false;
1989 UseMemorySSA =
true;
1993#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1996#include "PassRegistry.def"
2001template <
typename CallbacksT>
2003 bool &UseMemorySSA) {
2004 UseMemorySSA =
false;
2007 UseMemorySSA =
true;
2011#define LOOP_PASS(NAME, CREATE_PASS) \
2014#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2015 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
2017#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2018 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
2020#include "PassRegistry.def"
2025std::optional<std::vector<PassBuilder::PipelineElement>>
2027 std::vector<PipelineElement> ResultPipeline;
2032 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2033 size_t Pos =
Text.find_first_of(
",()");
2034 Pipeline.push_back({
Text.substr(0, Pos), {}});
2037 if (Pos ==
Text.npos)
2040 char Sep =
Text[Pos];
2048 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2052 assert(Sep ==
')' &&
"Bogus separator!");
2057 if (PipelineStack.
size() == 1)
2058 return std::nullopt;
2061 }
while (
Text.consume_front(
")"));
2069 if (!
Text.consume_front(
","))
2070 return std::nullopt;
2073 if (PipelineStack.
size() > 1)
2075 return std::nullopt;
2077 assert(PipelineStack.
back() == &ResultPipeline &&
2078 "Wrong pipeline at the bottom of the stack!");
2079 return {std::move(ResultPipeline)};
2089 const PipelineElement &
E) {
2090 auto &
Name =
E.Name;
2091 auto &InnerPipeline =
E.InnerPipeline;
2094 if (!InnerPipeline.empty()) {
2095 if (Name ==
"module") {
2097 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2099 MPM.
addPass(std::move(NestedMPM));
2102 if (Name ==
"coro-cond") {
2104 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2106 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2109 if (Name ==
"cgscc") {
2111 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2119 "cannot have a no-rerun module to function adaptor",
2122 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2129 for (
auto &
C : ModulePipelineParsingCallbacks)
2130 if (
C(Name, MPM, InnerPipeline))
2135 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2141#define MODULE_PASS(NAME, CREATE_PASS) \
2142 if (Name == NAME) { \
2143 MPM.addPass(CREATE_PASS); \
2144 return Error::success(); \
2146#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2147 if (checkParametrizedPassName(Name, NAME)) { \
2148 auto Params = parsePassParameters(PARSER, Name, NAME); \
2150 return Params.takeError(); \
2151 MPM.addPass(CREATE_PASS(Params.get())); \
2152 return Error::success(); \
2154#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2155 if (Name == "require<" NAME ">") { \
2157 RequireAnalysisPass< \
2158 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2159 return Error::success(); \
2161 if (Name == "invalidate<" NAME ">") { \
2162 MPM.addPass(InvalidateAnalysisPass< \
2163 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2164 return Error::success(); \
2166#define CGSCC_PASS(NAME, CREATE_PASS) \
2167 if (Name == NAME) { \
2168 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2169 return Error::success(); \
2171#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2172 if (checkParametrizedPassName(Name, NAME)) { \
2173 auto Params = parsePassParameters(PARSER, Name, NAME); \
2175 return Params.takeError(); \
2177 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2178 return Error::success(); \
2180#define FUNCTION_PASS(NAME, CREATE_PASS) \
2181 if (Name == NAME) { \
2182 if constexpr (std::is_constructible_v< \
2183 std::remove_reference_t<decltype(CREATE_PASS)>, \
2184 const TargetMachine &>) { \
2186 return make_error<StringError>( \
2187 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2188 inconvertibleErrorCode()); \
2190 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2191 return Error::success(); \
2193#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2194 if (checkParametrizedPassName(Name, NAME)) { \
2195 auto Params = parsePassParameters(PARSER, Name, NAME); \
2197 return Params.takeError(); \
2198 auto CreatePass = CREATE_PASS; \
2199 if constexpr (std::is_constructible_v< \
2200 std::remove_reference_t<decltype(CreatePass( \
2202 const TargetMachine &, \
2203 std::remove_reference_t<decltype(Params.get())>>) { \
2205 return make_error<StringError>( \
2206 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2207 inconvertibleErrorCode()); \
2210 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2211 return Error::success(); \
2213#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2214 if (Name == NAME) { \
2215 MPM.addPass(createModuleToFunctionPassAdaptor( \
2216 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2217 return Error::success(); \
2219#define LOOP_PASS(NAME, CREATE_PASS) \
2220 if (Name == NAME) { \
2221 MPM.addPass(createModuleToFunctionPassAdaptor( \
2222 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2223 return Error::success(); \
2225#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2226 if (checkParametrizedPassName(Name, NAME)) { \
2227 auto Params = parsePassParameters(PARSER, Name, NAME); \
2229 return Params.takeError(); \
2230 MPM.addPass(createModuleToFunctionPassAdaptor( \
2231 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2232 return Error::success(); \
2234#include "PassRegistry.def"
2236 for (
auto &
C : ModulePipelineParsingCallbacks)
2237 if (
C(Name, MPM, InnerPipeline))
2240 formatv(
"unknown module pass '{}'", Name).str(),
2245 const PipelineElement &
E) {
2246 auto &
Name =
E.Name;
2247 auto &InnerPipeline =
E.InnerPipeline;
2250 if (!InnerPipeline.empty()) {
2251 if (Name ==
"cgscc") {
2253 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2256 CGPM.
addPass(std::move(NestedCGPM));
2261 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2265 std::move(FPM), Params->first, Params->second));
2270 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2277 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2278 if (
C(Name, CGPM, InnerPipeline))
2283 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2288#define CGSCC_PASS(NAME, CREATE_PASS) \
2289 if (Name == NAME) { \
2290 CGPM.addPass(CREATE_PASS); \
2291 return Error::success(); \
2293#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2294 if (checkParametrizedPassName(Name, NAME)) { \
2295 auto Params = parsePassParameters(PARSER, Name, NAME); \
2297 return Params.takeError(); \
2298 CGPM.addPass(CREATE_PASS(Params.get())); \
2299 return Error::success(); \
2301#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2302 if (Name == "require<" NAME ">") { \
2303 CGPM.addPass(RequireAnalysisPass< \
2304 std::remove_reference_t<decltype(CREATE_PASS)>, \
2305 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2306 CGSCCUpdateResult &>()); \
2307 return Error::success(); \
2309 if (Name == "invalidate<" NAME ">") { \
2310 CGPM.addPass(InvalidateAnalysisPass< \
2311 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2312 return Error::success(); \
2314#define FUNCTION_PASS(NAME, CREATE_PASS) \
2315 if (Name == NAME) { \
2316 if constexpr (std::is_constructible_v< \
2317 std::remove_reference_t<decltype(CREATE_PASS)>, \
2318 const TargetMachine &>) { \
2320 return make_error<StringError>( \
2321 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2322 inconvertibleErrorCode()); \
2324 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2325 return Error::success(); \
2327#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2328 if (checkParametrizedPassName(Name, NAME)) { \
2329 auto Params = parsePassParameters(PARSER, Name, NAME); \
2331 return Params.takeError(); \
2332 auto CreatePass = CREATE_PASS; \
2333 if constexpr (std::is_constructible_v< \
2334 std::remove_reference_t<decltype(CreatePass( \
2336 const TargetMachine &, \
2337 std::remove_reference_t<decltype(Params.get())>>) { \
2339 return make_error<StringError>( \
2340 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2341 inconvertibleErrorCode()); \
2344 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2345 return Error::success(); \
2347#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2348 if (Name == NAME) { \
2349 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2350 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2351 return Error::success(); \
2353#define LOOP_PASS(NAME, CREATE_PASS) \
2354 if (Name == NAME) { \
2355 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2356 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2357 return Error::success(); \
2359#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2360 if (checkParametrizedPassName(Name, NAME)) { \
2361 auto Params = parsePassParameters(PARSER, Name, NAME); \
2363 return Params.takeError(); \
2364 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2365 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2366 return Error::success(); \
2368#include "PassRegistry.def"
2370 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2371 if (
C(Name, CGPM, InnerPipeline))
2378 const PipelineElement &
E) {
2379 auto &
Name =
E.Name;
2380 auto &InnerPipeline =
E.InnerPipeline;
2383 if (!InnerPipeline.empty()) {
2384 if (Name ==
"function") {
2386 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2389 FPM.
addPass(std::move(NestedFPM));
2392 if (Name ==
"loop" || Name ==
"loop-mssa") {
2394 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2397 bool UseMemorySSA = (
Name ==
"loop-mssa");
2402 if (Name ==
"machine-function") {
2404 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2410 for (
auto &
C : FunctionPipelineParsingCallbacks)
2411 if (
C(Name, FPM, InnerPipeline))
2416 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2421#define FUNCTION_PASS(NAME, CREATE_PASS) \
2422 if (Name == NAME) { \
2423 if constexpr (std::is_constructible_v< \
2424 std::remove_reference_t<decltype(CREATE_PASS)>, \
2425 const TargetMachine &>) { \
2427 return make_error<StringError>( \
2428 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2429 inconvertibleErrorCode()); \
2431 FPM.addPass(CREATE_PASS); \
2432 return Error::success(); \
2434#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2435 if (checkParametrizedPassName(Name, NAME)) { \
2436 auto Params = parsePassParameters(PARSER, Name, NAME); \
2438 return Params.takeError(); \
2439 auto CreatePass = CREATE_PASS; \
2440 if constexpr (std::is_constructible_v< \
2441 std::remove_reference_t<decltype(CreatePass( \
2443 const TargetMachine &, \
2444 std::remove_reference_t<decltype(Params.get())>>) { \
2446 return make_error<StringError>( \
2447 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2448 inconvertibleErrorCode()); \
2451 FPM.addPass(CREATE_PASS(Params.get())); \
2452 return Error::success(); \
2454#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2455 if (Name == "require<" NAME ">") { \
2456 if constexpr (std::is_constructible_v< \
2457 std::remove_reference_t<decltype(CREATE_PASS)>, \
2458 const TargetMachine &>) { \
2460 return make_error<StringError>( \
2461 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2462 inconvertibleErrorCode()); \
2465 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2467 return Error::success(); \
2469 if (Name == "invalidate<" NAME ">") { \
2470 FPM.addPass(InvalidateAnalysisPass< \
2471 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2472 return Error::success(); \
2478#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2479 if (Name == NAME) { \
2480 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2481 return Error::success(); \
2483#define LOOP_PASS(NAME, CREATE_PASS) \
2484 if (Name == NAME) { \
2485 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2486 return Error::success(); \
2488#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2489 if (checkParametrizedPassName(Name, NAME)) { \
2490 auto Params = parsePassParameters(PARSER, Name, NAME); \
2492 return Params.takeError(); \
2494 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2495 return Error::success(); \
2497#include "PassRegistry.def"
2499 for (
auto &
C : FunctionPipelineParsingCallbacks)
2500 if (
C(Name, FPM, InnerPipeline))
2503 formatv(
"unknown function pass '{}'", Name).str(),
2508 const PipelineElement &
E) {
2509 StringRef
Name =
E.Name;
2510 auto &InnerPipeline =
E.InnerPipeline;
2513 if (!InnerPipeline.empty()) {
2514 if (Name ==
"loop") {
2516 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2519 LPM.addPass(std::move(NestedLPM));
2523 for (
auto &
C : LoopPipelineParsingCallbacks)
2524 if (
C(Name, LPM, InnerPipeline))
2529 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2534#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2535 if (Name == NAME) { \
2536 LPM.addPass(CREATE_PASS); \
2537 return Error::success(); \
2539#define LOOP_PASS(NAME, CREATE_PASS) \
2540 if (Name == NAME) { \
2541 LPM.addPass(CREATE_PASS); \
2542 return Error::success(); \
2544#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2545 if (checkParametrizedPassName(Name, NAME)) { \
2546 auto Params = parsePassParameters(PARSER, Name, NAME); \
2548 return Params.takeError(); \
2549 LPM.addPass(CREATE_PASS(Params.get())); \
2550 return Error::success(); \
2552#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2553 if (Name == "require<" NAME ">") { \
2554 LPM.addPass(RequireAnalysisPass< \
2555 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2556 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2558 return Error::success(); \
2560 if (Name == "invalidate<" NAME ">") { \
2561 LPM.addPass(InvalidateAnalysisPass< \
2562 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2563 return Error::success(); \
2565#include "PassRegistry.def"
2567 for (
auto &
C : LoopPipelineParsingCallbacks)
2568 if (
C(Name, LPM, InnerPipeline))
2575 const PipelineElement &
E) {
2576 StringRef
Name =
E.Name;
2578 if (!
E.InnerPipeline.empty()) {
2579 if (
E.Name ==
"machine-function") {
2581 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2583 MFPM.
addPass(std::move(NestedPM));
2590#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2591 if (Name == NAME) { \
2592 MFPM.addPass(CREATE_PASS); \
2593 return Error::success(); \
2595#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2596 if (Name == NAME) { \
2597 MFPM.addPass(CREATE_PASS); \
2598 return Error::success(); \
2600#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2602 if (checkParametrizedPassName(Name, NAME)) { \
2603 auto Params = parsePassParameters(PARSER, Name, NAME); \
2605 return Params.takeError(); \
2606 MFPM.addPass(CREATE_PASS(Params.get())); \
2607 return Error::success(); \
2609#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2610 if (Name == "require<" NAME ">") { \
2612 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2613 MachineFunction>()); \
2614 return Error::success(); \
2616 if (Name == "invalidate<" NAME ">") { \
2617 MFPM.addPass(InvalidateAnalysisPass< \
2618 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2619 return Error::success(); \
2621#include "llvm/Passes/MachinePassRegistry.def"
2623 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2624 if (
C(Name, MFPM,
E.InnerPipeline))
2627 formatv(
"unknown machine pass '{}'", Name).str(),
2632#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2633 if (Name == NAME) { \
2634 AA.registerModuleAnalysis< \
2635 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2638#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2639 if (Name == NAME) { \
2640 AA.registerFunctionAnalysis< \
2641 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2644#include "PassRegistry.def"
2646 for (
auto &
C : AAParsingCallbacks)
2652Error PassBuilder::parseMachinePassPipeline(
2654 for (
const auto &Element : Pipeline) {
2655 if (
auto Err = parseMachinePass(MFPM, Element))
2663 for (
const auto &Element : Pipeline) {
2664 if (
auto Err = parseLoopPass(LPM, Element))
2670Error PassBuilder::parseFunctionPassPipeline(
2672 for (
const auto &Element : Pipeline) {
2673 if (
auto Err = parseFunctionPass(FPM, Element))
2681 for (
const auto &Element : Pipeline) {
2682 if (
auto Err = parseCGSCCPass(CGPM, Element))
2714 for (
const auto &Element : Pipeline) {
2715 if (
auto Err = parseModulePass(MPM, Element))
2726 auto Pipeline = parsePipelineText(PipelineText);
2727 if (!Pipeline || Pipeline->empty())
2729 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2739 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2741 FunctionPipelineParsingCallbacks)) {
2742 Pipeline = {{
"function", std::move(*Pipeline)}};
2745 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2746 std::move(*Pipeline)}}}};
2747 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2749 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2750 std::move(*Pipeline)}}}};
2752 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2753 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2755 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2756 if (
C(MPM, *Pipeline))
2760 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2762 formatv(
"unknown {} name '{}'",
2763 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2769 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2777 auto Pipeline = parsePipelineText(PipelineText);
2778 if (!Pipeline || Pipeline->empty())
2780 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2786 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2791 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2800 auto Pipeline = parsePipelineText(PipelineText);
2801 if (!Pipeline || Pipeline->empty())
2803 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2809 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2814 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2822 auto Pipeline = parsePipelineText(PipelineText);
2823 if (!Pipeline || Pipeline->empty())
2825 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2828 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2836 auto Pipeline = parsePipelineText(PipelineText);
2837 if (!Pipeline || Pipeline->empty())
2839 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2842 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2851 if (PipelineText ==
"default") {
2856 while (!PipelineText.
empty()) {
2858 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2859 if (!parseAAPassName(
AA, Name))
2861 formatv(
"unknown alias analysis name '{}'", Name).str(),
2868std::optional<RegAllocFilterFunc>
2870 if (FilterName ==
"all")
2872 for (
auto &
C : RegClassFilterParsingCallbacks)
2873 if (
auto F =
C(FilterName))
2875 return std::nullopt;
2886 auto I = PassNames.
begin();
2887 auto End = PassNames.
end();
2894 OS <<
" " << Name <<
'<' << Params <<
">\n";
2901 OS <<
"Module passes:\n";
2902 static constexpr char ModulePassNames[] = {
"\0"
2903#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2904#include "PassRegistry.def"
2908 OS <<
"Module passes with params:\n";
2909 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2910#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2911 NAME "\0" PARAMS "\0"
2912#include "PassRegistry.def"
2916 OS <<
"Module analyses:\n";
2917 static constexpr char ModuleAnalysisNames[] = {
"\0"
2918#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2919#include "PassRegistry.def"
2923 OS <<
"Module alias analyses:\n";
2924 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2925#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2926#include "PassRegistry.def"
2930 OS <<
"CGSCC passes:\n";
2931 static constexpr char CGSCCPassNames[] = {
"\0"
2932#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2933#include "PassRegistry.def"
2937 OS <<
"CGSCC passes with params:\n";
2938 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2939#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2940 NAME "\0" PARAMS "\0"
2941#include "PassRegistry.def"
2945 OS <<
"CGSCC analyses:\n";
2946 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2947#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2948#include "PassRegistry.def"
2952 OS <<
"Function passes:\n";
2953 static constexpr char FunctionPassNames[] = {
"\0"
2954#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2955#include "PassRegistry.def"
2959 OS <<
"Function passes with params:\n";
2960 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2961#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2962 NAME "\0" PARAMS "\0"
2963#include "PassRegistry.def"
2967 OS <<
"Function analyses:\n";
2968 static constexpr char FunctionAnalysisNames[] = {
"\0"
2969#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2970#include "PassRegistry.def"
2974 OS <<
"Function alias analyses:\n";
2975 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2976#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2977#include "PassRegistry.def"
2981 OS <<
"LoopNest passes:\n";
2982 static constexpr char LoopNestPassNames[] = {
"\0"
2983#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2984#include "PassRegistry.def"
2988 OS <<
"Loop passes:\n";
2989 static constexpr char LoopPassNames[] = {
"\0"
2990#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2991#include "PassRegistry.def"
2995 OS <<
"Loop passes with params:\n";
2996 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2997#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2998 NAME "\0" PARAMS "\0"
2999#include "PassRegistry.def"
3003 OS <<
"Loop analyses:\n";
3004 static constexpr char LoopAnalysisNames[] = {
"\0"
3005#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3006#include "PassRegistry.def"
3010 OS <<
"Machine module passes (WIP):\n";
3011 static constexpr char MachineModulePassNames[] = {
"\0"
3012#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
3013#include "llvm/Passes/MachinePassRegistry.def"
3017 OS <<
"Machine function passes (WIP):\n";
3018 static constexpr char MachineFunctionPassNames[] = {
"\0"
3019#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3020#include "llvm/Passes/MachinePassRegistry.def"
3024 OS <<
"Machine function analyses (WIP):\n";
3025 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3026#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3027#include "llvm/Passes/MachinePassRegistry.def"
3035 TopLevelPipelineParsingCallbacks.push_back(
C);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AggressiveInstCombiner - Combine expression patterns to form expressions with fewer,...
This file implements a simple N^2 alias analysis accuracy evaluator.
Provides passes to inlining "always_inline" functions.
This is the interface for LLVM's primary stateless and local alias analysis.
This file contains the declaration of the BreakFalseDepsPass class, used to identify and avoid false ...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Contains definition of the base CFIFixup pass.
This file provides the interface for LLVM's Call Graph Profile pass.
This header provides classes for managing passes over SCCs of the call graph.
Provides analysis for continuously CSEing during GISel passes.
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
Defines an IR pass for CodeGen Prepare.
This file contains the declaration of the MachineKCFI class, which is a Machine Pass that implements ...
#define LLVM_ATTRIBUTE_NOINLINE
LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so, mark a method "not for inl...
This file declares an analysis pass that computes CycleInfo for LLVM IR, specialized from GenericCycl...
Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that ge...
This file provides the interface for a simple, fast CSE pass.
This file provides a pass which clones the current module and runs the provided pass pipeline on the ...
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
Provides passes for computing function attributes based on interprocedural analyses.
This file provides the interface for the GCOV style profiler pass.
Provides analysis for querying information about KnownBits during GISel passes.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
This is the interface for a simple mod/ref and alias analysis over globals.
Defines an IR pass for the creation of hardware loops.
AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...
This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder inte...
This file defines passes to print out IR in various granularities.
This file declares the IRTranslator pass.
This header defines various interfaces for pass management in LLVM.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
This file provides the primary interface to the instcombine pass.
Defines passes for running instruction simplification across chunks of IR.
This file provides the interface for LLVM's PGO Instrumentation lowering pass.
This file contains the declaration of the InterleavedAccessPass class, its corresponding pass name is...
See the comments on JumpThreadingPass.
Implements a lazy call graph analysis and related passes for the new pass manager.
This file provides the interface for LLVM's Logical Scalar Replacement of Aggregates pass.
This file defines the interface for the loop cache analysis.
This file provides the interface for LLVM's Loop Data Prefetching Pass.
This file implements the Loop Fusion pass.
This header defines the LoopLoadEliminationPass object.
This file defines the interface for the loop nest analysis.
This header provides classes for managing a pipeline of passes over loops in LLVM IR.
This file provides the interface for the pass responsible for removing expensive ubsan checks.
The header file for the LowerConstantIntrinsics pass as used by the new pass manager.
The header file for the LowerExpectIntrinsic pass as used by the new pass manager.
Machine Check Debug Module
This file contains the declaration of the CheckDebugMachineModulePass class, used by the new pass man...
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
This pass performs merges of loads and stores on both sides of a.
This is the interface to build a ModuleSummaryIndex for a module.
Contains a collection of routines for determining if a given instruction is guaranteed to execute if ...
This file provides the interface for LLVM's Global Value Numbering pass.
This file declares a simple ARC-aware AliasAnalysis using special knowledge of Objective C to enhance...
This header enumerates the LLVM-provided high-level optimization levels.
This file provides the interface for IR based instrumentation passes ( (profile-gen,...
CGSCCAnalysisManager CGAM
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
static bool isModulePassName(StringRef Name, CallbacksT &Callbacks)
static bool callbacksAcceptPassName(StringRef Name, CallbacksT &Callbacks)
Tests whether registered callbacks will accept a given pass name.
static std::optional< int > parseDevirtPassName(StringRef Name)
static LLVM_ATTRIBUTE_NOINLINE void printPassNameList(StringTable PassNames, raw_ostream &OS)
static bool isLoopNestPassName(StringRef Name, CallbacksT &Callbacks, bool &UseMemorySSA)
static bool isMachineFunctionPassName(StringRef Name, CallbacksT &Callbacks)
static Expected< OptimizationLevel > parseOptLevelParam(StringRef S)
static std::optional< OptimizationLevel > parseOptLevel(StringRef S)
static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks, bool &UseMemorySSA)
static std::optional< std::pair< bool, bool > > parseFunctionPipelineName(StringRef Name)
static bool isCGSCCPassName(StringRef Name, CallbacksT &Callbacks)
static LLVM_ATTRIBUTE_NOINLINE void printPassNameListWithParams(StringTable PassNames, raw_ostream &OS)
static bool isFunctionPassName(StringRef Name, CallbacksT &Callbacks)
static void setupOptionsForPipelineAlias(PipelineTuningOptions &PTO, OptimizationLevel L)
This file implements the PredicateInfo analysis, which creates an Extended SSA form for operations us...
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file describes the interface of the MachineFunctionPass responsible for assigning the generic vi...
This pass is required to take advantage of the interprocedural register allocation infrastructure.
This file implements relative lookup table converter that converts lookup tables to relative lookup t...
This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.
This file provides the interface for the pseudo probe implementation for AutoFDO.
This file provides the interface for the sampled PGO loader pass.
This is the interface for a SCEV-based alias analysis.
This pass converts vector operations into scalar operations (or, optionally, operations on smaller ve...
This is the interface for a metadata-based scoped no-alias analysis.
This file contains the declaration of the SelectOptimizePass class, its corresponding pass name is se...
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This pass strips convergence intrinsics and operand bundles as those are only useful when modifying t...
Target-Independent Code Generator Pass Configuration Options pass.
This is the interface for a metadata-based TBAA.
static const char PassName[]
A manager for alias analyses.
Class for arbitrary precision integers.
uint64_t getZExtValue() const
Get zero extended value.
int64_t getSExtValue() const
Get sign extended value.
bool registerPass(PassBuilderT &&PassBuilder)
Register an analysis pass with the manager.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
static LLVM_ABI GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
MachineFunction & getMF()
This analysis create MachineFunction for given Function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const MachineFunctionProperties & getProperties() const
Get the function properties.
LLVM_ABI Register createGenericVirtualRegister(LLT Ty, StringRef Name="")
Create and return a new generic virtual register with low-level type Ty.
This class provides access to building LLVM's passes.
LLVM_ABI void printPassNames(raw_ostream &OS)
Print pass names.
static bool checkParametrizedPassName(StringRef Name, StringRef PassName)
LLVM_ABI AAManager buildDefaultAAPipeline()
Build the default AAManager with the default alias analysis pipeline registered.
LLVM_ABI Error parseAAPipeline(AAManager &AA, StringRef PipelineText)
Parse a textual alias analysis pipeline into the provided AA manager.
LLVM_ABI void registerLoopAnalyses(LoopAnalysisManager &LAM)
Registers all available loop analysis passes.
LLVM_ABI std::optional< RegAllocFilterFunc > parseRegAllocFilter(StringRef RegAllocFilterName)
Parse RegAllocFilterName to get RegAllocFilterFunc.
LLVM_ABI void crossRegisterProxies(LoopAnalysisManager &LAM, FunctionAnalysisManager &FAM, CGSCCAnalysisManager &CGAM, ModuleAnalysisManager &MAM, MachineFunctionAnalysisManager *MFAM=nullptr)
Cross register the analysis managers through their proxies.
LLVM_ABI PassBuilder(TargetMachine *TM=nullptr, PipelineTuningOptions PTO=PipelineTuningOptions(), std::optional< PGOOptions > PGOOpt=std::nullopt, PassInstrumentationCallbacks *PIC=nullptr, IntrusiveRefCntPtr< vfs::FileSystem > FS=vfs::getRealFileSystem())
LLVM_ABI Error parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText)
Parse a textual pass pipeline description into a ModulePassManager.
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &C)
{{@ Register pipeline parsing callbacks with this pass builder instance.
LLVM_ABI void registerModuleAnalyses(ModuleAnalysisManager &MAM)
Registers all available module analysis passes.
LLVM_ABI void registerCGSCCAnalyses(CGSCCAnalysisManager &CGAM)
Registers all available CGSCC analysis passes.
static LLVM_ABI Expected< bool > parseSinglePassOption(StringRef Params, StringRef OptionName, StringRef PassName)
Handle passes only accept one bool-valued parameter.
LLVM_ABI void registerMachineFunctionAnalyses(MachineFunctionAnalysisManager &MFAM)
Registers all available machine function analysis passes.
LLVM_ABI void registerParseTopLevelPipelineCallback(const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >)> &C)
Register a callback for a top-level pipeline entry.
LLVM_ABI void registerFunctionAnalyses(FunctionAnalysisManager &FAM)
Registers all available function analysis passes.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
Tunable parameters for passes in the default pipelines.
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization, set based on opt level.
bool LoopVectorization
Tuning option to enable/disable loop vectorization, set based on opt level.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
std::string str() const
Get the contents as an std::string.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
Check if the string is empty.
char front() const
Get the first character in the string.
bool consume_front(char Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
A table of densely packed, null-terminated strings indexed by offset.
constexpr Iterator begin() const
constexpr Iterator end() const
Primary interface to the complete machine description for the target machine.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
self_iterator getIterator()
This class implements an extremely fast bulk output stream that can only output to a stream.
Interfaces for registering analysis passes, producing common pass manager configurations,...
Abstract Attribute helper functions.
std::optional< CodeGenOptLevel > getLevel(int OL)
Get the Level identified by the integer OL.
@ BasicBlock
Various leaf nodes.
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
DropTestKind
Specifies how to drop type tests.
@ All
Drop only llvm.assumes using type test value.
This is an optimization pass for GlobalISel generic memory operations.
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI cl::opt< std::optional< PrintPipelinePassesFormat >, false, PrintPipelinePassesFormatParser > PrintPipelinePasses
Common option used by multiple tools to print pipeline passes.
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
DevirtSCCRepeatedPass createDevirtSCCRepeatedPass(CGSCCPassT &&Pass, int MaxIterations)
A function to deduce a function pass type and wrap it in the templated adaptor.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
@ O1
Optimize quickly without destroying debuggability.
@ O0
Disable as many optimizations as possible.
@ O3
Optimize for fast execution as much as possible.
@ O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
InnerAnalysisManagerProxy< LoopAnalysisManager, Function > LoopAnalysisManagerFunctionProxy
A proxy from a LoopAnalysisManager to a Function.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager
The Loop pass manager.
ModuleToPostOrderCGSCCPassAdaptor createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
FunctionToLoopPassAdaptor createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
FunctionToMachineFunctionPassAdaptor createFunctionToMachineFunctionPassAdaptor(MachineFunctionPassT &&Pass)
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Function > MachineFunctionAnalysisManagerFunctionProxy
OuterAnalysisManagerProxy< FunctionAnalysisManager, Loop, LoopStandardAnalysisResults & > FunctionAnalysisManagerLoopProxy
A proxy from a FunctionAnalysisManager to a Loop.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
support::detail::RepeatAdapter< T > fmt_repeat(T &&Item, size_t Count)
OuterAnalysisManagerProxy< ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph & > ModuleAnalysisManagerCGSCCProxy
A proxy from a ModuleAnalysisManager to an SCC.
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Module > MachineFunctionAnalysisManagerModuleProxy
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
InnerAnalysisManagerProxy< CGSCCAnalysisManager, Module > CGSCCAnalysisManagerModuleProxy
A proxy from a CGSCCAnalysisManager to a Module.
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
MFPropsModifier(PassT &P, MachineFunction &MF) -> MFPropsModifier< PassT >
LLVM_ABI void printFormattedPipelinePasses(raw_ostream &OS, StringRef Pipeline, PrintPipelinePassesFormat Format=PrintPipelinePassesFormat::Text)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
PassManager< MachineFunction > MachineFunctionPassManager
Convenience typedef for a pass manager over functions.
LLVM_ABI bool applyDebugifyMetadataToMachineFunction(DIBuilder &DIB, Function &F, llvm::function_ref< MachineFunction *(Function &)> GetMF)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
LLVM_ABI std::optional< AllocTokenMode > getAllocTokenModeFromString(StringRef Name)
Returns the AllocTokenMode from its canonical string name; if an invalid name was provided returns nu...
PrintPipelinePassesFormat
@ Detailed
Hash with opcode only.
@ CallTargetIgnored
Hash with opcode and operands.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
Implement std::hash so that hash_code can be used in STL containers.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A set of parameters to control various transforms performed by GVN pass.
HardwareLoopOptions & setForceNested(bool Force)
HardwareLoopOptions & setDecrement(unsigned Count)
HardwareLoopOptions & setForceGuard(bool Force)
HardwareLoopOptions & setForce(bool Force)
HardwareLoopOptions & setCounterBitwidth(unsigned Width)
HardwareLoopOptions & setForcePhi(bool Force)
A set of parameters to control various transforms performed by IPSCCP pass.
A set of parameters used to control various transforms performed by the LoopUnroll pass.
LoopUnrollOptions & setPeeling(bool Peeling)
Enables or disables loop peeling.
LoopUnrollOptions & setOptLevel(int O)
LoopUnrollOptions & setPartial(bool Partial)
Enables or disables partial unrolling.
LoopUnrollOptions & setFullUnrollMaxCount(unsigned O)
LoopUnrollOptions & setPrepareForLTO(bool V)
LoopUnrollOptions & setUpperBound(bool UpperBound)
Enables or disables the use of trip count upper bound in loop unrolling.
LoopUnrollOptions & setRuntime(bool Runtime)
Enables or disables unrolling of loops with runtime trip count.
LoopUnrollOptions & setProfileBasedPeeling(int O)
LoopVectorizeOptions & setVectorizeOnlyWhenForced(bool Value)
LoopVectorizeOptions & setInterleaveOnlyWhenForced(bool Value)
A CRTP mix-in for passes that can be skipped.
RegAllocFilterFunc Filter