428 "Print string describing the pipeline (best-effort only).\n"
429 " - =text\tPrint a '-passes' compatible string describing the "
431 " - =tree\tPrint a tree-like structure describing the pipeline."));
435 std::optional<PrintPipelinePassesFormat> &Val) {
436 std::optional<PrintPipelinePassesFormat>
Format =
445 "'{0}' value invalid for print-pipeline-passes argument!", Arg));
459 for (
char C : Pipeline) {
467 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
497 return MFA ? &MFA->
getMF() :
nullptr;
503class TriggerVerifierErrorPass
509 auto *PtrTy = PointerType::getUnqual(
M.getContext());
511 GlobalValue::LinkageTypes::InternalLinkage,
512 "__bad_alias",
nullptr, &M);
532 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
537class RequireAllMachineFunctionPropertiesPass
545 static MachineFunctionProperties getRequiredProperties() {
546 return MachineFunctionProperties()
548 .setFailsVerification()
553 .setRegBankSelected()
555 .setTiedOpsRewritten()
556 .setTracksDebugUserValues()
557 .setTracksLiveness();
559 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
565 if (S ==
"Os" || S ==
"Oz")
567 Twine(
"The optimization level \"") + S +
568 "\" is no longer supported. Use O2 in conjunction with the " +
569 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
580 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
584 formatv(
"invalid optimization level '{}'", S).str(),
589 std::optional<PGOOptions> PGOOpt,
592 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
594 TM->registerPassBuilderCallbacks(*
this);
596 PIC->registerClassToPassNameCallback([
this, PIC]() {
600#define MODULE_PASS(NAME, CREATE_PASS) \
601 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
602#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
603 PIC->addClassToPassName(CLASS, NAME);
604#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
605 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
606#define FUNCTION_PASS(NAME, CREATE_PASS) \
607 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
608#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
609 PIC->addClassToPassName(CLASS, NAME);
610#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
611 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
612#define LOOPNEST_PASS(NAME, CREATE_PASS) \
613 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
614#define LOOP_PASS(NAME, CREATE_PASS) \
615 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
616#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
617 PIC->addClassToPassName(CLASS, NAME);
618#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
619 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
620#define CGSCC_PASS(NAME, CREATE_PASS) \
621 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
622#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
623 PIC->addClassToPassName(CLASS, NAME);
624#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
625 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
626#include "PassRegistry.def"
628#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
629 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
630#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
631 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
632#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
634 PIC->addClassToPassName(CLASS, NAME);
635#include "llvm/Passes/MachinePassRegistry.def"
643#define MODULE_CALLBACK(NAME, INVOKE) \
644 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
645 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
647 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
650 INVOKE(PM, L.get()); \
653#include "PassRegistry.def"
661#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
662 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
663 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
665 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
668 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
671#include "PassRegistry.def"
679#define FUNCTION_CALLBACK(NAME, INVOKE) \
680 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
681 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
683 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
686 INVOKE(PM, L.get()); \
689#include "PassRegistry.def"
697#define CGSCC_CALLBACK(NAME, INVOKE) \
698 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
699 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
701 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
704 INVOKE(PM, L.get()); \
707#include "PassRegistry.def"
715#define LOOP_CALLBACK(NAME, INVOKE) \
716 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
717 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
719 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
722 INVOKE(PM, L.get()); \
725#include "PassRegistry.def"
731#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
732 MAM.registerPass([&] { return CREATE_PASS; });
733#include "PassRegistry.def"
735 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
740#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
741 CGAM.registerPass([&] { return CREATE_PASS; });
742#include "PassRegistry.def"
744 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
754#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
755 if constexpr (std::is_constructible_v< \
756 std::remove_reference_t<decltype(CREATE_PASS)>, \
757 const TargetMachine &>) { \
759 FAM.registerPass([&] { return CREATE_PASS; }); \
761 FAM.registerPass([&] { return CREATE_PASS; }); \
763#include "PassRegistry.def"
765 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
772#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
773 MFAM.registerPass([&] { return CREATE_PASS; });
774#include "llvm/Passes/MachinePassRegistry.def"
776 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
781#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
782 LAM.registerPass([&] { return CREATE_PASS; });
783#include "PassRegistry.def"
785 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
789static std::optional<std::pair<bool, bool>>
791 std::pair<bool, bool> Params;
792 if (!Name.consume_front(
"function"))
796 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
798 while (!Name.empty()) {
799 auto [Front, Back] = Name.split(
';');
801 if (Front ==
"eager-inv")
803 else if (Front ==
"no-rerun")
804 Params.second =
true;
812 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
824 while (!Params.
empty()) {
826 std::tie(ParamName, Params) = Params.
split(
';');
828 if (ParamName == OptionName) {
845 while (!Params.
empty()) {
847 std::tie(ParamName, Params) = Params.
split(
';');
852 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
857 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
861 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
866 if (ParamName ==
"force-hardware-loops") {
868 }
else if (ParamName ==
"force-hardware-loop-phi") {
870 }
else if (ParamName ==
"force-nested-hardware-loop") {
872 }
else if (ParamName ==
"force-hardware-loop-guard") {
876 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
880 return HardwareLoopOpts;
892 "FunctionPropertiesStatisticsPass");
903 while (!Params.
empty()) {
905 std::tie(ParamName, Params) = Params.
split(
';');
906 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
908 UnrollOpts.
setOptLevel(
static_cast<int>(*OptLevel));
915 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
922 if (ParamName ==
"partial") {
924 }
else if (ParamName ==
"peeling") {
926 }
else if (ParamName ==
"profile-peeling") {
928 }
else if (ParamName ==
"runtime") {
930 }
else if (ParamName ==
"upperbound") {
932 }
else if (ParamName ==
"prepare-for-lto") {
936 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
945 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
965 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
974 "EntryExitInstrumenter");
979 "DropUnnecessaryAssumes");
984 "LowerMatrixIntrinsics");
989 while (!Params.
empty()) {
991 std::tie(ParamName, Params) = Params.
split(
';');
994 if (ParamName ==
"preserve-order")
996 else if (ParamName ==
"rename-all")
998 else if (ParamName ==
"fold-all")
1000 else if (ParamName ==
"reorder-operands")
1004 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
1014 while (!Params.
empty()) {
1016 std::tie(ParamName, Params) = Params.
split(
';');
1018 if (ParamName ==
"kernel") {
1019 Result.CompileKernel =
true;
1020 }
else if (ParamName ==
"use-after-scope") {
1021 Result.UseAfterScope =
true;
1024 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1034 while (!Params.
empty()) {
1036 std::tie(ParamName, Params) = Params.
split(
';');
1038 if (ParamName ==
"recover") {
1040 }
else if (ParamName ==
"kernel") {
1041 Result.CompileKernel =
true;
1044 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1053parseDropTypeTestsPassOptions(
StringRef Params) {
1055 while (!Params.
empty()) {
1057 std::tie(ParamName, Params) = Params.
split(
';');
1059 if (ParamName ==
"all") {
1061 }
else if (ParamName ==
"assume") {
1065 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1074 while (!Params.
empty()) {
1076 std::tie(ParamName, Params) = Params.
split(
';');
1078 if (ParamName ==
"thinlto") {
1080 }
else if (ParamName ==
"emit-summary") {
1081 Result.EmitLTOSummary =
true;
1084 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1092parseLowerAllowCheckPassOptions(
StringRef Params) {
1094 while (!Params.
empty()) {
1096 std::tie(ParamName, Params) = Params.
split(
';');
1107 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1114 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1119 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1121 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1122 IndicesStr, CutoffStr)
1126 while (IndicesStr !=
"") {
1128 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1134 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1135 firstIndexStr, IndicesStr)
1142 if (index >=
Result.cutoffs.size())
1143 Result.cutoffs.resize(index + 1, 0);
1145 Result.cutoffs[index] = cutoff;
1147 }
else if (ParamName.
starts_with(
"runtime_check")) {
1149 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1153 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1155 ValueString, Params)
1159 Result.runtime_check = runtime_check;
1162 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1173 while (!Params.
empty()) {
1175 std::tie(ParamName, Params) = Params.
split(
';');
1177 if (ParamName ==
"recover") {
1179 }
else if (ParamName ==
"kernel") {
1184 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1189 }
else if (ParamName ==
"eager-checks") {
1190 Result.EagerChecks =
true;
1193 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1203 while (!Params.
empty()) {
1205 std::tie(ParamName, Params) = Params.
split(
';');
1212 formatv(
"invalid argument to AllocToken pass mode "
1219 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1229 while (!Params.
empty()) {
1231 std::tie(ParamName, Params) = Params.
split(
';');
1234 if (ParamName ==
"speculate-blocks") {
1236 }
else if (ParamName ==
"simplify-cond-branch") {
1238 }
else if (ParamName ==
"forward-switch-cond") {
1240 }
else if (ParamName ==
"switch-range-to-icmp") {
1242 }
else if (ParamName ==
"switch-to-arithmetic") {
1244 }
else if (ParamName ==
"switch-to-lookup") {
1246 }
else if (ParamName ==
"keep-loops") {
1248 }
else if (ParamName ==
"hoist-common-insts") {
1250 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1252 }
else if (ParamName ==
"sink-common-insts") {
1254 }
else if (ParamName ==
"speculate-unpredictables") {
1257 APInt BonusInstThreshold;
1260 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1268 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1279 Result.setVerifyFixpoint(
true);
1280 while (!Params.
empty()) {
1282 std::tie(ParamName, Params) = Params.
split(
';');
1285 if (ParamName ==
"verify-fixpoint") {
1288 APInt MaxIterations;
1291 formatv(
"invalid argument to InstCombine pass max-iterations "
1299 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1309 while (!Params.
empty()) {
1311 std::tie(ParamName, Params) = Params.
split(
';');
1314 if (ParamName ==
"interleave-forced-only") {
1316 }
else if (ParamName ==
"vectorize-forced-only") {
1320 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1328 std::pair<bool, bool>
Result = {
false,
true};
1329 while (!Params.
empty()) {
1331 std::tie(ParamName, Params) = Params.
split(
';');
1334 if (ParamName ==
"nontrivial") {
1336 }
else if (ParamName ==
"trivial") {
1340 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1349 while (!Params.
empty()) {
1351 std::tie(ParamName, Params) = Params.
split(
';');
1354 if (ParamName ==
"allowspeculation") {
1358 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1365struct LoopRotateOptions {
1366 bool EnableHeaderDuplication =
true;
1367 bool PrepareForLTO =
false;
1368 bool CheckExitCount =
false;
1372 LoopRotateOptions
Result;
1373 while (!Params.
empty()) {
1375 std::tie(ParamName, Params) = Params.
split(
';');
1378 if (ParamName ==
"header-duplication") {
1380 }
else if (ParamName ==
"prepare-for-lto") {
1382 }
else if (ParamName ==
"check-exit-count") {
1386 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1395 while (!Params.
empty()) {
1397 std::tie(ParamName, Params) = Params.
split(
';');
1400 if (ParamName ==
"split-footer-bb") {
1404 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1415 while (!Params.
empty()) {
1417 std::tie(ParamName, Params) = Params.
split(
';');
1420 if (ParamName ==
"scalar-pre") {
1422 }
else if (ParamName ==
"load-pre") {
1424 }
else if (ParamName ==
"split-backedge-load-pre") {
1426 }
else if (ParamName ==
"memdep") {
1430 }
else if (ParamName ==
"memoryssa") {
1436 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1445 while (!Params.
empty()) {
1447 std::tie(ParamName, Params) = Params.
split(
';');
1450 if (ParamName ==
"func-spec")
1454 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1462 while (!Params.
empty()) {
1464 std::tie(ParamName, Params) = Params.
split(
';');
1469 formatv(
"invalid argument to Scalarizer pass min-bits "
1480 if (ParamName ==
"load-store")
1482 else if (ParamName ==
"variable-insert-extract")
1486 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1496 bool SawCFGOption =
false;
1497 while (!Params.
empty()) {
1499 std::tie(ParamName, Params) = Params.
split(
';');
1501 if (ParamName ==
"modify-cfg") {
1506 SawCFGOption =
true;
1507 }
else if (ParamName ==
"preserve-cfg") {
1512 SawCFGOption =
true;
1513 }
else if (ParamName ==
"aggregate-to-vector") {
1514 Result.AggregateToVector =
true;
1517 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1518 "modify-cfg, or aggregate-to-vector)",
1528parseStackLifetimeOptions(
StringRef Params) {
1530 while (!Params.
empty()) {
1532 std::tie(ParamName, Params) = Params.
split(
';');
1534 if (ParamName ==
"may") {
1536 }
else if (ParamName ==
"must") {
1540 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1549 "DependenceAnalysisPrinter");
1554 "SeparateConstOffsetFromGEP");
1563parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1567 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1575 "MemorySSAPrinterPass");
1580 "SpeculativeExecutionPass");
1585 while (!Params.
empty()) {
1587 std::tie(ParamName, Params) = Params.
split(
';');
1593 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1601parseStructuralHashPrinterPassOptions(
StringRef Params) {
1604 if (Params ==
"detailed")
1606 if (Params ==
"call-target-ignored")
1609 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1615 "WinEHPreparePass");
1620 while (!Params.
empty()) {
1622 std::tie(ParamName, Params) = Params.
split(
';');
1625 if (ParamName ==
"group-by-use")
1627 else if (ParamName ==
"ignore-single-use")
1629 else if (ParamName ==
"merge-const")
1631 else if (ParamName ==
"merge-const-aggressive")
1633 else if (ParamName ==
"merge-external")
1638 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1642 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1651 while (!Params.
empty()) {
1653 std::tie(ParamName, Params) = Params.
split(
';');
1659 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1670 while (!Params.
empty()) {
1672 std::tie(ParamName, Params) = Params.
split(
';');
1675 std::optional<RegAllocFilterFunc>
Filter =
1679 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1688 if (ParamName ==
"no-clear-vregs") {
1694 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1701parseBoundsCheckingOptions(
StringRef Params) {
1703 while (!Params.
empty()) {
1705 std::tie(ParamName, Params) = Params.
split(
';');
1706 if (ParamName ==
"trap") {
1708 }
else if (ParamName ==
"rt") {
1714 }
else if (ParamName ==
"rt-abort") {
1720 }
else if (ParamName ==
"min-rt") {
1726 }
else if (ParamName ==
"min-rt-abort") {
1732 }
else if (ParamName ==
"merge") {
1734 }
else if (ParamName ==
"handler-preserve-all-regs") {
1736 Options.Rt->HandlerPreserveAllRegs =
true;
1740 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1746 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1763 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1765 Param.str().c_str());
1768 if (!
Level.has_value())
1770 "invalid optimization level for expand-ir-insts pass: %s",
1771 Digit.str().c_str());
1778 if (Params.
empty() || Params ==
"all")
1779 return RAGreedyPass::Options();
1783 return RAGreedyPass::Options{*
Filter, Params};
1786 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1792 "MachineSinkingPass");
1796 bool AllowTailMerge =
true;
1797 if (!Params.
empty()) {
1799 if (Params !=
"tail-merge")
1801 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1805 return AllowTailMerge;
1809 bool ClearVirtRegs =
true;
1810 if (!Params.
empty()) {
1812 if (Params !=
"clear-vregs")
1814 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1817 return ClearVirtRegs;
1820struct FatLTOOptions {
1822 bool ThinLTO =
false;
1823 bool EmitSummary =
false;
1828 bool HaveOptLevel =
false;
1829 while (!Params.
empty()) {
1831 std::tie(ParamName, Params) = Params.
split(
';');
1833 if (ParamName ==
"thinlto") {
1835 }
else if (ParamName ==
"emit-summary") {
1836 Result.EmitSummary =
true;
1837 }
else if (std::optional<OptimizationLevel> OptLevel =
1839 Result.OptLevel = *OptLevel;
1840 HaveOptLevel =
true;
1843 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1850 "missing optimization level for fatlto-pre-link pipeline",
1865template <
typename PassManagerT,
typename CallbacksT>
1867 if (!Callbacks.empty()) {
1868 PassManagerT DummyPM;
1869 for (
auto &CB : Callbacks)
1870 if (CB(Name, DummyPM, {}))
1876template <
typename CallbacksT>
1878 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1881 if (Name ==
"module")
1883 if (Name ==
"cgscc")
1885 if (NameNoBracket ==
"function")
1887 if (Name ==
"coro-cond")
1890#define MODULE_PASS(NAME, CREATE_PASS) \
1893#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1894 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1896#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1897 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1899#include "PassRegistry.def"
1904template <
typename CallbacksT>
1907 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1908 if (Name ==
"cgscc")
1910 if (NameNoBracket ==
"function")
1917#define CGSCC_PASS(NAME, CREATE_PASS) \
1920#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1921 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1923#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1924 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1926#include "PassRegistry.def"
1931template <
typename CallbacksT>
1934 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1935 if (NameNoBracket ==
"function")
1937 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1940#define FUNCTION_PASS(NAME, CREATE_PASS) \
1943#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1944 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1946#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1947 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1949#include "PassRegistry.def"
1954template <
typename CallbacksT>
1957 if (Name ==
"machine-function")
1960#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1963#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1965 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1968#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1969 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1972#include "llvm/Passes/MachinePassRegistry.def"
1977template <
typename CallbacksT>
1979 bool &UseMemorySSA) {
1980 UseMemorySSA =
false;
1983 UseMemorySSA =
true;
1987#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1990#include "PassRegistry.def"
1995template <
typename CallbacksT>
1997 bool &UseMemorySSA) {
1998 UseMemorySSA =
false;
2001 UseMemorySSA =
true;
2005#define LOOP_PASS(NAME, CREATE_PASS) \
2008#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2009 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
2011#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2012 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
2014#include "PassRegistry.def"
2019std::optional<std::vector<PassBuilder::PipelineElement>>
2021 std::vector<PipelineElement> ResultPipeline;
2026 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2027 size_t Pos =
Text.find_first_of(
",()");
2028 Pipeline.push_back({
Text.substr(0, Pos), {}});
2031 if (Pos ==
Text.npos)
2034 char Sep =
Text[Pos];
2042 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2046 assert(Sep ==
')' &&
"Bogus separator!");
2051 if (PipelineStack.
size() == 1)
2052 return std::nullopt;
2055 }
while (
Text.consume_front(
")"));
2063 if (!
Text.consume_front(
","))
2064 return std::nullopt;
2067 if (PipelineStack.
size() > 1)
2069 return std::nullopt;
2071 assert(PipelineStack.
back() == &ResultPipeline &&
2072 "Wrong pipeline at the bottom of the stack!");
2073 return {std::move(ResultPipeline)};
2083 const PipelineElement &
E) {
2084 auto &
Name =
E.Name;
2085 auto &InnerPipeline =
E.InnerPipeline;
2088 if (!InnerPipeline.empty()) {
2089 if (Name ==
"module") {
2091 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2093 MPM.
addPass(std::move(NestedMPM));
2096 if (Name ==
"coro-cond") {
2098 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2100 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2103 if (Name ==
"cgscc") {
2105 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2113 "cannot have a no-rerun module to function adaptor",
2116 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2123 for (
auto &
C : ModulePipelineParsingCallbacks)
2124 if (
C(Name, MPM, InnerPipeline))
2129 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2135#define MODULE_PASS(NAME, CREATE_PASS) \
2136 if (Name == NAME) { \
2137 MPM.addPass(CREATE_PASS); \
2138 return Error::success(); \
2140#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2141 if (checkParametrizedPassName(Name, NAME)) { \
2142 auto Params = parsePassParameters(PARSER, Name, NAME); \
2144 return Params.takeError(); \
2145 MPM.addPass(CREATE_PASS(Params.get())); \
2146 return Error::success(); \
2148#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2149 if (Name == "require<" NAME ">") { \
2151 RequireAnalysisPass< \
2152 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2153 return Error::success(); \
2155 if (Name == "invalidate<" NAME ">") { \
2156 MPM.addPass(InvalidateAnalysisPass< \
2157 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2158 return Error::success(); \
2160#define CGSCC_PASS(NAME, CREATE_PASS) \
2161 if (Name == NAME) { \
2162 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2163 return Error::success(); \
2165#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2166 if (checkParametrizedPassName(Name, NAME)) { \
2167 auto Params = parsePassParameters(PARSER, Name, NAME); \
2169 return Params.takeError(); \
2171 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2172 return Error::success(); \
2174#define FUNCTION_PASS(NAME, CREATE_PASS) \
2175 if (Name == NAME) { \
2176 if constexpr (std::is_constructible_v< \
2177 std::remove_reference_t<decltype(CREATE_PASS)>, \
2178 const TargetMachine &>) { \
2180 return make_error<StringError>( \
2181 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2182 inconvertibleErrorCode()); \
2184 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2185 return Error::success(); \
2187#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2188 if (checkParametrizedPassName(Name, NAME)) { \
2189 auto Params = parsePassParameters(PARSER, Name, NAME); \
2191 return Params.takeError(); \
2192 auto CreatePass = CREATE_PASS; \
2193 if constexpr (std::is_constructible_v< \
2194 std::remove_reference_t<decltype(CreatePass( \
2196 const TargetMachine &, \
2197 std::remove_reference_t<decltype(Params.get())>>) { \
2199 return make_error<StringError>( \
2200 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2201 inconvertibleErrorCode()); \
2204 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2205 return Error::success(); \
2207#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2208 if (Name == NAME) { \
2209 MPM.addPass(createModuleToFunctionPassAdaptor( \
2210 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2211 return Error::success(); \
2213#define LOOP_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_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2220 if (checkParametrizedPassName(Name, NAME)) { \
2221 auto Params = parsePassParameters(PARSER, Name, NAME); \
2223 return Params.takeError(); \
2224 MPM.addPass(createModuleToFunctionPassAdaptor( \
2225 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2226 return Error::success(); \
2228#include "PassRegistry.def"
2230 for (
auto &
C : ModulePipelineParsingCallbacks)
2231 if (
C(Name, MPM, InnerPipeline))
2234 formatv(
"unknown module pass '{}'", Name).str(),
2239 const PipelineElement &
E) {
2240 auto &
Name =
E.Name;
2241 auto &InnerPipeline =
E.InnerPipeline;
2244 if (!InnerPipeline.empty()) {
2245 if (Name ==
"cgscc") {
2247 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2250 CGPM.
addPass(std::move(NestedCGPM));
2255 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2259 std::move(FPM), Params->first, Params->second));
2264 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2271 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2272 if (
C(Name, CGPM, InnerPipeline))
2277 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2282#define CGSCC_PASS(NAME, CREATE_PASS) \
2283 if (Name == NAME) { \
2284 CGPM.addPass(CREATE_PASS); \
2285 return Error::success(); \
2287#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2288 if (checkParametrizedPassName(Name, NAME)) { \
2289 auto Params = parsePassParameters(PARSER, Name, NAME); \
2291 return Params.takeError(); \
2292 CGPM.addPass(CREATE_PASS(Params.get())); \
2293 return Error::success(); \
2295#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2296 if (Name == "require<" NAME ">") { \
2297 CGPM.addPass(RequireAnalysisPass< \
2298 std::remove_reference_t<decltype(CREATE_PASS)>, \
2299 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2300 CGSCCUpdateResult &>()); \
2301 return Error::success(); \
2303 if (Name == "invalidate<" NAME ">") { \
2304 CGPM.addPass(InvalidateAnalysisPass< \
2305 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2306 return Error::success(); \
2308#define FUNCTION_PASS(NAME, CREATE_PASS) \
2309 if (Name == NAME) { \
2310 if constexpr (std::is_constructible_v< \
2311 std::remove_reference_t<decltype(CREATE_PASS)>, \
2312 const TargetMachine &>) { \
2314 return make_error<StringError>( \
2315 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2316 inconvertibleErrorCode()); \
2318 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2319 return Error::success(); \
2321#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2322 if (checkParametrizedPassName(Name, NAME)) { \
2323 auto Params = parsePassParameters(PARSER, Name, NAME); \
2325 return Params.takeError(); \
2326 auto CreatePass = CREATE_PASS; \
2327 if constexpr (std::is_constructible_v< \
2328 std::remove_reference_t<decltype(CreatePass( \
2330 const TargetMachine &, \
2331 std::remove_reference_t<decltype(Params.get())>>) { \
2333 return make_error<StringError>( \
2334 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2335 inconvertibleErrorCode()); \
2338 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2339 return Error::success(); \
2341#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2342 if (Name == NAME) { \
2343 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2344 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2345 return Error::success(); \
2347#define LOOP_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_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2354 if (checkParametrizedPassName(Name, NAME)) { \
2355 auto Params = parsePassParameters(PARSER, Name, NAME); \
2357 return Params.takeError(); \
2358 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2359 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2360 return Error::success(); \
2362#include "PassRegistry.def"
2364 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2365 if (
C(Name, CGPM, InnerPipeline))
2372 const PipelineElement &
E) {
2373 auto &
Name =
E.Name;
2374 auto &InnerPipeline =
E.InnerPipeline;
2377 if (!InnerPipeline.empty()) {
2378 if (Name ==
"function") {
2380 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2383 FPM.
addPass(std::move(NestedFPM));
2386 if (Name ==
"loop" || Name ==
"loop-mssa") {
2388 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2391 bool UseMemorySSA = (
Name ==
"loop-mssa");
2396 if (Name ==
"machine-function") {
2398 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2404 for (
auto &
C : FunctionPipelineParsingCallbacks)
2405 if (
C(Name, FPM, InnerPipeline))
2410 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2415#define FUNCTION_PASS(NAME, CREATE_PASS) \
2416 if (Name == NAME) { \
2417 if constexpr (std::is_constructible_v< \
2418 std::remove_reference_t<decltype(CREATE_PASS)>, \
2419 const TargetMachine &>) { \
2421 return make_error<StringError>( \
2422 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2423 inconvertibleErrorCode()); \
2425 FPM.addPass(CREATE_PASS); \
2426 return Error::success(); \
2428#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2429 if (checkParametrizedPassName(Name, NAME)) { \
2430 auto Params = parsePassParameters(PARSER, Name, NAME); \
2432 return Params.takeError(); \
2433 auto CreatePass = CREATE_PASS; \
2434 if constexpr (std::is_constructible_v< \
2435 std::remove_reference_t<decltype(CreatePass( \
2437 const TargetMachine &, \
2438 std::remove_reference_t<decltype(Params.get())>>) { \
2440 return make_error<StringError>( \
2441 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2442 inconvertibleErrorCode()); \
2445 FPM.addPass(CREATE_PASS(Params.get())); \
2446 return Error::success(); \
2448#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2449 if (Name == "require<" NAME ">") { \
2450 if constexpr (std::is_constructible_v< \
2451 std::remove_reference_t<decltype(CREATE_PASS)>, \
2452 const TargetMachine &>) { \
2454 return make_error<StringError>( \
2455 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2456 inconvertibleErrorCode()); \
2459 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2461 return Error::success(); \
2463 if (Name == "invalidate<" NAME ">") { \
2464 FPM.addPass(InvalidateAnalysisPass< \
2465 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2466 return Error::success(); \
2472#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2473 if (Name == NAME) { \
2474 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2475 return Error::success(); \
2477#define LOOP_PASS(NAME, CREATE_PASS) \
2478 if (Name == NAME) { \
2479 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2480 return Error::success(); \
2482#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2483 if (checkParametrizedPassName(Name, NAME)) { \
2484 auto Params = parsePassParameters(PARSER, Name, NAME); \
2486 return Params.takeError(); \
2488 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2489 return Error::success(); \
2491#include "PassRegistry.def"
2493 for (
auto &
C : FunctionPipelineParsingCallbacks)
2494 if (
C(Name, FPM, InnerPipeline))
2497 formatv(
"unknown function pass '{}'", Name).str(),
2502 const PipelineElement &
E) {
2503 StringRef
Name =
E.Name;
2504 auto &InnerPipeline =
E.InnerPipeline;
2507 if (!InnerPipeline.empty()) {
2508 if (Name ==
"loop") {
2510 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2513 LPM.addPass(std::move(NestedLPM));
2517 for (
auto &
C : LoopPipelineParsingCallbacks)
2518 if (
C(Name, LPM, InnerPipeline))
2523 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2528#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2529 if (Name == NAME) { \
2530 LPM.addPass(CREATE_PASS); \
2531 return Error::success(); \
2533#define LOOP_PASS(NAME, CREATE_PASS) \
2534 if (Name == NAME) { \
2535 LPM.addPass(CREATE_PASS); \
2536 return Error::success(); \
2538#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2539 if (checkParametrizedPassName(Name, NAME)) { \
2540 auto Params = parsePassParameters(PARSER, Name, NAME); \
2542 return Params.takeError(); \
2543 LPM.addPass(CREATE_PASS(Params.get())); \
2544 return Error::success(); \
2546#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2547 if (Name == "require<" NAME ">") { \
2548 LPM.addPass(RequireAnalysisPass< \
2549 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2550 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2552 return Error::success(); \
2554 if (Name == "invalidate<" NAME ">") { \
2555 LPM.addPass(InvalidateAnalysisPass< \
2556 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2557 return Error::success(); \
2559#include "PassRegistry.def"
2561 for (
auto &
C : LoopPipelineParsingCallbacks)
2562 if (
C(Name, LPM, InnerPipeline))
2569 const PipelineElement &
E) {
2570 StringRef
Name =
E.Name;
2572 if (!
E.InnerPipeline.empty()) {
2573 if (
E.Name ==
"machine-function") {
2575 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2577 MFPM.
addPass(std::move(NestedPM));
2584#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2585 if (Name == NAME) { \
2586 MFPM.addPass(CREATE_PASS); \
2587 return Error::success(); \
2589#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2590 if (Name == NAME) { \
2591 MFPM.addPass(CREATE_PASS); \
2592 return Error::success(); \
2594#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2596 if (checkParametrizedPassName(Name, NAME)) { \
2597 auto Params = parsePassParameters(PARSER, Name, NAME); \
2599 return Params.takeError(); \
2600 MFPM.addPass(CREATE_PASS(Params.get())); \
2601 return Error::success(); \
2603#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2604 if (Name == "require<" NAME ">") { \
2606 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2607 MachineFunction>()); \
2608 return Error::success(); \
2610 if (Name == "invalidate<" NAME ">") { \
2611 MFPM.addPass(InvalidateAnalysisPass< \
2612 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2613 return Error::success(); \
2615#include "llvm/Passes/MachinePassRegistry.def"
2617 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2618 if (
C(Name, MFPM,
E.InnerPipeline))
2621 formatv(
"unknown machine pass '{}'", Name).str(),
2626#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2627 if (Name == NAME) { \
2628 AA.registerModuleAnalysis< \
2629 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2632#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2633 if (Name == NAME) { \
2634 AA.registerFunctionAnalysis< \
2635 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2638#include "PassRegistry.def"
2640 for (
auto &
C : AAParsingCallbacks)
2646Error PassBuilder::parseMachinePassPipeline(
2648 for (
const auto &Element : Pipeline) {
2649 if (
auto Err = parseMachinePass(MFPM, Element))
2657 for (
const auto &Element : Pipeline) {
2658 if (
auto Err = parseLoopPass(LPM, Element))
2664Error PassBuilder::parseFunctionPassPipeline(
2666 for (
const auto &Element : Pipeline) {
2667 if (
auto Err = parseFunctionPass(FPM, Element))
2675 for (
const auto &Element : Pipeline) {
2676 if (
auto Err = parseCGSCCPass(CGPM, Element))
2708 for (
const auto &Element : Pipeline) {
2709 if (
auto Err = parseModulePass(MPM, Element))
2720 auto Pipeline = parsePipelineText(PipelineText);
2721 if (!Pipeline || Pipeline->empty())
2723 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2733 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2735 FunctionPipelineParsingCallbacks)) {
2736 Pipeline = {{
"function", std::move(*Pipeline)}};
2739 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2740 std::move(*Pipeline)}}}};
2741 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2743 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2744 std::move(*Pipeline)}}}};
2746 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2747 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2749 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2750 if (
C(MPM, *Pipeline))
2754 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2756 formatv(
"unknown {} name '{}'",
2757 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2763 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2771 auto Pipeline = parsePipelineText(PipelineText);
2772 if (!Pipeline || Pipeline->empty())
2774 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2780 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2785 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2794 auto Pipeline = parsePipelineText(PipelineText);
2795 if (!Pipeline || Pipeline->empty())
2797 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2803 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2808 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2816 auto Pipeline = parsePipelineText(PipelineText);
2817 if (!Pipeline || Pipeline->empty())
2819 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2822 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2830 auto Pipeline = parsePipelineText(PipelineText);
2831 if (!Pipeline || Pipeline->empty())
2833 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2836 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2845 if (PipelineText ==
"default") {
2850 while (!PipelineText.
empty()) {
2852 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2853 if (!parseAAPassName(
AA, Name))
2855 formatv(
"unknown alias analysis name '{}'", Name).str(),
2862std::optional<RegAllocFilterFunc>
2864 if (FilterName ==
"all")
2866 for (
auto &
C : RegClassFilterParsingCallbacks)
2867 if (
auto F =
C(FilterName))
2869 return std::nullopt;
2880 auto I = PassNames.
begin();
2881 auto End = PassNames.
end();
2888 OS <<
" " << Name <<
'<' << Params <<
">\n";
2895 OS <<
"Module passes:\n";
2896 static constexpr char ModulePassNames[] = {
"\0"
2897#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2898#include "PassRegistry.def"
2902 OS <<
"Module passes with params:\n";
2903 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2904#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2905 NAME "\0" PARAMS "\0"
2906#include "PassRegistry.def"
2910 OS <<
"Module analyses:\n";
2911 static constexpr char ModuleAnalysisNames[] = {
"\0"
2912#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2913#include "PassRegistry.def"
2917 OS <<
"Module alias analyses:\n";
2918 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2919#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2920#include "PassRegistry.def"
2924 OS <<
"CGSCC passes:\n";
2925 static constexpr char CGSCCPassNames[] = {
"\0"
2926#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2927#include "PassRegistry.def"
2931 OS <<
"CGSCC passes with params:\n";
2932 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2933#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2934 NAME "\0" PARAMS "\0"
2935#include "PassRegistry.def"
2939 OS <<
"CGSCC analyses:\n";
2940 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2941#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2942#include "PassRegistry.def"
2946 OS <<
"Function passes:\n";
2947 static constexpr char FunctionPassNames[] = {
"\0"
2948#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2949#include "PassRegistry.def"
2953 OS <<
"Function passes with params:\n";
2954 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2955#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2956 NAME "\0" PARAMS "\0"
2957#include "PassRegistry.def"
2961 OS <<
"Function analyses:\n";
2962 static constexpr char FunctionAnalysisNames[] = {
"\0"
2963#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2964#include "PassRegistry.def"
2968 OS <<
"Function alias analyses:\n";
2969 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2970#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2971#include "PassRegistry.def"
2975 OS <<
"LoopNest passes:\n";
2976 static constexpr char LoopNestPassNames[] = {
"\0"
2977#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2978#include "PassRegistry.def"
2982 OS <<
"Loop passes:\n";
2983 static constexpr char LoopPassNames[] = {
"\0"
2984#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2985#include "PassRegistry.def"
2989 OS <<
"Loop passes with params:\n";
2990 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2991#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2992 NAME "\0" PARAMS "\0"
2993#include "PassRegistry.def"
2997 OS <<
"Loop analyses:\n";
2998 static constexpr char LoopAnalysisNames[] = {
"\0"
2999#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3000#include "PassRegistry.def"
3004 OS <<
"Machine module passes (WIP):\n";
3005 static constexpr char MachineModulePassNames[] = {
"\0"
3006#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
3007#include "llvm/Passes/MachinePassRegistry.def"
3011 OS <<
"Machine function passes (WIP):\n";
3012 static constexpr char MachineFunctionPassNames[] = {
"\0"
3013#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3014#include "llvm/Passes/MachinePassRegistry.def"
3018 OS <<
"Machine function analyses (WIP):\n";
3019 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3020#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3021#include "llvm/Passes/MachinePassRegistry.def"
3029 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.
DXILDebugInfoMap run(Module &M)
DropTestKind
Specifies how to drop type tests.
@ All
Drop only llvm.assumes using type test value.
This is an optimization pass for GlobalISel generic memory operations.
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI cl::opt< std::optional< PrintPipelinePassesFormat >, false, PrintPipelinePassesFormatParser > PrintPipelinePasses
Common option used by multiple tools to print pipeline passes.
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
DevirtSCCRepeatedPass createDevirtSCCRepeatedPass(CGSCCPassT &&Pass, int MaxIterations)
A function to deduce a function pass type and wrap it in the templated adaptor.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
@ O1
Optimize quickly without destroying debuggability.
@ O0
Disable as many optimizations as possible.
@ O3
Optimize for fast execution as much as possible.
@ O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
InnerAnalysisManagerProxy< LoopAnalysisManager, Function > LoopAnalysisManagerFunctionProxy
A proxy from a LoopAnalysisManager to a Function.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager
The Loop pass manager.
ModuleToPostOrderCGSCCPassAdaptor createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
FunctionToLoopPassAdaptor createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
FunctionToMachineFunctionPassAdaptor createFunctionToMachineFunctionPassAdaptor(MachineFunctionPassT &&Pass)
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Function > MachineFunctionAnalysisManagerFunctionProxy
OuterAnalysisManagerProxy< FunctionAnalysisManager, Loop, LoopStandardAnalysisResults & > FunctionAnalysisManagerLoopProxy
A proxy from a FunctionAnalysisManager to a Loop.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
support::detail::RepeatAdapter< T > fmt_repeat(T &&Item, size_t Count)
OuterAnalysisManagerProxy< ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph & > ModuleAnalysisManagerCGSCCProxy
A proxy from a ModuleAnalysisManager to an SCC.
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Module > MachineFunctionAnalysisManagerModuleProxy
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
InnerAnalysisManagerProxy< CGSCCAnalysisManager, Module > CGSCCAnalysisManagerModuleProxy
A proxy from a CGSCCAnalysisManager to a Module.
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
MFPropsModifier(PassT &P, MachineFunction &MF) -> MFPropsModifier< PassT >
LLVM_ABI void printFormattedPipelinePasses(raw_ostream &OS, StringRef Pipeline, PrintPipelinePassesFormat Format=PrintPipelinePassesFormat::Text)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
PassManager< MachineFunction > MachineFunctionPassManager
Convenience typedef for a pass manager over functions.
LLVM_ABI bool applyDebugifyMetadataToMachineFunction(DIBuilder &DIB, Function &F, llvm::function_ref< MachineFunction *(Function &)> GetMF)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
LLVM_ABI std::optional< AllocTokenMode > getAllocTokenModeFromString(StringRef Name)
Returns the AllocTokenMode from its canonical string name; if an invalid name was provided returns nu...
PrintPipelinePassesFormat
@ Detailed
Hash with opcode only.
@ CallTargetIgnored
Hash with opcode and operands.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
Implement std::hash so that hash_code can be used in STL containers.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A set of parameters to control various transforms performed by GVN pass.
HardwareLoopOptions & setForceNested(bool Force)
HardwareLoopOptions & setDecrement(unsigned Count)
HardwareLoopOptions & setForceGuard(bool Force)
HardwareLoopOptions & setForce(bool Force)
HardwareLoopOptions & setCounterBitwidth(unsigned Width)
HardwareLoopOptions & setForcePhi(bool Force)
A set of parameters to control various transforms performed by IPSCCP pass.
A set of parameters used to control various transforms performed by the LoopUnroll pass.
LoopUnrollOptions & setPeeling(bool Peeling)
Enables or disables loop peeling.
LoopUnrollOptions & setOptLevel(int O)
LoopUnrollOptions & setPartial(bool Partial)
Enables or disables partial unrolling.
LoopUnrollOptions & setFullUnrollMaxCount(unsigned O)
LoopUnrollOptions & setPrepareForLTO(bool V)
LoopUnrollOptions & setUpperBound(bool UpperBound)
Enables or disables the use of trip count upper bound in loop unrolling.
LoopUnrollOptions & setRuntime(bool Runtime)
Enables or disables unrolling of loops with runtime trip count.
LoopUnrollOptions & setProfileBasedPeeling(int O)
LoopVectorizeOptions & setVectorizeOnlyWhenForced(bool Value)
LoopVectorizeOptions & setInterleaveOnlyWhenForced(bool Value)
A CRTP mix-in for passes that can be skipped.
RegAllocFilterFunc Filter