429std::optional<PrintPipelinePassesFormat>
431 return Opts.print_pipeline_passes;
442 for (
char C : Pipeline) {
450 assert(IndentLevel >= 0 &&
"Invalid pipeline string!");
480 return MFA ? &MFA->
getMF() :
nullptr;
486class TriggerVerifierErrorPass
492 auto *PtrTy = PointerType::getUnqual(
M.getContext());
494 GlobalValue::LinkageTypes::InternalLinkage,
495 "__bad_alias",
nullptr, &M);
515 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
520class RequireAllMachineFunctionPropertiesPass
528 static MachineFunctionProperties getRequiredProperties() {
529 return MachineFunctionProperties()
531 .setFailsVerification()
536 .setRegBankSelected()
538 .setTiedOpsRewritten()
539 .setTracksDebugUserValues()
540 .setTracksLiveness();
542 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
548 if (S ==
"Os" || S ==
"Oz")
550 Twine(
"The optimization level \"") + S +
551 "\" is no longer supported. Use O2 in conjunction with the " +
552 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
563 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
567 formatv(
"invalid optimization level '{}'", S).str(),
572 std::optional<PipelineTuningOptions> PTO,
573 std::optional<PGOOptions> PGOOpt,
578 PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
580 TM->registerPassBuilderCallbacks(*
this);
582 PIC->registerClassToPassNameCallback([
this, PIC]() {
586#define MODULE_PASS(NAME, CREATE_PASS) \
587 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
588#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
589 PIC->addClassToPassName(CLASS, NAME);
590#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
591 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
592#define FUNCTION_PASS(NAME, CREATE_PASS) \
593 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
594#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
595 PIC->addClassToPassName(CLASS, NAME);
596#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
597 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
598#define LOOPNEST_PASS(NAME, CREATE_PASS) \
599 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
600#define LOOP_PASS(NAME, CREATE_PASS) \
601 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
602#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
603 PIC->addClassToPassName(CLASS, NAME);
604#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
605 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
606#define CGSCC_PASS(NAME, CREATE_PASS) \
607 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
608#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
609 PIC->addClassToPassName(CLASS, NAME);
610#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
611 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
612#include "PassRegistry.def"
614#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
615 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
616#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
617 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
618#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
620 PIC->addClassToPassName(CLASS, NAME);
621#include "llvm/Passes/MachinePassRegistry.def"
629#define MODULE_CALLBACK(NAME, INVOKE) \
630 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
631 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
633 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
636 INVOKE(PM, L.get()); \
639#include "PassRegistry.def"
647#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
648 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
649 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
651 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
654 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
657#include "PassRegistry.def"
665#define FUNCTION_CALLBACK(NAME, INVOKE) \
666 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
667 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
669 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
672 INVOKE(PM, L.get()); \
675#include "PassRegistry.def"
683#define CGSCC_CALLBACK(NAME, INVOKE) \
684 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
685 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
687 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
690 INVOKE(PM, L.get()); \
693#include "PassRegistry.def"
701#define LOOP_CALLBACK(NAME, INVOKE) \
702 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
703 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
705 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
708 INVOKE(PM, L.get()); \
711#include "PassRegistry.def"
717#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
718 MAM.registerPass([&] { return CREATE_PASS; });
719#include "PassRegistry.def"
721 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
726#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
727 CGAM.registerPass([&] { return CREATE_PASS; });
728#include "PassRegistry.def"
730 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
740#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
741 if constexpr (std::is_constructible_v< \
742 std::remove_reference_t<decltype(CREATE_PASS)>, \
743 const TargetMachine &>) { \
745 FAM.registerPass([&] { return CREATE_PASS; }); \
747 FAM.registerPass([&] { return CREATE_PASS; }); \
749#include "PassRegistry.def"
751 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
758#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
759 MFAM.registerPass([&] { return CREATE_PASS; });
760#include "llvm/Passes/MachinePassRegistry.def"
762 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
767#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
768 LAM.registerPass([&] { return CREATE_PASS; });
769#include "PassRegistry.def"
771 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
775static std::optional<std::pair<bool, bool>>
777 std::pair<bool, bool> Params;
778 if (!Name.consume_front(
"function"))
782 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
784 while (!Name.empty()) {
785 auto [Front, Back] = Name.split(
';');
787 if (Front ==
"eager-inv")
789 else if (Front ==
"no-rerun")
790 Params.second =
true;
798 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
810 while (!Params.
empty()) {
812 std::tie(ParamName, Params) = Params.
split(
';');
814 if (ParamName == OptionName) {
831 while (!Params.
empty()) {
833 std::tie(ParamName, Params) = Params.
split(
';');
838 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
843 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
847 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
852 if (ParamName ==
"force-hardware-loops") {
854 }
else if (ParamName ==
"force-hardware-loop-phi") {
856 }
else if (ParamName ==
"force-nested-hardware-loop") {
858 }
else if (ParamName ==
"force-hardware-loop-guard") {
862 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
866 return HardwareLoopOpts;
878 "FunctionPropertiesStatisticsPass");
888 Params,
"assume-default-is-flat-addrspace",
"InferAddressSpacesPass");
894 while (!Params.
empty()) {
896 std::tie(ParamName, Params) = Params.
split(
';');
897 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
899 UnrollOpts.
setOptLevel(
static_cast<int>(*OptLevel));
906 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
913 if (ParamName ==
"partial") {
915 }
else if (ParamName ==
"peeling") {
917 }
else if (ParamName ==
"profile-peeling") {
919 }
else if (ParamName ==
"runtime") {
921 }
else if (ParamName ==
"upperbound") {
923 }
else if (ParamName ==
"prepare-for-lto") {
927 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
936 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
956 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
965 "EntryExitInstrumenter");
970 "DropUnnecessaryAssumes");
975 "LowerMatrixIntrinsics");
980 while (!Params.
empty()) {
982 std::tie(ParamName, Params) = Params.
split(
';');
985 if (ParamName ==
"preserve-order")
987 else if (ParamName ==
"rename-all")
989 else if (ParamName ==
"fold-all")
991 else if (ParamName ==
"reorder-operands")
995 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
1005 while (!Params.
empty()) {
1007 std::tie(ParamName, Params) = Params.
split(
';');
1009 if (ParamName ==
"kernel") {
1010 Result.CompileKernel =
true;
1011 }
else if (ParamName ==
"use-after-scope") {
1012 Result.UseAfterScope =
true;
1015 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
1025 while (!Params.
empty()) {
1027 std::tie(ParamName, Params) = Params.
split(
';');
1029 if (ParamName ==
"recover") {
1031 }
else if (ParamName ==
"kernel") {
1032 Result.CompileKernel =
true;
1035 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1044parseDropTypeTestsPassOptions(
StringRef Params) {
1046 while (!Params.
empty()) {
1048 std::tie(ParamName, Params) = Params.
split(
';');
1050 if (ParamName ==
"all") {
1052 }
else if (ParamName ==
"assume") {
1056 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1065 while (!Params.
empty()) {
1067 std::tie(ParamName, Params) = Params.
split(
';');
1069 if (ParamName ==
"thinlto") {
1071 }
else if (ParamName ==
"emit-summary") {
1072 Result.EmitLTOSummary =
true;
1075 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1083parseLowerAllowCheckPassOptions(
StringRef Params) {
1085 while (!Params.
empty()) {
1087 std::tie(ParamName, Params) = Params.
split(
';');
1098 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1105 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1110 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1112 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1113 IndicesStr, CutoffStr)
1117 while (IndicesStr !=
"") {
1119 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1125 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1126 firstIndexStr, IndicesStr)
1133 if (index >=
Result.cutoffs.size())
1134 Result.cutoffs.resize(index + 1, 0);
1136 Result.cutoffs[index] = cutoff;
1138 }
else if (ParamName.
starts_with(
"runtime_check")) {
1140 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1144 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1146 ValueString, Params)
1150 Result.runtime_check = runtime_check;
1153 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1164 while (!Params.
empty()) {
1166 std::tie(ParamName, Params) = Params.
split(
';');
1168 if (ParamName ==
"recover") {
1170 }
else if (ParamName ==
"kernel") {
1175 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1180 }
else if (ParamName ==
"eager-checks") {
1181 Result.EagerChecks =
true;
1184 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1194 while (!Params.
empty()) {
1196 std::tie(ParamName, Params) = Params.
split(
';');
1203 formatv(
"invalid argument to AllocToken pass mode "
1210 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1220 while (!Params.
empty()) {
1222 std::tie(ParamName, Params) = Params.
split(
';');
1225 if (ParamName ==
"speculate-blocks") {
1227 }
else if (ParamName ==
"simplify-cond-branch") {
1229 }
else if (ParamName ==
"forward-switch-cond") {
1231 }
else if (ParamName ==
"switch-range-to-icmp") {
1233 }
else if (ParamName ==
"switch-to-arithmetic") {
1235 }
else if (ParamName ==
"switch-to-lookup") {
1237 }
else if (ParamName ==
"keep-loops") {
1239 }
else if (ParamName ==
"hoist-common-insts") {
1241 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1243 }
else if (ParamName ==
"sink-common-insts") {
1245 }
else if (ParamName ==
"speculate-unpredictables") {
1248 APInt BonusInstThreshold;
1251 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1259 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1270 Result.setVerifyFixpoint(
true);
1271 while (!Params.
empty()) {
1273 std::tie(ParamName, Params) = Params.
split(
';');
1276 if (ParamName ==
"verify-fixpoint") {
1279 APInt MaxIterations;
1282 formatv(
"invalid argument to InstCombine pass max-iterations "
1290 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1300 while (!Params.
empty()) {
1302 std::tie(ParamName, Params) = Params.
split(
';');
1305 if (ParamName ==
"interleave-forced-only") {
1307 }
else if (ParamName ==
"vectorize-forced-only") {
1311 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1319 std::pair<bool, bool>
Result = {
false,
true};
1320 while (!Params.
empty()) {
1322 std::tie(ParamName, Params) = Params.
split(
';');
1325 if (ParamName ==
"nontrivial") {
1327 }
else if (ParamName ==
"trivial") {
1331 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1340 while (!Params.
empty()) {
1342 std::tie(ParamName, Params) = Params.
split(
';');
1345 if (ParamName ==
"allowspeculation") {
1349 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1356struct LoopRotateOptions {
1357 bool EnableHeaderDuplication =
true;
1358 bool PrepareForLTO =
false;
1359 bool CheckExitCount =
false;
1363 LoopRotateOptions
Result;
1364 while (!Params.
empty()) {
1366 std::tie(ParamName, Params) = Params.
split(
';');
1369 if (ParamName ==
"header-duplication") {
1371 }
else if (ParamName ==
"prepare-for-lto") {
1373 }
else if (ParamName ==
"check-exit-count") {
1377 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1386 while (!Params.
empty()) {
1388 std::tie(ParamName, Params) = Params.
split(
';');
1391 if (ParamName ==
"split-footer-bb") {
1395 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1406 while (!Params.
empty()) {
1408 std::tie(ParamName, Params) = Params.
split(
';');
1411 if (ParamName ==
"scalar-pre") {
1413 }
else if (ParamName ==
"load-pre") {
1415 }
else if (ParamName ==
"split-backedge-load-pre") {
1417 }
else if (ParamName ==
"memdep") {
1421 }
else if (ParamName ==
"memoryssa") {
1427 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1436 while (!Params.
empty()) {
1438 std::tie(ParamName, Params) = Params.
split(
';');
1441 if (ParamName ==
"func-spec")
1445 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1453 while (!Params.
empty()) {
1455 std::tie(ParamName, Params) = Params.
split(
';');
1460 formatv(
"invalid argument to Scalarizer pass min-bits "
1471 if (ParamName ==
"load-store")
1473 else if (ParamName ==
"variable-insert-extract")
1477 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1487 bool SawCFGOption =
false;
1488 while (!Params.
empty()) {
1490 std::tie(ParamName, Params) = Params.
split(
';');
1492 if (ParamName ==
"modify-cfg") {
1497 SawCFGOption =
true;
1498 }
else if (ParamName ==
"preserve-cfg") {
1503 SawCFGOption =
true;
1504 }
else if (ParamName ==
"aggregate-to-vector") {
1505 Result.AggregateToVector =
true;
1508 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1509 "modify-cfg, or aggregate-to-vector)",
1519parseStackLifetimeOptions(
StringRef Params) {
1521 while (!Params.
empty()) {
1523 std::tie(ParamName, Params) = Params.
split(
';');
1525 if (ParamName ==
"may") {
1527 }
else if (ParamName ==
"must") {
1531 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1540 "DependenceAnalysisPrinter");
1545 "SeparateConstOffsetFromGEP");
1554parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1558 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1566 "MemorySSAPrinterPass");
1571 "SpeculativeExecutionPass");
1576 while (!Params.
empty()) {
1578 std::tie(ParamName, Params) = Params.
split(
';');
1584 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1592parseStructuralHashPrinterPassOptions(
StringRef Params) {
1595 if (Params ==
"detailed")
1597 if (Params ==
"call-target-ignored")
1600 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1606 while (!Params.
empty()) {
1608 std::tie(ParamName, Params) = Params.
split(
';');
1611 if (ParamName ==
"group-by-use")
1613 else if (ParamName ==
"ignore-single-use")
1615 else if (ParamName ==
"merge-const")
1617 else if (ParamName ==
"merge-const-aggressive")
1619 else if (ParamName ==
"merge-external")
1624 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1628 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1637 while (!Params.
empty()) {
1639 std::tie(ParamName, Params) = Params.
split(
';');
1645 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1656 while (!Params.
empty()) {
1658 std::tie(ParamName, Params) = Params.
split(
';');
1661 std::optional<RegAllocFilterFunc>
Filter =
1665 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1674 if (ParamName ==
"no-clear-vregs") {
1680 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1687parseBoundsCheckingOptions(
StringRef Params) {
1689 while (!Params.
empty()) {
1691 std::tie(ParamName, Params) = Params.
split(
';');
1692 if (ParamName ==
"trap") {
1694 }
else if (ParamName ==
"rt") {
1700 }
else if (ParamName ==
"rt-abort") {
1706 }
else if (ParamName ==
"min-rt") {
1712 }
else if (ParamName ==
"min-rt-abort") {
1718 }
else if (ParamName ==
"merge") {
1720 }
else if (ParamName ==
"handler-preserve-all-regs") {
1722 Options.Rt->HandlerPreserveAllRegs =
true;
1726 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1732 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1749 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1751 Param.str().c_str());
1754 if (!
Level.has_value())
1756 "invalid optimization level for expand-ir-insts pass: %s",
1757 Digit.str().c_str());
1764 if (Params.
empty() || Params ==
"all")
1765 return RAGreedyPass::Options();
1769 return RAGreedyPass::Options{*
Filter, Params};
1772 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1778 "MachineSinkingPass");
1782 bool AllowTailMerge =
true;
1783 if (!Params.
empty()) {
1785 if (Params !=
"tail-merge")
1787 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1791 return AllowTailMerge;
1795 bool ClearVirtRegs =
true;
1796 if (!Params.
empty()) {
1798 if (Params !=
"clear-vregs")
1800 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1803 return ClearVirtRegs;
1806struct FatLTOOptions {
1808 bool ThinLTO =
false;
1809 bool EmitSummary =
false;
1814 bool HaveOptLevel =
false;
1815 while (!Params.
empty()) {
1817 std::tie(ParamName, Params) = Params.
split(
';');
1819 if (ParamName ==
"thinlto") {
1821 }
else if (ParamName ==
"emit-summary") {
1822 Result.EmitSummary =
true;
1823 }
else if (std::optional<OptimizationLevel> OptLevel =
1825 Result.OptLevel = *OptLevel;
1826 HaveOptLevel =
true;
1829 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1836 "missing optimization level for fatlto-pre-link pipeline",
1851template <
typename PassManagerT,
typename CallbacksT>
1853 if (!Callbacks.empty()) {
1854 PassManagerT DummyPM;
1855 for (
auto &CB : Callbacks)
1856 if (CB(Name, DummyPM, {}))
1862template <
typename CallbacksT>
1864 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1867 if (Name ==
"module")
1869 if (Name ==
"cgscc")
1871 if (NameNoBracket ==
"function")
1873 if (Name ==
"coro-cond")
1876#define MODULE_PASS(NAME, CREATE_PASS) \
1879#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1880 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1882#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1883 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1885#include "PassRegistry.def"
1890template <
typename CallbacksT>
1893 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1894 if (Name ==
"cgscc")
1896 if (NameNoBracket ==
"function")
1903#define CGSCC_PASS(NAME, CREATE_PASS) \
1906#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1907 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1909#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1910 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1912#include "PassRegistry.def"
1917template <
typename CallbacksT>
1920 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1921 if (NameNoBracket ==
"function")
1923 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1926#define FUNCTION_PASS(NAME, CREATE_PASS) \
1929#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1930 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1932#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1933 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1935#include "PassRegistry.def"
1940template <
typename CallbacksT>
1943 if (Name ==
"machine-function")
1946#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1949#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1951 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1954#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1955 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1958#include "llvm/Passes/MachinePassRegistry.def"
1963template <
typename CallbacksT>
1965 bool &UseMemorySSA) {
1966 UseMemorySSA =
false;
1969 UseMemorySSA =
true;
1973#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1976#include "PassRegistry.def"
1981template <
typename CallbacksT>
1983 bool &UseMemorySSA) {
1984 UseMemorySSA =
false;
1987 UseMemorySSA =
true;
1991#define LOOP_PASS(NAME, CREATE_PASS) \
1994#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1995 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1997#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1998 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
2000#include "PassRegistry.def"
2005std::optional<std::vector<PassBuilder::PipelineElement>>
2007 std::vector<PipelineElement> ResultPipeline;
2012 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
2013 size_t Pos =
Text.find_first_of(
",()");
2014 Pipeline.push_back({
Text.substr(0, Pos), {}});
2017 if (Pos ==
Text.npos)
2020 char Sep =
Text[Pos];
2028 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
2032 assert(Sep ==
')' &&
"Bogus separator!");
2037 if (PipelineStack.
size() == 1)
2038 return std::nullopt;
2041 }
while (
Text.consume_front(
")"));
2049 if (!
Text.consume_front(
","))
2050 return std::nullopt;
2053 if (PipelineStack.
size() > 1)
2055 return std::nullopt;
2057 assert(PipelineStack.
back() == &ResultPipeline &&
2058 "Wrong pipeline at the bottom of the stack!");
2059 return {std::move(ResultPipeline)};
2069 const PipelineElement &
E) {
2070 auto &
Name =
E.Name;
2071 auto &InnerPipeline =
E.InnerPipeline;
2074 if (!InnerPipeline.empty()) {
2075 if (Name ==
"module") {
2077 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2079 MPM.
addPass(std::move(NestedMPM));
2082 if (Name ==
"coro-cond") {
2084 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2086 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2089 if (Name ==
"cgscc") {
2091 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2099 "cannot have a no-rerun module to function adaptor",
2102 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2109 for (
auto &
C : ModulePipelineParsingCallbacks)
2110 if (
C(Name, MPM, InnerPipeline))
2115 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2121#define MODULE_PASS(NAME, CREATE_PASS) \
2122 if (Name == NAME) { \
2123 MPM.addPass(CREATE_PASS); \
2124 return Error::success(); \
2126#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2127 if (checkParametrizedPassName(Name, NAME)) { \
2128 auto Params = parsePassParameters(PARSER, Name, NAME); \
2130 return Params.takeError(); \
2131 MPM.addPass(CREATE_PASS(Params.get())); \
2132 return Error::success(); \
2134#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2135 if (Name == "require<" NAME ">") { \
2137 RequireAnalysisPass< \
2138 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2139 return Error::success(); \
2141 if (Name == "invalidate<" NAME ">") { \
2142 MPM.addPass(InvalidateAnalysisPass< \
2143 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2144 return Error::success(); \
2146#define CGSCC_PASS(NAME, CREATE_PASS) \
2147 if (Name == NAME) { \
2148 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2149 return Error::success(); \
2151#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2152 if (checkParametrizedPassName(Name, NAME)) { \
2153 auto Params = parsePassParameters(PARSER, Name, NAME); \
2155 return Params.takeError(); \
2157 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2158 return Error::success(); \
2160#define FUNCTION_PASS(NAME, CREATE_PASS) \
2161 if (Name == NAME) { \
2162 if constexpr (std::is_constructible_v< \
2163 std::remove_reference_t<decltype(CREATE_PASS)>, \
2164 const TargetMachine &>) { \
2166 return make_error<StringError>( \
2167 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2168 inconvertibleErrorCode()); \
2170 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2171 return Error::success(); \
2173#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2174 if (checkParametrizedPassName(Name, NAME)) { \
2175 auto Params = parsePassParameters(PARSER, Name, NAME); \
2177 return Params.takeError(); \
2178 auto CreatePass = CREATE_PASS; \
2179 if constexpr (std::is_constructible_v< \
2180 std::remove_reference_t<decltype(CreatePass( \
2182 const TargetMachine &, \
2183 std::remove_reference_t<decltype(Params.get())>>) { \
2185 return make_error<StringError>( \
2186 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2187 inconvertibleErrorCode()); \
2190 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2191 return Error::success(); \
2193#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2194 if (Name == NAME) { \
2195 MPM.addPass(createModuleToFunctionPassAdaptor( \
2196 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2197 return Error::success(); \
2199#define LOOP_PASS(NAME, CREATE_PASS) \
2200 if (Name == NAME) { \
2201 MPM.addPass(createModuleToFunctionPassAdaptor( \
2202 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2203 return Error::success(); \
2205#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2206 if (checkParametrizedPassName(Name, NAME)) { \
2207 auto Params = parsePassParameters(PARSER, Name, NAME); \
2209 return Params.takeError(); \
2210 MPM.addPass(createModuleToFunctionPassAdaptor( \
2211 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2212 return Error::success(); \
2214#include "PassRegistry.def"
2216 for (
auto &
C : ModulePipelineParsingCallbacks)
2217 if (
C(Name, MPM, InnerPipeline))
2220 formatv(
"unknown module pass '{}'", Name).str(),
2225 const PipelineElement &
E) {
2226 auto &
Name =
E.Name;
2227 auto &InnerPipeline =
E.InnerPipeline;
2230 if (!InnerPipeline.empty()) {
2231 if (Name ==
"cgscc") {
2233 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2236 CGPM.
addPass(std::move(NestedCGPM));
2241 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2245 std::move(FPM), Params->first, Params->second));
2250 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2257 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2258 if (
C(Name, CGPM, InnerPipeline))
2263 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2268#define CGSCC_PASS(NAME, CREATE_PASS) \
2269 if (Name == NAME) { \
2270 CGPM.addPass(CREATE_PASS); \
2271 return Error::success(); \
2273#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2274 if (checkParametrizedPassName(Name, NAME)) { \
2275 auto Params = parsePassParameters(PARSER, Name, NAME); \
2277 return Params.takeError(); \
2278 CGPM.addPass(CREATE_PASS(Params.get())); \
2279 return Error::success(); \
2281#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2282 if (Name == "require<" NAME ">") { \
2283 CGPM.addPass(RequireAnalysisPass< \
2284 std::remove_reference_t<decltype(CREATE_PASS)>, \
2285 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2286 CGSCCUpdateResult &>()); \
2287 return Error::success(); \
2289 if (Name == "invalidate<" NAME ">") { \
2290 CGPM.addPass(InvalidateAnalysisPass< \
2291 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2292 return Error::success(); \
2294#define FUNCTION_PASS(NAME, CREATE_PASS) \
2295 if (Name == NAME) { \
2296 if constexpr (std::is_constructible_v< \
2297 std::remove_reference_t<decltype(CREATE_PASS)>, \
2298 const TargetMachine &>) { \
2300 return make_error<StringError>( \
2301 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2302 inconvertibleErrorCode()); \
2304 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2305 return Error::success(); \
2307#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2308 if (checkParametrizedPassName(Name, NAME)) { \
2309 auto Params = parsePassParameters(PARSER, Name, NAME); \
2311 return Params.takeError(); \
2312 auto CreatePass = CREATE_PASS; \
2313 if constexpr (std::is_constructible_v< \
2314 std::remove_reference_t<decltype(CreatePass( \
2316 const TargetMachine &, \
2317 std::remove_reference_t<decltype(Params.get())>>) { \
2319 return make_error<StringError>( \
2320 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2321 inconvertibleErrorCode()); \
2324 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2325 return Error::success(); \
2327#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2328 if (Name == NAME) { \
2329 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2330 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2331 return Error::success(); \
2333#define LOOP_PASS(NAME, CREATE_PASS) \
2334 if (Name == NAME) { \
2335 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2336 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2337 return Error::success(); \
2339#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2340 if (checkParametrizedPassName(Name, NAME)) { \
2341 auto Params = parsePassParameters(PARSER, Name, NAME); \
2343 return Params.takeError(); \
2344 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2345 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2346 return Error::success(); \
2348#include "PassRegistry.def"
2350 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2351 if (
C(Name, CGPM, InnerPipeline))
2358 const PipelineElement &
E) {
2359 auto &
Name =
E.Name;
2360 auto &InnerPipeline =
E.InnerPipeline;
2363 if (!InnerPipeline.empty()) {
2364 if (Name ==
"function") {
2366 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2369 FPM.
addPass(std::move(NestedFPM));
2372 if (Name ==
"loop" || Name ==
"loop-mssa") {
2374 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2377 bool UseMemorySSA = (
Name ==
"loop-mssa");
2382 if (Name ==
"machine-function") {
2384 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2390 for (
auto &
C : FunctionPipelineParsingCallbacks)
2391 if (
C(Name, FPM, InnerPipeline))
2396 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2401#define FUNCTION_PASS(NAME, CREATE_PASS) \
2402 if (Name == NAME) { \
2403 if constexpr (std::is_constructible_v< \
2404 std::remove_reference_t<decltype(CREATE_PASS)>, \
2405 const TargetMachine &>) { \
2407 return make_error<StringError>( \
2408 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2409 inconvertibleErrorCode()); \
2411 FPM.addPass(CREATE_PASS); \
2412 return Error::success(); \
2414#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2415 if (checkParametrizedPassName(Name, NAME)) { \
2416 auto Params = parsePassParameters(PARSER, Name, NAME); \
2418 return Params.takeError(); \
2419 auto CreatePass = CREATE_PASS; \
2420 if constexpr (std::is_constructible_v< \
2421 std::remove_reference_t<decltype(CreatePass( \
2423 const TargetMachine &, \
2424 std::remove_reference_t<decltype(Params.get())>>) { \
2426 return make_error<StringError>( \
2427 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2428 inconvertibleErrorCode()); \
2431 FPM.addPass(CREATE_PASS(Params.get())); \
2432 return Error::success(); \
2434#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2435 if (Name == "require<" NAME ">") { \
2436 if constexpr (std::is_constructible_v< \
2437 std::remove_reference_t<decltype(CREATE_PASS)>, \
2438 const TargetMachine &>) { \
2440 return make_error<StringError>( \
2441 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2442 inconvertibleErrorCode()); \
2445 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2447 return Error::success(); \
2449 if (Name == "invalidate<" NAME ">") { \
2450 FPM.addPass(InvalidateAnalysisPass< \
2451 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2452 return Error::success(); \
2458#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2459 if (Name == NAME) { \
2460 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2461 return Error::success(); \
2463#define LOOP_PASS(NAME, CREATE_PASS) \
2464 if (Name == NAME) { \
2465 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2466 return Error::success(); \
2468#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2469 if (checkParametrizedPassName(Name, NAME)) { \
2470 auto Params = parsePassParameters(PARSER, Name, NAME); \
2472 return Params.takeError(); \
2474 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2475 return Error::success(); \
2477#include "PassRegistry.def"
2479 for (
auto &
C : FunctionPipelineParsingCallbacks)
2480 if (
C(Name, FPM, InnerPipeline))
2483 formatv(
"unknown function pass '{}'", Name).str(),
2488 const PipelineElement &
E) {
2489 StringRef
Name =
E.Name;
2490 auto &InnerPipeline =
E.InnerPipeline;
2493 if (!InnerPipeline.empty()) {
2494 if (Name ==
"loop") {
2496 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2499 LPM.addPass(std::move(NestedLPM));
2503 for (
auto &
C : LoopPipelineParsingCallbacks)
2504 if (
C(Name, LPM, InnerPipeline))
2509 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2514#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2515 if (Name == NAME) { \
2516 LPM.addPass(CREATE_PASS); \
2517 return Error::success(); \
2519#define LOOP_PASS(NAME, CREATE_PASS) \
2520 if (Name == NAME) { \
2521 LPM.addPass(CREATE_PASS); \
2522 return Error::success(); \
2524#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2525 if (checkParametrizedPassName(Name, NAME)) { \
2526 auto Params = parsePassParameters(PARSER, Name, NAME); \
2528 return Params.takeError(); \
2529 LPM.addPass(CREATE_PASS(Params.get())); \
2530 return Error::success(); \
2532#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2533 if (Name == "require<" NAME ">") { \
2534 LPM.addPass(RequireAnalysisPass< \
2535 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2536 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2538 return Error::success(); \
2540 if (Name == "invalidate<" NAME ">") { \
2541 LPM.addPass(InvalidateAnalysisPass< \
2542 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2543 return Error::success(); \
2545#include "PassRegistry.def"
2547 for (
auto &
C : LoopPipelineParsingCallbacks)
2548 if (
C(Name, LPM, InnerPipeline))
2555 const PipelineElement &
E) {
2556 StringRef
Name =
E.Name;
2558 if (!
E.InnerPipeline.empty()) {
2559 if (
E.Name ==
"machine-function") {
2561 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2563 MFPM.
addPass(std::move(NestedPM));
2570#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2571 if (Name == NAME) { \
2572 MFPM.addPass(CREATE_PASS); \
2573 return Error::success(); \
2575#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2576 if (Name == NAME) { \
2577 MFPM.addPass(CREATE_PASS); \
2578 return Error::success(); \
2580#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2582 if (checkParametrizedPassName(Name, NAME)) { \
2583 auto Params = parsePassParameters(PARSER, Name, NAME); \
2585 return Params.takeError(); \
2586 MFPM.addPass(CREATE_PASS(Params.get())); \
2587 return Error::success(); \
2589#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2590 if (Name == "require<" NAME ">") { \
2592 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2593 MachineFunction>()); \
2594 return Error::success(); \
2596 if (Name == "invalidate<" NAME ">") { \
2597 MFPM.addPass(InvalidateAnalysisPass< \
2598 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2599 return Error::success(); \
2601#include "llvm/Passes/MachinePassRegistry.def"
2603 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2604 if (
C(Name, MFPM,
E.InnerPipeline))
2607 formatv(
"unknown machine pass '{}'", Name).str(),
2612#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2613 if (Name == NAME) { \
2614 AA.registerModuleAnalysis< \
2615 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2618#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2619 if (Name == NAME) { \
2620 AA.registerFunctionAnalysis< \
2621 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2624#include "PassRegistry.def"
2626 for (
auto &
C : AAParsingCallbacks)
2632Error PassBuilder::parseMachinePassPipeline(
2634 for (
const auto &Element : Pipeline) {
2635 if (
auto Err = parseMachinePass(MFPM, Element))
2643 for (
const auto &Element : Pipeline) {
2644 if (
auto Err = parseLoopPass(LPM, Element))
2650Error PassBuilder::parseFunctionPassPipeline(
2652 for (
const auto &Element : Pipeline) {
2653 if (
auto Err = parseFunctionPass(FPM, Element))
2661 for (
const auto &Element : Pipeline) {
2662 if (
auto Err = parseCGSCCPass(CGPM, Element))
2694 for (
const auto &Element : Pipeline) {
2695 if (
auto Err = parseModulePass(MPM, Element))
2706 auto Pipeline = parsePipelineText(PipelineText);
2707 if (!Pipeline || Pipeline->empty())
2709 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2719 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2721 FunctionPipelineParsingCallbacks)) {
2722 Pipeline = {{
"function", std::move(*Pipeline)}};
2725 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2726 std::move(*Pipeline)}}}};
2727 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2729 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2730 std::move(*Pipeline)}}}};
2732 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2733 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2735 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2736 if (
C(MPM, *Pipeline))
2740 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2742 formatv(
"unknown {} name '{}'",
2743 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2749 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2757 auto Pipeline = parsePipelineText(PipelineText);
2758 if (!Pipeline || Pipeline->empty())
2760 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2766 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2771 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2780 auto Pipeline = parsePipelineText(PipelineText);
2781 if (!Pipeline || Pipeline->empty())
2783 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2789 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2794 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2802 auto Pipeline = parsePipelineText(PipelineText);
2803 if (!Pipeline || Pipeline->empty())
2805 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2808 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2816 auto Pipeline = parsePipelineText(PipelineText);
2817 if (!Pipeline || Pipeline->empty())
2819 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2822 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2831 if (PipelineText ==
"default") {
2836 while (!PipelineText.
empty()) {
2838 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2839 if (!parseAAPassName(
AA, Name))
2841 formatv(
"unknown alias analysis name '{}'", Name).str(),
2848std::optional<RegAllocFilterFunc>
2850 if (FilterName ==
"all")
2852 for (
auto &
C : RegClassFilterParsingCallbacks)
2853 if (
auto F =
C(FilterName))
2855 return std::nullopt;
2866 auto I = PassNames.
begin();
2867 auto End = PassNames.
end();
2874 OS <<
" " << Name <<
'<' << Params <<
">\n";
2881 OS <<
"Module passes:\n";
2882 static constexpr char ModulePassNames[] = {
"\0"
2883#define MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2884#include "PassRegistry.def"
2888 OS <<
"Module passes with params:\n";
2889 static constexpr char ModulePassNamesWithParams[] = {
"\0"
2890#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2891 NAME "\0" PARAMS "\0"
2892#include "PassRegistry.def"
2896 OS <<
"Module analyses:\n";
2897 static constexpr char ModuleAnalysisNames[] = {
"\0"
2898#define MODULE_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2899#include "PassRegistry.def"
2903 OS <<
"Module alias analyses:\n";
2904 static constexpr char ModuleAliasAnalysisNames[] = {
"\0"
2905#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2906#include "PassRegistry.def"
2910 OS <<
"CGSCC passes:\n";
2911 static constexpr char CGSCCPassNames[] = {
"\0"
2912#define CGSCC_PASS(NAME, CREATE_PASS) NAME "\0"
2913#include "PassRegistry.def"
2917 OS <<
"CGSCC passes with params:\n";
2918 static constexpr char CGSCCPassNamesWithParams[] = {
"\0"
2919#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2920 NAME "\0" PARAMS "\0"
2921#include "PassRegistry.def"
2925 OS <<
"CGSCC analyses:\n";
2926 static constexpr char CGSCCAnalysisNames[] = {
"\0"
2927#define CGSCC_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2928#include "PassRegistry.def"
2932 OS <<
"Function passes:\n";
2933 static constexpr char FunctionPassNames[] = {
"\0"
2934#define FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
2935#include "PassRegistry.def"
2939 OS <<
"Function passes with params:\n";
2940 static constexpr char FunctionPassNamesWithParams[] = {
"\0"
2941#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2942 NAME "\0" PARAMS "\0"
2943#include "PassRegistry.def"
2947 OS <<
"Function analyses:\n";
2948 static constexpr char FunctionAnalysisNames[] = {
"\0"
2949#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2950#include "PassRegistry.def"
2954 OS <<
"Function alias analyses:\n";
2955 static constexpr char FunctionAliasAnalysisNames[] = {
"\0"
2956#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2957#include "PassRegistry.def"
2961 OS <<
"LoopNest passes:\n";
2962 static constexpr char LoopNestPassNames[] = {
"\0"
2963#define LOOPNEST_PASS(NAME, CREATE_PASS) NAME "\0"
2964#include "PassRegistry.def"
2968 OS <<
"Loop passes:\n";
2969 static constexpr char LoopPassNames[] = {
"\0"
2970#define LOOP_PASS(NAME, CREATE_PASS) NAME "\0"
2971#include "PassRegistry.def"
2975 OS <<
"Loop passes with params:\n";
2976 static constexpr char LoopPassNamesWithParams[] = {
"\0"
2977#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2978 NAME "\0" PARAMS "\0"
2979#include "PassRegistry.def"
2983 OS <<
"Loop analyses:\n";
2984 static constexpr char LoopAnalysisNames[] = {
"\0"
2985#define LOOP_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
2986#include "PassRegistry.def"
2990 OS <<
"Machine module passes (WIP):\n";
2991 static constexpr char MachineModulePassNames[] = {
"\0"
2992#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) NAME "\0"
2993#include "llvm/Passes/MachinePassRegistry.def"
2997 OS <<
"Machine function passes (WIP):\n";
2998 static constexpr char MachineFunctionPassNames[] = {
"\0"
2999#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) NAME "\0"
3000#include "llvm/Passes/MachinePassRegistry.def"
3004 OS <<
"Machine function analyses (WIP):\n";
3005 static constexpr char MachineFunctionAnalysisNames[] = {
"\0"
3006#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) NAME "\0"
3007#include "llvm/Passes/MachinePassRegistry.def"
3015 TopLevelPipelineParsingCallbacks.push_back(
C);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AggressiveInstCombiner - Combine expression patterns to form expressions with fewer,...
This file implements a simple N^2 alias analysis accuracy evaluator.
Provides passes to inlining "always_inline" functions.
This is the interface for LLVM's primary stateless and local alias analysis.
This file contains the declaration of the BreakFalseDepsPass class, used to identify and avoid false ...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Contains definition of the base CFIFixup pass.
This file provides the interface for LLVM's Call Graph Profile pass.
This header provides classes for managing passes over SCCs of the call graph.
Provides analysis for continuously CSEing during GISel passes.
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
Defines an IR pass for CodeGen Prepare.
This file contains the declaration of the MachineKCFI class, which is a Machine Pass that implements ...
#define LLVM_ATTRIBUTE_NOINLINE
LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so, mark a method "not for inl...
This file declares an analysis pass that computes CycleInfo for LLVM IR, specialized from GenericCycl...
Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that ge...
This file provides the interface for a simple, fast CSE pass.
This file provides a pass which clones the current module and runs the provided pass pipeline on the ...
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
Provides passes for computing function attributes based on interprocedural analyses.
This file provides the interface for the GCOV style profiler pass.
Provides analysis for querying information about KnownBits during GISel passes.
This file provides the interface for the GVNHoist pass.
This file provides the interface for the GVNSink pass.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
This is the interface for a simple mod/ref and alias analysis over globals.
Defines an IR pass for the creation of hardware loops.
AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...
This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder inte...
This file defines passes to print out IR in various granularities.
This file declares the IRTranslator pass.
This header defines various interfaces for pass management in LLVM.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
This file provides the primary interface to the instcombine pass.
Defines passes for running instruction simplification across chunks of IR.
This file provides the interface for LLVM's PGO Instrumentation lowering pass.
This file contains the declaration of the InterleavedAccessPass class, its corresponding pass name is...
See the comments on JumpThreadingPass.
Implements a lazy call graph analysis and related passes for the new pass manager.
This file provides the interface for LLVM's Logical Scalar Replacement of Aggregates pass.
This file defines the interface for the loop cache analysis.
This file provides the interface for LLVM's Loop Data Prefetching Pass.
This file implements the Loop Fusion pass.
This header defines the LoopLoadEliminationPass object.
This file defines the interface for the loop nest analysis.
This header provides classes for managing a pipeline of passes over loops in LLVM IR.
This file provides the interface for the pass responsible for removing expensive ubsan checks.
The header file for the LowerConstantIntrinsics pass as used by the new pass manager.
The header file for the LowerExpectIntrinsic pass as used by the new pass manager.
Machine Check Debug Module
This file contains the declaration of the CheckDebugMachineModulePass class, used by the new pass man...
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
This pass performs merges of loads and stores on both sides of a.
This is the interface to build a ModuleSummaryIndex for a module.
Contains a collection of routines for determining if a given instruction is guaranteed to execute if ...
This file provides the interface for LLVM's Global Value Numbering pass.
This file declares a simple ARC-aware AliasAnalysis using special knowledge of Objective C to enhance...
This header enumerates the LLVM-provided high-level optimization levels.
This file provides the interface for IR based instrumentation passes ( (profile-gen,...
CGSCCAnalysisManager CGAM
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
PassBuilder PB(Mod->getContext(), 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...
MachineRegisterInfo & MRI
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file describes the interface of the MachineFunctionPass responsible for assigning the generic vi...
This pass is required to take advantage of the interprocedural register allocation infrastructure.
This file implements relative lookup table converter that converts lookup tables to relative lookup t...
This file contains the declaration of the ResetMachineFunctionPass class.
This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.
This file provides the interface for the pseudo probe implementation for AutoFDO.
This file provides the interface for the sampled PGO loader pass.
This is the interface for a SCEV-based alias analysis.
This pass converts vector operations into scalar operations (or, optionally, operations on smaller ve...
This is the interface for a metadata-based scoped no-alias analysis.
This file contains the declaration of the SelectOptimizePass class, its corresponding pass name is se...
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This pass strips convergence intrinsics and operand bundles as those are only useful when modifying t...
Target-Independent Code Generator Pass Configuration Options pass.
This is the interface for a metadata-based TBAA.
static const char PassName[]
A manager for alias analyses.
Class for arbitrary precision integers.
uint64_t getZExtValue() const
Get zero extended value.
int64_t getSExtValue() const
Get sign extended value.
bool registerPass(PassBuilderT &&PassBuilder)
Register an analysis pass with the manager.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
static LLVM_ABI GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
This is an important class for using LLVM in a threaded context.
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 Error parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText)
Parse a textual pass pipeline description into a ModulePassManager.
LLVM_ABI PassBuilder(LLVMContext &Context, TargetMachine *TM=nullptr, std::optional< PipelineTuningOptions > PTO=std::nullopt, std::optional< PGOOptions > PGOOpt=std::nullopt, PassInstrumentationCallbacks *PIC=nullptr, IntrusiveRefCntPtr< vfs::FileSystem > FS=vfs::getRealFileSystem())
The pipelines read the library options of Context, which must outlive the PassBuilder.
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 std::optional< PrintPipelinePassesFormat > getPrintPipelinePasses() const
The format -print-pipeline-passes requests, or std::nullopt if it is not given.
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.
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...
@ End
Run the machine verifier once, at the end of the pipeline.
const PassesOptions & getPassesOptions(const LLVMContext &C)
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