402 "print-pipeline-passes",
403 cl::desc(
"Print a '-passes' compatible string describing the pipeline "
404 "(best-effort only)."));
422 return MFA ? &MFA->
getMF() :
nullptr;
428class TriggerCrashModulePass
435 static StringRef
name() {
return "TriggerCrashModulePass"; }
438class TriggerCrashFunctionPass
445 static StringRef
name() {
return "TriggerCrashFunctionPass"; }
450class TriggerVerifierErrorPass
456 auto *PtrTy = PointerType::getUnqual(
M.getContext());
458 GlobalValue::LinkageTypes::InternalLinkage,
459 "__bad_alias",
nullptr, &M);
479 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
484class RequireAllMachineFunctionPropertiesPass
492 static MachineFunctionProperties getRequiredProperties() {
493 return MachineFunctionProperties()
495 .setFailsVerification()
500 .setRegBankSelected()
502 .setTiedOpsRewritten()
503 .setTracksDebugUserValues()
504 .setTracksLiveness();
506 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
512 if (S ==
"Os" || S ==
"Oz")
514 Twine(
"The optimization level \"") + S +
515 "\" is no longer supported. Use O2 in conjunction with the " +
516 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
527 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
531 formatv(
"invalid optimization level '{}'", S).str(),
536 std::optional<PGOOptions> PGOOpt,
539 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
541 TM->registerPassBuilderCallbacks(*
this);
543 PIC->registerClassToPassNameCallback([
this, PIC]() {
547#define MODULE_PASS(NAME, CREATE_PASS) \
548 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
549#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
550 PIC->addClassToPassName(CLASS, NAME);
551#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
552 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
553#define FUNCTION_PASS(NAME, CREATE_PASS) \
554 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
555#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
556 PIC->addClassToPassName(CLASS, NAME);
557#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
558 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
559#define LOOPNEST_PASS(NAME, CREATE_PASS) \
560 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
561#define LOOP_PASS(NAME, CREATE_PASS) \
562 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
563#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
564 PIC->addClassToPassName(CLASS, NAME);
565#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
566 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
567#define CGSCC_PASS(NAME, CREATE_PASS) \
568 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
569#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
570 PIC->addClassToPassName(CLASS, NAME);
571#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
572 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
573#include "PassRegistry.def"
575#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
576 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
577#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
578 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
579#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
581 PIC->addClassToPassName(CLASS, NAME);
582#include "llvm/Passes/MachinePassRegistry.def"
590#define MODULE_CALLBACK(NAME, INVOKE) \
591 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
592 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
594 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
597 INVOKE(PM, L.get()); \
600#include "PassRegistry.def"
608#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
609 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
610 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
612 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
615 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
618#include "PassRegistry.def"
626#define FUNCTION_CALLBACK(NAME, INVOKE) \
627 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
628 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
630 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
633 INVOKE(PM, L.get()); \
636#include "PassRegistry.def"
644#define CGSCC_CALLBACK(NAME, INVOKE) \
645 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
646 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
648 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
651 INVOKE(PM, L.get()); \
654#include "PassRegistry.def"
662#define LOOP_CALLBACK(NAME, INVOKE) \
663 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
664 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
666 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
669 INVOKE(PM, L.get()); \
672#include "PassRegistry.def"
678#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
679 MAM.registerPass([&] { return CREATE_PASS; });
680#include "PassRegistry.def"
682 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
687#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
688 CGAM.registerPass([&] { return CREATE_PASS; });
689#include "PassRegistry.def"
691 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
701#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
702 if constexpr (std::is_constructible_v< \
703 std::remove_reference_t<decltype(CREATE_PASS)>, \
704 const TargetMachine &>) { \
706 FAM.registerPass([&] { return CREATE_PASS; }); \
708 FAM.registerPass([&] { return CREATE_PASS; }); \
710#include "PassRegistry.def"
712 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
719#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
720 MFAM.registerPass([&] { return CREATE_PASS; });
721#include "llvm/Passes/MachinePassRegistry.def"
723 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
728#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
729 LAM.registerPass([&] { return CREATE_PASS; });
730#include "PassRegistry.def"
732 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
736static std::optional<std::pair<bool, bool>>
738 std::pair<bool, bool> Params;
739 if (!Name.consume_front(
"function"))
743 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
745 while (!Name.empty()) {
746 auto [Front, Back] = Name.split(
';');
748 if (Front ==
"eager-inv")
750 else if (Front ==
"no-rerun")
751 Params.second =
true;
759 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
771 while (!Params.
empty()) {
773 std::tie(ParamName, Params) = Params.
split(
';');
775 if (ParamName == OptionName) {
792 while (!Params.
empty()) {
794 std::tie(ParamName, Params) = Params.
split(
';');
799 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
804 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
808 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
813 if (ParamName ==
"force-hardware-loops") {
815 }
else if (ParamName ==
"force-hardware-loop-phi") {
817 }
else if (ParamName ==
"force-nested-hardware-loop") {
819 }
else if (ParamName ==
"force-hardware-loop-guard") {
823 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
827 return HardwareLoopOpts;
839 "FunctionPropertiesStatisticsPass");
850 while (!Params.
empty()) {
852 std::tie(ParamName, Params) = Params.
split(
';');
853 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
855 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
862 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
869 if (ParamName ==
"partial") {
871 }
else if (ParamName ==
"peeling") {
873 }
else if (ParamName ==
"profile-peeling") {
875 }
else if (ParamName ==
"runtime") {
877 }
else if (ParamName ==
"upperbound") {
881 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
890 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
910 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
919 "EntryExitInstrumenter");
924 "DropUnnecessaryAssumes");
933 "LowerMatrixIntrinsics");
938 while (!Params.
empty()) {
940 std::tie(ParamName, Params) = Params.
split(
';');
943 if (ParamName ==
"preserve-order")
945 else if (ParamName ==
"rename-all")
947 else if (ParamName ==
"fold-all")
949 else if (ParamName ==
"reorder-operands")
953 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
963 while (!Params.
empty()) {
965 std::tie(ParamName, Params) = Params.
split(
';');
967 if (ParamName ==
"kernel") {
968 Result.CompileKernel =
true;
969 }
else if (ParamName ==
"use-after-scope") {
970 Result.UseAfterScope =
true;
973 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
983 while (!Params.
empty()) {
985 std::tie(ParamName, Params) = Params.
split(
';');
987 if (ParamName ==
"recover") {
989 }
else if (ParamName ==
"kernel") {
990 Result.CompileKernel =
true;
993 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
1002parseDropTypeTestsPassOptions(
StringRef Params) {
1004 while (!Params.
empty()) {
1006 std::tie(ParamName, Params) = Params.
split(
';');
1008 if (ParamName ==
"all") {
1010 }
else if (ParamName ==
"assume") {
1014 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1023 while (!Params.
empty()) {
1025 std::tie(ParamName, Params) = Params.
split(
';');
1027 if (ParamName ==
"thinlto") {
1029 }
else if (ParamName ==
"emit-summary") {
1030 Result.EmitLTOSummary =
true;
1033 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1041parseLowerAllowCheckPassOptions(
StringRef Params) {
1043 while (!Params.
empty()) {
1045 std::tie(ParamName, Params) = Params.
split(
';');
1056 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1063 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1068 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1070 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1071 IndicesStr, CutoffStr)
1075 while (IndicesStr !=
"") {
1077 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1083 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1084 firstIndexStr, IndicesStr)
1091 if (index >=
Result.cutoffs.size())
1092 Result.cutoffs.resize(index + 1, 0);
1094 Result.cutoffs[index] = cutoff;
1096 }
else if (ParamName.
starts_with(
"runtime_check")) {
1098 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1102 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1104 ValueString, Params)
1108 Result.runtime_check = runtime_check;
1111 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1122 while (!Params.
empty()) {
1124 std::tie(ParamName, Params) = Params.
split(
';');
1126 if (ParamName ==
"recover") {
1128 }
else if (ParamName ==
"kernel") {
1133 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1138 }
else if (ParamName ==
"eager-checks") {
1139 Result.EagerChecks =
true;
1142 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1152 while (!Params.
empty()) {
1154 std::tie(ParamName, Params) = Params.
split(
';');
1161 formatv(
"invalid argument to AllocToken pass mode "
1168 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1178 while (!Params.
empty()) {
1180 std::tie(ParamName, Params) = Params.
split(
';');
1183 if (ParamName ==
"speculate-blocks") {
1185 }
else if (ParamName ==
"simplify-cond-branch") {
1187 }
else if (ParamName ==
"forward-switch-cond") {
1189 }
else if (ParamName ==
"switch-range-to-icmp") {
1191 }
else if (ParamName ==
"switch-to-arithmetic") {
1193 }
else if (ParamName ==
"switch-to-lookup") {
1195 }
else if (ParamName ==
"keep-loops") {
1197 }
else if (ParamName ==
"hoist-common-insts") {
1199 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1201 }
else if (ParamName ==
"sink-common-insts") {
1203 }
else if (ParamName ==
"speculate-unpredictables") {
1206 APInt BonusInstThreshold;
1209 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1217 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1228 Result.setVerifyFixpoint(
true);
1229 while (!Params.
empty()) {
1231 std::tie(ParamName, Params) = Params.
split(
';');
1234 if (ParamName ==
"verify-fixpoint") {
1237 APInt MaxIterations;
1240 formatv(
"invalid argument to InstCombine pass max-iterations "
1248 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1258 while (!Params.
empty()) {
1260 std::tie(ParamName, Params) = Params.
split(
';');
1263 if (ParamName ==
"interleave-forced-only") {
1265 }
else if (ParamName ==
"vectorize-forced-only") {
1269 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1277 std::pair<bool, bool>
Result = {
false,
true};
1278 while (!Params.
empty()) {
1280 std::tie(ParamName, Params) = Params.
split(
';');
1283 if (ParamName ==
"nontrivial") {
1285 }
else if (ParamName ==
"trivial") {
1289 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1298 while (!Params.
empty()) {
1300 std::tie(ParamName, Params) = Params.
split(
';');
1303 if (ParamName ==
"allowspeculation") {
1307 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1314struct LoopRotateOptions {
1315 bool EnableHeaderDuplication =
true;
1316 bool PrepareForLTO =
false;
1317 bool CheckExitCount =
false;
1321 LoopRotateOptions
Result;
1322 while (!Params.
empty()) {
1324 std::tie(ParamName, Params) = Params.
split(
';');
1327 if (ParamName ==
"header-duplication") {
1329 }
else if (ParamName ==
"prepare-for-lto") {
1331 }
else if (ParamName ==
"check-exit-count") {
1335 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1344 while (!Params.
empty()) {
1346 std::tie(ParamName, Params) = Params.
split(
';');
1349 if (ParamName ==
"split-footer-bb") {
1353 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1364 while (!Params.
empty()) {
1366 std::tie(ParamName, Params) = Params.
split(
';');
1369 if (ParamName ==
"scalar-pre") {
1371 }
else if (ParamName ==
"load-pre") {
1373 }
else if (ParamName ==
"split-backedge-load-pre") {
1375 }
else if (ParamName ==
"memdep") {
1379 }
else if (ParamName ==
"memoryssa") {
1385 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1394 while (!Params.
empty()) {
1396 std::tie(ParamName, Params) = Params.
split(
';');
1399 if (ParamName ==
"func-spec")
1403 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1411 while (!Params.
empty()) {
1413 std::tie(ParamName, Params) = Params.
split(
';');
1418 formatv(
"invalid argument to Scalarizer pass min-bits "
1429 if (ParamName ==
"load-store")
1431 else if (ParamName ==
"variable-insert-extract")
1435 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1445 bool SawCFGOption =
false;
1446 while (!Params.
empty()) {
1448 std::tie(ParamName, Params) = Params.
split(
';');
1450 if (ParamName ==
"modify-cfg") {
1455 SawCFGOption =
true;
1456 }
else if (ParamName ==
"preserve-cfg") {
1461 SawCFGOption =
true;
1462 }
else if (ParamName ==
"aggregate-to-vector") {
1463 Result.AggregateToVector =
true;
1466 formatv(
"invalid SROA pass parameter '{}' (expected preserve-cfg, "
1467 "modify-cfg, or aggregate-to-vector)",
1477parseStackLifetimeOptions(
StringRef Params) {
1479 while (!Params.
empty()) {
1481 std::tie(ParamName, Params) = Params.
split(
';');
1483 if (ParamName ==
"may") {
1485 }
else if (ParamName ==
"must") {
1489 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1498 "DependenceAnalysisPrinter");
1503 "SeparateConstOffsetFromGEP");
1512parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1516 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1524 "MemorySSAPrinterPass");
1529 "SpeculativeExecutionPass");
1534 while (!Params.
empty()) {
1536 std::tie(ParamName, Params) = Params.
split(
';');
1542 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1550parseStructuralHashPrinterPassOptions(
StringRef Params) {
1553 if (Params ==
"detailed")
1555 if (Params ==
"call-target-ignored")
1558 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1564 "WinEHPreparePass");
1569 while (!Params.
empty()) {
1571 std::tie(ParamName, Params) = Params.
split(
';');
1574 if (ParamName ==
"group-by-use")
1576 else if (ParamName ==
"ignore-single-use")
1578 else if (ParamName ==
"merge-const")
1580 else if (ParamName ==
"merge-const-aggressive")
1582 else if (ParamName ==
"merge-external")
1587 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1591 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1600 while (!Params.
empty()) {
1602 std::tie(ParamName, Params) = Params.
split(
';');
1608 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1619 while (!Params.
empty()) {
1621 std::tie(ParamName, Params) = Params.
split(
';');
1624 std::optional<RegAllocFilterFunc>
Filter =
1628 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1637 if (ParamName ==
"no-clear-vregs") {
1643 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1650parseBoundsCheckingOptions(
StringRef Params) {
1652 while (!Params.
empty()) {
1654 std::tie(ParamName, Params) = Params.
split(
';');
1655 if (ParamName ==
"trap") {
1657 }
else if (ParamName ==
"rt") {
1663 }
else if (ParamName ==
"rt-abort") {
1669 }
else if (ParamName ==
"min-rt") {
1675 }
else if (ParamName ==
"min-rt-abort") {
1681 }
else if (ParamName ==
"merge") {
1683 }
else if (ParamName ==
"handler-preserve-all-regs") {
1685 Options.Rt->HandlerPreserveAllRegs =
true;
1689 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1695 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1712 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1714 Param.str().c_str());
1717 if (!
Level.has_value())
1719 "invalid optimization level for expand-ir-insts pass: %s",
1720 Digit.str().c_str());
1727 if (Params.
empty() || Params ==
"all")
1728 return RAGreedyPass::Options();
1732 return RAGreedyPass::Options{*
Filter, Params};
1735 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1741 "MachineSinkingPass");
1745 bool AllowTailMerge =
true;
1746 if (!Params.
empty()) {
1748 if (Params !=
"tail-merge")
1750 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1754 return AllowTailMerge;
1758 bool ClearVirtRegs =
true;
1759 if (!Params.
empty()) {
1761 if (Params !=
"clear-vregs")
1763 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1766 return ClearVirtRegs;
1769struct FatLTOOptions {
1770 OptimizationLevel OptLevel;
1771 bool ThinLTO =
false;
1772 bool EmitSummary =
false;
1777 bool HaveOptLevel =
false;
1778 while (!Params.
empty()) {
1780 std::tie(ParamName, Params) = Params.
split(
';');
1782 if (ParamName ==
"thinlto") {
1784 }
else if (ParamName ==
"emit-summary") {
1785 Result.EmitSummary =
true;
1786 }
else if (std::optional<OptimizationLevel> OptLevel =
1788 Result.OptLevel = *OptLevel;
1789 HaveOptLevel =
true;
1792 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1799 "missing optimization level for fatlto-pre-link pipeline",
1814template <
typename PassManagerT,
typename CallbacksT>
1816 if (!Callbacks.empty()) {
1817 PassManagerT DummyPM;
1818 for (
auto &CB : Callbacks)
1819 if (CB(Name, DummyPM, {}))
1825template <
typename CallbacksT>
1827 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1830 if (Name ==
"module")
1832 if (Name ==
"cgscc")
1834 if (NameNoBracket ==
"function")
1836 if (Name ==
"coro-cond")
1839#define MODULE_PASS(NAME, CREATE_PASS) \
1842#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1843 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1845#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1846 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1848#include "PassRegistry.def"
1853template <
typename CallbacksT>
1856 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1857 if (Name ==
"cgscc")
1859 if (NameNoBracket ==
"function")
1866#define CGSCC_PASS(NAME, CREATE_PASS) \
1869#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1870 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1872#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1873 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1875#include "PassRegistry.def"
1880template <
typename CallbacksT>
1883 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1884 if (NameNoBracket ==
"function")
1886 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1889#define FUNCTION_PASS(NAME, CREATE_PASS) \
1892#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1893 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1895#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1896 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1898#include "PassRegistry.def"
1903template <
typename CallbacksT>
1906 if (Name ==
"machine-function")
1909#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1912#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1914 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1917#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1918 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1921#include "llvm/Passes/MachinePassRegistry.def"
1926template <
typename CallbacksT>
1928 bool &UseMemorySSA) {
1929 UseMemorySSA =
false;
1932 UseMemorySSA =
true;
1936#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1939#include "PassRegistry.def"
1944template <
typename CallbacksT>
1946 bool &UseMemorySSA) {
1947 UseMemorySSA =
false;
1950 UseMemorySSA =
true;
1954#define LOOP_PASS(NAME, CREATE_PASS) \
1957#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1958 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1960#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1961 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1963#include "PassRegistry.def"
1968std::optional<std::vector<PassBuilder::PipelineElement>>
1969PassBuilder::parsePipelineText(
StringRef Text) {
1970 std::vector<PipelineElement> ResultPipeline;
1975 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1976 size_t Pos =
Text.find_first_of(
",()");
1977 Pipeline.push_back({
Text.substr(0, Pos), {}});
1980 if (Pos ==
Text.npos)
1983 char Sep =
Text[Pos];
1991 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1995 assert(Sep ==
')' &&
"Bogus separator!");
2000 if (PipelineStack.
size() == 1)
2001 return std::nullopt;
2004 }
while (
Text.consume_front(
")"));
2012 if (!
Text.consume_front(
","))
2013 return std::nullopt;
2016 if (PipelineStack.
size() > 1)
2018 return std::nullopt;
2020 assert(PipelineStack.
back() == &ResultPipeline &&
2021 "Wrong pipeline at the bottom of the stack!");
2022 return {std::move(ResultPipeline)};
2032 const PipelineElement &
E) {
2033 auto &
Name =
E.Name;
2034 auto &InnerPipeline =
E.InnerPipeline;
2037 if (!InnerPipeline.empty()) {
2038 if (Name ==
"module") {
2040 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2042 MPM.
addPass(std::move(NestedMPM));
2045 if (Name ==
"coro-cond") {
2047 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2049 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2052 if (Name ==
"cgscc") {
2054 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2062 "cannot have a no-rerun module to function adaptor",
2065 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2072 for (
auto &
C : ModulePipelineParsingCallbacks)
2073 if (
C(Name, MPM, InnerPipeline))
2078 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2084#define MODULE_PASS(NAME, CREATE_PASS) \
2085 if (Name == NAME) { \
2086 MPM.addPass(CREATE_PASS); \
2087 return Error::success(); \
2089#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2090 if (checkParametrizedPassName(Name, NAME)) { \
2091 auto Params = parsePassParameters(PARSER, Name, NAME); \
2093 return Params.takeError(); \
2094 MPM.addPass(CREATE_PASS(Params.get())); \
2095 return Error::success(); \
2097#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2098 if (Name == "require<" NAME ">") { \
2100 RequireAnalysisPass< \
2101 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2102 return Error::success(); \
2104 if (Name == "invalidate<" NAME ">") { \
2105 MPM.addPass(InvalidateAnalysisPass< \
2106 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2107 return Error::success(); \
2109#define CGSCC_PASS(NAME, CREATE_PASS) \
2110 if (Name == NAME) { \
2111 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2112 return Error::success(); \
2114#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2115 if (checkParametrizedPassName(Name, NAME)) { \
2116 auto Params = parsePassParameters(PARSER, Name, NAME); \
2118 return Params.takeError(); \
2120 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2121 return Error::success(); \
2123#define FUNCTION_PASS(NAME, CREATE_PASS) \
2124 if (Name == NAME) { \
2125 if constexpr (std::is_constructible_v< \
2126 std::remove_reference_t<decltype(CREATE_PASS)>, \
2127 const TargetMachine &>) { \
2129 return make_error<StringError>( \
2130 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2131 inconvertibleErrorCode()); \
2133 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2134 return Error::success(); \
2136#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2137 if (checkParametrizedPassName(Name, NAME)) { \
2138 auto Params = parsePassParameters(PARSER, Name, NAME); \
2140 return Params.takeError(); \
2141 auto CreatePass = CREATE_PASS; \
2142 if constexpr (std::is_constructible_v< \
2143 std::remove_reference_t<decltype(CreatePass( \
2145 const TargetMachine &, \
2146 std::remove_reference_t<decltype(Params.get())>>) { \
2148 return make_error<StringError>( \
2149 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2150 inconvertibleErrorCode()); \
2153 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2154 return Error::success(); \
2156#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2157 if (Name == NAME) { \
2158 MPM.addPass(createModuleToFunctionPassAdaptor( \
2159 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2160 return Error::success(); \
2162#define LOOP_PASS(NAME, CREATE_PASS) \
2163 if (Name == NAME) { \
2164 MPM.addPass(createModuleToFunctionPassAdaptor( \
2165 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2166 return Error::success(); \
2168#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2169 if (checkParametrizedPassName(Name, NAME)) { \
2170 auto Params = parsePassParameters(PARSER, Name, NAME); \
2172 return Params.takeError(); \
2173 MPM.addPass(createModuleToFunctionPassAdaptor( \
2174 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2175 return Error::success(); \
2177#include "PassRegistry.def"
2179 for (
auto &
C : ModulePipelineParsingCallbacks)
2180 if (
C(Name, MPM, InnerPipeline))
2183 formatv(
"unknown module pass '{}'", Name).str(),
2188 const PipelineElement &
E) {
2189 auto &
Name =
E.Name;
2190 auto &InnerPipeline =
E.InnerPipeline;
2193 if (!InnerPipeline.empty()) {
2194 if (Name ==
"cgscc") {
2196 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2199 CGPM.
addPass(std::move(NestedCGPM));
2204 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2208 std::move(FPM), Params->first, Params->second));
2213 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2220 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2221 if (
C(Name, CGPM, InnerPipeline))
2226 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2231#define CGSCC_PASS(NAME, CREATE_PASS) \
2232 if (Name == NAME) { \
2233 CGPM.addPass(CREATE_PASS); \
2234 return Error::success(); \
2236#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2237 if (checkParametrizedPassName(Name, NAME)) { \
2238 auto Params = parsePassParameters(PARSER, Name, NAME); \
2240 return Params.takeError(); \
2241 CGPM.addPass(CREATE_PASS(Params.get())); \
2242 return Error::success(); \
2244#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2245 if (Name == "require<" NAME ">") { \
2246 CGPM.addPass(RequireAnalysisPass< \
2247 std::remove_reference_t<decltype(CREATE_PASS)>, \
2248 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2249 CGSCCUpdateResult &>()); \
2250 return Error::success(); \
2252 if (Name == "invalidate<" NAME ">") { \
2253 CGPM.addPass(InvalidateAnalysisPass< \
2254 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2255 return Error::success(); \
2257#define FUNCTION_PASS(NAME, CREATE_PASS) \
2258 if (Name == NAME) { \
2259 if constexpr (std::is_constructible_v< \
2260 std::remove_reference_t<decltype(CREATE_PASS)>, \
2261 const TargetMachine &>) { \
2263 return make_error<StringError>( \
2264 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2265 inconvertibleErrorCode()); \
2267 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2268 return Error::success(); \
2270#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2271 if (checkParametrizedPassName(Name, NAME)) { \
2272 auto Params = parsePassParameters(PARSER, Name, NAME); \
2274 return Params.takeError(); \
2275 auto CreatePass = CREATE_PASS; \
2276 if constexpr (std::is_constructible_v< \
2277 std::remove_reference_t<decltype(CreatePass( \
2279 const TargetMachine &, \
2280 std::remove_reference_t<decltype(Params.get())>>) { \
2282 return make_error<StringError>( \
2283 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2284 inconvertibleErrorCode()); \
2287 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2288 return Error::success(); \
2290#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2291 if (Name == NAME) { \
2292 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2293 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2294 return Error::success(); \
2296#define LOOP_PASS(NAME, CREATE_PASS) \
2297 if (Name == NAME) { \
2298 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2299 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2300 return Error::success(); \
2302#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2303 if (checkParametrizedPassName(Name, NAME)) { \
2304 auto Params = parsePassParameters(PARSER, Name, NAME); \
2306 return Params.takeError(); \
2307 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2308 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2309 return Error::success(); \
2311#include "PassRegistry.def"
2313 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2314 if (
C(Name, CGPM, InnerPipeline))
2321 const PipelineElement &
E) {
2322 auto &
Name =
E.Name;
2323 auto &InnerPipeline =
E.InnerPipeline;
2326 if (!InnerPipeline.empty()) {
2327 if (Name ==
"function") {
2329 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2332 FPM.
addPass(std::move(NestedFPM));
2335 if (Name ==
"loop" || Name ==
"loop-mssa") {
2337 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2340 bool UseMemorySSA = (
Name ==
"loop-mssa");
2345 if (Name ==
"machine-function") {
2347 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2353 for (
auto &
C : FunctionPipelineParsingCallbacks)
2354 if (
C(Name, FPM, InnerPipeline))
2359 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2364#define FUNCTION_PASS(NAME, CREATE_PASS) \
2365 if (Name == NAME) { \
2366 if constexpr (std::is_constructible_v< \
2367 std::remove_reference_t<decltype(CREATE_PASS)>, \
2368 const TargetMachine &>) { \
2370 return make_error<StringError>( \
2371 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2372 inconvertibleErrorCode()); \
2374 FPM.addPass(CREATE_PASS); \
2375 return Error::success(); \
2377#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2378 if (checkParametrizedPassName(Name, NAME)) { \
2379 auto Params = parsePassParameters(PARSER, Name, NAME); \
2381 return Params.takeError(); \
2382 auto CreatePass = CREATE_PASS; \
2383 if constexpr (std::is_constructible_v< \
2384 std::remove_reference_t<decltype(CreatePass( \
2386 const TargetMachine &, \
2387 std::remove_reference_t<decltype(Params.get())>>) { \
2389 return make_error<StringError>( \
2390 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2391 inconvertibleErrorCode()); \
2394 FPM.addPass(CREATE_PASS(Params.get())); \
2395 return Error::success(); \
2397#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2398 if (Name == "require<" NAME ">") { \
2399 if constexpr (std::is_constructible_v< \
2400 std::remove_reference_t<decltype(CREATE_PASS)>, \
2401 const TargetMachine &>) { \
2403 return make_error<StringError>( \
2404 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2405 inconvertibleErrorCode()); \
2408 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2410 return Error::success(); \
2412 if (Name == "invalidate<" NAME ">") { \
2413 FPM.addPass(InvalidateAnalysisPass< \
2414 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2415 return Error::success(); \
2421#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2422 if (Name == NAME) { \
2423 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2424 return Error::success(); \
2426#define LOOP_PASS(NAME, CREATE_PASS) \
2427 if (Name == NAME) { \
2428 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2429 return Error::success(); \
2431#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2432 if (checkParametrizedPassName(Name, NAME)) { \
2433 auto Params = parsePassParameters(PARSER, Name, NAME); \
2435 return Params.takeError(); \
2437 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2438 return Error::success(); \
2440#include "PassRegistry.def"
2442 for (
auto &
C : FunctionPipelineParsingCallbacks)
2443 if (
C(Name, FPM, InnerPipeline))
2446 formatv(
"unknown function pass '{}'", Name).str(),
2451 const PipelineElement &
E) {
2452 StringRef
Name =
E.Name;
2453 auto &InnerPipeline =
E.InnerPipeline;
2456 if (!InnerPipeline.empty()) {
2457 if (Name ==
"loop") {
2459 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2462 LPM.addPass(std::move(NestedLPM));
2466 for (
auto &
C : LoopPipelineParsingCallbacks)
2467 if (
C(Name, LPM, InnerPipeline))
2472 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2477#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2478 if (Name == NAME) { \
2479 LPM.addPass(CREATE_PASS); \
2480 return Error::success(); \
2482#define LOOP_PASS(NAME, CREATE_PASS) \
2483 if (Name == NAME) { \
2484 LPM.addPass(CREATE_PASS); \
2485 return Error::success(); \
2487#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2488 if (checkParametrizedPassName(Name, NAME)) { \
2489 auto Params = parsePassParameters(PARSER, Name, NAME); \
2491 return Params.takeError(); \
2492 LPM.addPass(CREATE_PASS(Params.get())); \
2493 return Error::success(); \
2495#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2496 if (Name == "require<" NAME ">") { \
2497 LPM.addPass(RequireAnalysisPass< \
2498 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2499 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2501 return Error::success(); \
2503 if (Name == "invalidate<" NAME ">") { \
2504 LPM.addPass(InvalidateAnalysisPass< \
2505 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2506 return Error::success(); \
2508#include "PassRegistry.def"
2510 for (
auto &
C : LoopPipelineParsingCallbacks)
2511 if (
C(Name, LPM, InnerPipeline))
2518 const PipelineElement &
E) {
2519 StringRef
Name =
E.Name;
2521 if (!
E.InnerPipeline.empty()) {
2522 if (
E.Name ==
"machine-function") {
2524 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2526 MFPM.
addPass(std::move(NestedPM));
2533#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2534 if (Name == NAME) { \
2535 MFPM.addPass(CREATE_PASS); \
2536 return Error::success(); \
2538#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2539 if (Name == NAME) { \
2540 MFPM.addPass(CREATE_PASS); \
2541 return Error::success(); \
2543#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2545 if (checkParametrizedPassName(Name, NAME)) { \
2546 auto Params = parsePassParameters(PARSER, Name, NAME); \
2548 return Params.takeError(); \
2549 MFPM.addPass(CREATE_PASS(Params.get())); \
2550 return Error::success(); \
2552#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2553 if (Name == "require<" NAME ">") { \
2555 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2556 MachineFunction>()); \
2557 return Error::success(); \
2559 if (Name == "invalidate<" NAME ">") { \
2560 MFPM.addPass(InvalidateAnalysisPass< \
2561 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2562 return Error::success(); \
2564#include "llvm/Passes/MachinePassRegistry.def"
2566 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2567 if (
C(Name, MFPM,
E.InnerPipeline))
2570 formatv(
"unknown machine pass '{}'", Name).str(),
2575#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2576 if (Name == NAME) { \
2577 AA.registerModuleAnalysis< \
2578 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2581#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2582 if (Name == NAME) { \
2583 AA.registerFunctionAnalysis< \
2584 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2587#include "PassRegistry.def"
2589 for (
auto &
C : AAParsingCallbacks)
2595Error PassBuilder::parseMachinePassPipeline(
2597 for (
const auto &Element : Pipeline) {
2598 if (
auto Err = parseMachinePass(MFPM, Element))
2606 for (
const auto &Element : Pipeline) {
2607 if (
auto Err = parseLoopPass(LPM, Element))
2613Error PassBuilder::parseFunctionPassPipeline(
2615 for (
const auto &Element : Pipeline) {
2616 if (
auto Err = parseFunctionPass(FPM, Element))
2624 for (
const auto &Element : Pipeline) {
2625 if (
auto Err = parseCGSCCPass(CGPM, Element))
2657 for (
const auto &Element : Pipeline) {
2658 if (
auto Err = parseModulePass(MPM, Element))
2669 auto Pipeline = parsePipelineText(PipelineText);
2670 if (!Pipeline || Pipeline->empty())
2672 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2682 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2684 FunctionPipelineParsingCallbacks)) {
2685 Pipeline = {{
"function", std::move(*Pipeline)}};
2688 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2689 std::move(*Pipeline)}}}};
2690 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2692 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2693 std::move(*Pipeline)}}}};
2695 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2696 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2698 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2699 if (
C(MPM, *Pipeline))
2703 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2705 formatv(
"unknown {} name '{}'",
2706 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2712 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2720 auto Pipeline = parsePipelineText(PipelineText);
2721 if (!Pipeline || Pipeline->empty())
2723 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2729 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2734 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2743 auto Pipeline = parsePipelineText(PipelineText);
2744 if (!Pipeline || Pipeline->empty())
2746 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2752 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2757 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2765 auto Pipeline = parsePipelineText(PipelineText);
2766 if (!Pipeline || Pipeline->empty())
2768 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2771 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2779 auto Pipeline = parsePipelineText(PipelineText);
2780 if (!Pipeline || Pipeline->empty())
2782 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2785 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2794 if (PipelineText ==
"default") {
2799 while (!PipelineText.
empty()) {
2801 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2802 if (!parseAAPassName(
AA, Name))
2804 formatv(
"unknown alias analysis name '{}'", Name).str(),
2811std::optional<RegAllocFilterFunc>
2813 if (FilterName ==
"all")
2815 for (
auto &
C : RegClassFilterParsingCallbacks)
2816 if (
auto F =
C(FilterName))
2818 return std::nullopt;
2826 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2832 OS <<
"Module passes:\n";
2833#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2834#include "PassRegistry.def"
2836 OS <<
"Module passes with params:\n";
2837#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2838 printPassName(NAME, PARAMS, OS);
2839#include "PassRegistry.def"
2841 OS <<
"Module analyses:\n";
2842#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2843#include "PassRegistry.def"
2845 OS <<
"Module alias analyses:\n";
2846#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2847#include "PassRegistry.def"
2849 OS <<
"CGSCC passes:\n";
2850#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2851#include "PassRegistry.def"
2853 OS <<
"CGSCC passes with params:\n";
2854#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2855 printPassName(NAME, PARAMS, OS);
2856#include "PassRegistry.def"
2858 OS <<
"CGSCC analyses:\n";
2859#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2860#include "PassRegistry.def"
2862 OS <<
"Function passes:\n";
2863#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2864#include "PassRegistry.def"
2866 OS <<
"Function passes with params:\n";
2867#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2868 printPassName(NAME, PARAMS, OS);
2869#include "PassRegistry.def"
2871 OS <<
"Function analyses:\n";
2872#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2873#include "PassRegistry.def"
2875 OS <<
"Function alias analyses:\n";
2876#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2877#include "PassRegistry.def"
2879 OS <<
"LoopNest passes:\n";
2880#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2881#include "PassRegistry.def"
2883 OS <<
"Loop passes:\n";
2884#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2885#include "PassRegistry.def"
2887 OS <<
"Loop passes with params:\n";
2888#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2889 printPassName(NAME, PARAMS, OS);
2890#include "PassRegistry.def"
2892 OS <<
"Loop analyses:\n";
2893#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2894#include "PassRegistry.def"
2896 OS <<
"Machine module passes (WIP):\n";
2897#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2898#include "llvm/Passes/MachinePassRegistry.def"
2900 OS <<
"Machine function passes (WIP):\n";
2901#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2902#include "llvm/Passes/MachinePassRegistry.def"
2904 OS <<
"Machine function analyses (WIP):\n";
2905#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2906#include "llvm/Passes/MachinePassRegistry.def"
2912 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< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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 ...
This file declares an analysis pass that computes CycleInfo for LLVM IR, specialized from GenericCycl...
Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that ge...
This file provides the interface for a simple, fast CSE pass.
This file provides a pass which clones the current module and runs the provided pass pipeline on the ...
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
Provides passes for computing function attributes based on interprocedural analyses.
This file provides the interface for the GCOV style profiler pass.
Provides analysis for querying information about KnownBits during GISel passes.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
This is the interface for a simple mod/ref and alias analysis over globals.
Defines an IR pass for the creation of hardware loops.
AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...
This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder inte...
This file defines passes to print out IR in various granularities.
This header defines various interfaces for pass management in LLVM.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
This file provides the primary interface to the instcombine pass.
Defines passes for running instruction simplification across chunks of IR.
This file provides the interface for LLVM's PGO Instrumentation lowering pass.
This file contains the declaration of the InterleavedAccessPass class, its corresponding pass name is...
See the comments on JumpThreadingPass.
Implements a lazy call graph analysis and related passes for the new pass manager.
This file 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 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 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 void printPassName(StringRef PassName, raw_ostream &OS)
static bool isFunctionPassName(StringRef Name, CallbacksT &Callbacks)
static void setupOptionsForPipelineAlias(PipelineTuningOptions &PTO, OptimizationLevel L)
This file implements the PredicateInfo analysis, which creates an Extended SSA form for operations us...
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This pass is required to take advantage of the interprocedural register allocation infrastructure.
This file implements relative lookup table converter that converts lookup tables to relative lookup t...
This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.
This file provides the interface for the pseudo probe implementation for AutoFDO.
This file provides the interface for the sampled PGO loader pass.
This is the interface for a SCEV-based alias analysis.
This pass converts vector operations into scalar operations (or, optionally, operations on smaller ve...
This is the interface for a metadata-based scoped no-alias analysis.
This file contains the declaration of the SelectOptimizePass class, its corresponding pass name is se...
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This pass strips convergence intrinsics and operand bundles as those are only useful when modifying t...
Target-Independent Code Generator Pass Configuration Options pass.
This is the interface for a metadata-based TBAA.
static const char PassName[]
A manager for alias analyses.
Class for arbitrary precision integers.
uint64_t getZExtValue() const
Get zero extended value.
int64_t getSExtValue() const
Get sign extended value.
bool registerPass(PassBuilderT &&PassBuilder)
Register an analysis pass with the manager.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
static LLVM_ABI GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
MachineFunction & getMF()
This analysis create MachineFunction for given Function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const MachineFunctionProperties & getProperties() const
Get the function properties.
LLVM_ABI Register createGenericVirtualRegister(LLT Ty, StringRef Name="")
Create and return a new generic virtual register with low-level type Ty.
static LLVM_ABI const OptimizationLevel O3
Optimize for fast execution as much as possible.
static LLVM_ABI const OptimizationLevel O0
Disable as many optimizations as possible.
static LLVM_ABI const OptimizationLevel O2
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
static LLVM_ABI const OptimizationLevel O1
Optimize quickly without destroying debuggability.
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)
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.
@ C
The default llvm calling convention, compatible with C.
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.
NodeAddr< FuncNode * > Func
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.
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.
LLVM_ABI cl::opt< bool > PrintPipelinePasses
Common option used by multiple tools to print pipeline passes.
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.
FunctionAddr VTableAddr Count
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.
OuterAnalysisManagerProxy< ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph & > ModuleAnalysisManagerCGSCCProxy
A proxy from a ModuleAnalysisManager to an SCC.
InnerAnalysisManagerProxy< MachineFunctionAnalysisManager, Module > MachineFunctionAnalysisManagerModuleProxy
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 >
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...
@ 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 & 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