397 "print-pipeline-passes",
398 cl::desc(
"Print a '-passes' compatible string describing the pipeline "
399 "(best-effort only)."));
410class TriggerCrashModulePass :
public PassInfoMixin<TriggerCrashModulePass> {
416 static StringRef
name() {
return "TriggerCrashModulePass"; }
419class TriggerCrashFunctionPass
426 static StringRef
name() {
return "TriggerCrashFunctionPass"; }
431class TriggerVerifierErrorPass
437 auto *PtrTy = PointerType::getUnqual(
M.getContext());
439 GlobalValue::LinkageTypes::InternalLinkage,
440 "__bad_alias",
nullptr, &M);
460 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
465class RequireAllMachineFunctionPropertiesPass
466 :
public PassInfoMixin<RequireAllMachineFunctionPropertiesPass> {
473 static MachineFunctionProperties getRequiredProperties() {
474 return MachineFunctionProperties()
476 .setFailsVerification()
481 .setRegBankSelected()
483 .setTiedOpsRewritten()
484 .setTracksDebugUserValues()
485 .setTracksLiveness();
487 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
493 if (S ==
"Os" || S ==
"Oz")
495 Twine(
"The optimization level \"") + S +
496 "\" is no longer supported. Use O2 in conjunction with the " +
497 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
508 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
512 formatv(
"invalid optimization level '{}'", S).str(),
517 std::optional<PGOOptions> PGOOpt,
520 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
522 TM->registerPassBuilderCallbacks(*
this);
524 PIC->registerClassToPassNameCallback([
this, PIC]() {
528#define MODULE_PASS(NAME, CREATE_PASS) \
529 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
530#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
531 PIC->addClassToPassName(CLASS, NAME);
532#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
533 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
534#define FUNCTION_PASS(NAME, CREATE_PASS) \
535 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
536#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
537 PIC->addClassToPassName(CLASS, NAME);
538#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
539 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
540#define LOOPNEST_PASS(NAME, CREATE_PASS) \
541 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
542#define LOOP_PASS(NAME, CREATE_PASS) \
543 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
544#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
545 PIC->addClassToPassName(CLASS, NAME);
546#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
547 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
548#define CGSCC_PASS(NAME, CREATE_PASS) \
549 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
550#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
551 PIC->addClassToPassName(CLASS, NAME);
552#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
553 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
554#include "PassRegistry.def"
556#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
557 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
558#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
559 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
560#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
562 PIC->addClassToPassName(CLASS, NAME);
563#include "llvm/Passes/MachinePassRegistry.def"
571#define MODULE_CALLBACK(NAME, INVOKE) \
572 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
573 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
575 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
578 INVOKE(PM, L.get()); \
581#include "PassRegistry.def"
589#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
590 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
591 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
593 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
596 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
599#include "PassRegistry.def"
607#define FUNCTION_CALLBACK(NAME, INVOKE) \
608 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
609 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
611 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
614 INVOKE(PM, L.get()); \
617#include "PassRegistry.def"
625#define CGSCC_CALLBACK(NAME, INVOKE) \
626 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
627 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
629 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
632 INVOKE(PM, L.get()); \
635#include "PassRegistry.def"
643#define LOOP_CALLBACK(NAME, INVOKE) \
644 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
645 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
647 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
650 INVOKE(PM, L.get()); \
653#include "PassRegistry.def"
659#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
660 MAM.registerPass([&] { return CREATE_PASS; });
661#include "PassRegistry.def"
663 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
668#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
669 CGAM.registerPass([&] { return CREATE_PASS; });
670#include "PassRegistry.def"
672 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
682#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
683 if constexpr (std::is_constructible_v< \
684 std::remove_reference_t<decltype(CREATE_PASS)>, \
685 const TargetMachine &>) { \
687 FAM.registerPass([&] { return CREATE_PASS; }); \
689 FAM.registerPass([&] { return CREATE_PASS; }); \
691#include "PassRegistry.def"
693 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
700#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
701 MFAM.registerPass([&] { return CREATE_PASS; });
702#include "llvm/Passes/MachinePassRegistry.def"
704 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
709#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
710 LAM.registerPass([&] { return CREATE_PASS; });
711#include "PassRegistry.def"
713 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
717static std::optional<std::pair<bool, bool>>
719 std::pair<bool, bool> Params;
720 if (!Name.consume_front(
"function"))
724 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
726 while (!Name.empty()) {
727 auto [Front, Back] = Name.split(
';');
729 if (Front ==
"eager-inv")
731 else if (Front ==
"no-rerun")
732 Params.second =
true;
740 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
752 while (!Params.
empty()) {
754 std::tie(ParamName, Params) = Params.
split(
';');
756 if (ParamName == OptionName) {
773 while (!Params.
empty()) {
775 std::tie(ParamName, Params) = Params.
split(
';');
780 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
785 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
789 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
794 if (ParamName ==
"force-hardware-loops") {
796 }
else if (ParamName ==
"force-hardware-loop-phi") {
798 }
else if (ParamName ==
"force-nested-hardware-loop") {
800 }
else if (ParamName ==
"force-hardware-loop-guard") {
804 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
808 return HardwareLoopOpts;
820 "FunctionPropertiesStatisticsPass");
831 while (!Params.
empty()) {
833 std::tie(ParamName, Params) = Params.
split(
';');
834 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
836 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
843 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
850 if (ParamName ==
"partial") {
852 }
else if (ParamName ==
"peeling") {
854 }
else if (ParamName ==
"profile-peeling") {
856 }
else if (ParamName ==
"runtime") {
858 }
else if (ParamName ==
"upperbound") {
862 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
871 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
891 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
900 "EntryExitInstrumenter");
905 "DropUnnecessaryAssumes");
914 "LowerMatrixIntrinsics");
919 while (!Params.
empty()) {
921 std::tie(ParamName, Params) = Params.
split(
';');
924 if (ParamName ==
"preserve-order")
926 else if (ParamName ==
"rename-all")
928 else if (ParamName ==
"fold-all")
930 else if (ParamName ==
"reorder-operands")
934 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
944 while (!Params.
empty()) {
946 std::tie(ParamName, Params) = Params.
split(
';');
948 if (ParamName ==
"kernel") {
949 Result.CompileKernel =
true;
950 }
else if (ParamName ==
"use-after-scope") {
951 Result.UseAfterScope =
true;
954 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
964 while (!Params.
empty()) {
966 std::tie(ParamName, Params) = Params.
split(
';');
968 if (ParamName ==
"recover") {
970 }
else if (ParamName ==
"kernel") {
971 Result.CompileKernel =
true;
974 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
983parseDropTypeTestsPassOptions(
StringRef Params) {
985 while (!Params.
empty()) {
987 std::tie(ParamName, Params) = Params.
split(
';');
989 if (ParamName ==
"all") {
991 }
else if (ParamName ==
"assume") {
995 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1004 while (!Params.
empty()) {
1006 std::tie(ParamName, Params) = Params.
split(
';');
1008 if (ParamName ==
"thinlto") {
1010 }
else if (ParamName ==
"emit-summary") {
1011 Result.EmitLTOSummary =
true;
1014 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1022parseLowerAllowCheckPassOptions(
StringRef Params) {
1024 while (!Params.
empty()) {
1026 std::tie(ParamName, Params) = Params.
split(
';');
1037 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1044 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1049 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1051 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1052 IndicesStr, CutoffStr)
1056 while (IndicesStr !=
"") {
1058 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1064 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1065 firstIndexStr, IndicesStr)
1072 if (index >=
Result.cutoffs.size())
1073 Result.cutoffs.resize(index + 1, 0);
1075 Result.cutoffs[index] = cutoff;
1077 }
else if (ParamName.
starts_with(
"runtime_check")) {
1079 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1083 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1085 ValueString, Params)
1089 Result.runtime_check = runtime_check;
1092 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1103 while (!Params.
empty()) {
1105 std::tie(ParamName, Params) = Params.
split(
';');
1107 if (ParamName ==
"recover") {
1109 }
else if (ParamName ==
"kernel") {
1114 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1119 }
else if (ParamName ==
"eager-checks") {
1120 Result.EagerChecks =
true;
1123 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1133 while (!Params.
empty()) {
1135 std::tie(ParamName, Params) = Params.
split(
';');
1142 formatv(
"invalid argument to AllocToken pass mode "
1149 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1159 while (!Params.
empty()) {
1161 std::tie(ParamName, Params) = Params.
split(
';');
1164 if (ParamName ==
"speculate-blocks") {
1166 }
else if (ParamName ==
"simplify-cond-branch") {
1168 }
else if (ParamName ==
"forward-switch-cond") {
1170 }
else if (ParamName ==
"switch-range-to-icmp") {
1172 }
else if (ParamName ==
"switch-to-arithmetic") {
1174 }
else if (ParamName ==
"switch-to-lookup") {
1176 }
else if (ParamName ==
"keep-loops") {
1178 }
else if (ParamName ==
"hoist-common-insts") {
1180 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1182 }
else if (ParamName ==
"sink-common-insts") {
1184 }
else if (ParamName ==
"speculate-unpredictables") {
1187 APInt BonusInstThreshold;
1190 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1198 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1209 Result.setVerifyFixpoint(
true);
1210 while (!Params.
empty()) {
1212 std::tie(ParamName, Params) = Params.
split(
';');
1215 if (ParamName ==
"verify-fixpoint") {
1218 APInt MaxIterations;
1221 formatv(
"invalid argument to InstCombine pass max-iterations "
1229 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1239 while (!Params.
empty()) {
1241 std::tie(ParamName, Params) = Params.
split(
';');
1244 if (ParamName ==
"interleave-forced-only") {
1246 }
else if (ParamName ==
"vectorize-forced-only") {
1250 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1258 std::pair<bool, bool>
Result = {
false,
true};
1259 while (!Params.
empty()) {
1261 std::tie(ParamName, Params) = Params.
split(
';');
1264 if (ParamName ==
"nontrivial") {
1266 }
else if (ParamName ==
"trivial") {
1270 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1279 while (!Params.
empty()) {
1281 std::tie(ParamName, Params) = Params.
split(
';');
1284 if (ParamName ==
"allowspeculation") {
1288 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1295struct LoopRotateOptions {
1296 bool EnableHeaderDuplication =
true;
1297 bool PrepareForLTO =
false;
1298 bool CheckExitCount =
false;
1302 LoopRotateOptions
Result;
1303 while (!Params.
empty()) {
1305 std::tie(ParamName, Params) = Params.
split(
';');
1308 if (ParamName ==
"header-duplication") {
1310 }
else if (ParamName ==
"prepare-for-lto") {
1312 }
else if (ParamName ==
"check-exit-count") {
1316 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1325 while (!Params.
empty()) {
1327 std::tie(ParamName, Params) = Params.
split(
';');
1330 if (ParamName ==
"split-footer-bb") {
1334 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1345 while (!Params.
empty()) {
1347 std::tie(ParamName, Params) = Params.
split(
';');
1350 if (ParamName ==
"pre") {
1352 }
else if (ParamName ==
"load-pre") {
1354 }
else if (ParamName ==
"split-backedge-load-pre") {
1356 }
else if (ParamName ==
"memdep") {
1360 }
else if (ParamName ==
"memoryssa") {
1366 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1375 while (!Params.
empty()) {
1377 std::tie(ParamName, Params) = Params.
split(
';');
1380 if (ParamName ==
"func-spec")
1384 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1392 while (!Params.
empty()) {
1394 std::tie(ParamName, Params) = Params.
split(
';');
1399 formatv(
"invalid argument to Scalarizer pass min-bits "
1410 if (ParamName ==
"load-store")
1412 else if (ParamName ==
"variable-insert-extract")
1416 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1425 if (Params.
empty() || Params ==
"modify-cfg")
1427 if (Params ==
"preserve-cfg")
1430 formatv(
"invalid SROA pass parameter '{}' (either preserve-cfg or "
1431 "modify-cfg can be specified)",
1438parseStackLifetimeOptions(
StringRef Params) {
1440 while (!Params.
empty()) {
1442 std::tie(ParamName, Params) = Params.
split(
';');
1444 if (ParamName ==
"may") {
1446 }
else if (ParamName ==
"must") {
1450 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1459 "DependenceAnalysisPrinter");
1464 "SeparateConstOffsetFromGEP");
1473parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1477 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1485 "MemorySSAPrinterPass");
1490 "SpeculativeExecutionPass");
1495 while (!Params.
empty()) {
1497 std::tie(ParamName, Params) = Params.
split(
';');
1503 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1511parseStructuralHashPrinterPassOptions(
StringRef Params) {
1514 if (Params ==
"detailed")
1516 if (Params ==
"call-target-ignored")
1519 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1525 "WinEHPreparePass");
1530 while (!Params.
empty()) {
1532 std::tie(ParamName, Params) = Params.
split(
';');
1535 if (ParamName ==
"group-by-use")
1537 else if (ParamName ==
"ignore-single-use")
1539 else if (ParamName ==
"merge-const")
1541 else if (ParamName ==
"merge-const-aggressive")
1543 else if (ParamName ==
"merge-external")
1548 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1552 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1561 while (!Params.
empty()) {
1563 std::tie(ParamName, Params) = Params.
split(
';');
1569 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1580 while (!Params.
empty()) {
1582 std::tie(ParamName, Params) = Params.
split(
';');
1585 std::optional<RegAllocFilterFunc>
Filter =
1589 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1598 if (ParamName ==
"no-clear-vregs") {
1604 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1611parseBoundsCheckingOptions(
StringRef Params) {
1613 while (!Params.
empty()) {
1615 std::tie(ParamName, Params) = Params.
split(
';');
1616 if (ParamName ==
"trap") {
1618 }
else if (ParamName ==
"rt") {
1624 }
else if (ParamName ==
"rt-abort") {
1630 }
else if (ParamName ==
"min-rt") {
1636 }
else if (ParamName ==
"min-rt-abort") {
1642 }
else if (ParamName ==
"merge") {
1644 }
else if (ParamName ==
"handler-preserve-all-regs") {
1646 Options.Rt->HandlerPreserveAllRegs =
true;
1650 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1656 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1673 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1675 Param.str().c_str());
1678 if (!
Level.has_value())
1680 "invalid optimization level for expand-ir-insts pass: %s",
1681 Digit.str().c_str());
1688 if (Params.
empty() || Params ==
"all")
1689 return RAGreedyPass::Options();
1693 return RAGreedyPass::Options{*
Filter, Params};
1696 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1702 "MachineSinkingPass");
1706 bool AllowTailMerge =
true;
1707 if (!Params.
empty()) {
1709 if (Params !=
"tail-merge")
1711 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1715 return AllowTailMerge;
1719 bool ClearVirtRegs =
true;
1720 if (!Params.
empty()) {
1722 if (Params !=
"clear-vregs")
1724 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1727 return ClearVirtRegs;
1730struct FatLTOOptions {
1731 OptimizationLevel OptLevel;
1732 bool ThinLTO =
false;
1733 bool EmitSummary =
false;
1738 bool HaveOptLevel =
false;
1739 while (!Params.
empty()) {
1741 std::tie(ParamName, Params) = Params.
split(
';');
1743 if (ParamName ==
"thinlto") {
1745 }
else if (ParamName ==
"emit-summary") {
1746 Result.EmitSummary =
true;
1747 }
else if (std::optional<OptimizationLevel> OptLevel =
1749 Result.OptLevel = *OptLevel;
1750 HaveOptLevel =
true;
1753 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1760 "missing optimization level for fatlto-pre-link pipeline",
1775template <
typename PassManagerT,
typename CallbacksT>
1777 if (!Callbacks.empty()) {
1778 PassManagerT DummyPM;
1779 for (
auto &CB : Callbacks)
1780 if (CB(Name, DummyPM, {}))
1786template <
typename CallbacksT>
1788 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1791 if (Name ==
"module")
1793 if (Name ==
"cgscc")
1795 if (NameNoBracket ==
"function")
1797 if (Name ==
"coro-cond")
1800#define MODULE_PASS(NAME, CREATE_PASS) \
1803#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1804 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1806#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1807 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1809#include "PassRegistry.def"
1814template <
typename CallbacksT>
1817 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1818 if (Name ==
"cgscc")
1820 if (NameNoBracket ==
"function")
1827#define CGSCC_PASS(NAME, CREATE_PASS) \
1830#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1831 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1833#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1834 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1836#include "PassRegistry.def"
1841template <
typename CallbacksT>
1844 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1845 if (NameNoBracket ==
"function")
1847 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1850#define FUNCTION_PASS(NAME, CREATE_PASS) \
1853#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1854 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1856#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1857 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1859#include "PassRegistry.def"
1864template <
typename CallbacksT>
1867 if (Name ==
"machine-function")
1870#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1873#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1875 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1878#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1879 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1882#include "llvm/Passes/MachinePassRegistry.def"
1887template <
typename CallbacksT>
1889 bool &UseMemorySSA) {
1890 UseMemorySSA =
false;
1893 UseMemorySSA =
true;
1897#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1900#include "PassRegistry.def"
1905template <
typename CallbacksT>
1907 bool &UseMemorySSA) {
1908 UseMemorySSA =
false;
1911 UseMemorySSA =
true;
1915#define LOOP_PASS(NAME, CREATE_PASS) \
1918#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1919 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1921#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1922 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1924#include "PassRegistry.def"
1929std::optional<std::vector<PassBuilder::PipelineElement>>
1930PassBuilder::parsePipelineText(
StringRef Text) {
1931 std::vector<PipelineElement> ResultPipeline;
1936 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1937 size_t Pos =
Text.find_first_of(
",()");
1938 Pipeline.push_back({
Text.substr(0, Pos), {}});
1941 if (Pos ==
Text.npos)
1944 char Sep =
Text[Pos];
1952 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1956 assert(Sep ==
')' &&
"Bogus separator!");
1961 if (PipelineStack.
size() == 1)
1962 return std::nullopt;
1965 }
while (
Text.consume_front(
")"));
1973 if (!
Text.consume_front(
","))
1974 return std::nullopt;
1977 if (PipelineStack.
size() > 1)
1979 return std::nullopt;
1981 assert(PipelineStack.
back() == &ResultPipeline &&
1982 "Wrong pipeline at the bottom of the stack!");
1983 return {std::move(ResultPipeline)};
1993 const PipelineElement &
E) {
1994 auto &
Name =
E.Name;
1995 auto &InnerPipeline =
E.InnerPipeline;
1998 if (!InnerPipeline.empty()) {
1999 if (Name ==
"module") {
2001 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2003 MPM.
addPass(std::move(NestedMPM));
2006 if (Name ==
"coro-cond") {
2008 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2010 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2013 if (Name ==
"cgscc") {
2015 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2023 "cannot have a no-rerun module to function adaptor",
2026 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2033 for (
auto &
C : ModulePipelineParsingCallbacks)
2034 if (
C(Name, MPM, InnerPipeline))
2039 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2045#define MODULE_PASS(NAME, CREATE_PASS) \
2046 if (Name == NAME) { \
2047 MPM.addPass(CREATE_PASS); \
2048 return Error::success(); \
2050#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2051 if (checkParametrizedPassName(Name, NAME)) { \
2052 auto Params = parsePassParameters(PARSER, Name, NAME); \
2054 return Params.takeError(); \
2055 MPM.addPass(CREATE_PASS(Params.get())); \
2056 return Error::success(); \
2058#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2059 if (Name == "require<" NAME ">") { \
2061 RequireAnalysisPass< \
2062 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2063 return Error::success(); \
2065 if (Name == "invalidate<" NAME ">") { \
2066 MPM.addPass(InvalidateAnalysisPass< \
2067 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2068 return Error::success(); \
2070#define CGSCC_PASS(NAME, CREATE_PASS) \
2071 if (Name == NAME) { \
2072 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2073 return Error::success(); \
2075#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2076 if (checkParametrizedPassName(Name, NAME)) { \
2077 auto Params = parsePassParameters(PARSER, Name, NAME); \
2079 return Params.takeError(); \
2081 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2082 return Error::success(); \
2084#define FUNCTION_PASS(NAME, CREATE_PASS) \
2085 if (Name == NAME) { \
2086 if constexpr (std::is_constructible_v< \
2087 std::remove_reference_t<decltype(CREATE_PASS)>, \
2088 const TargetMachine &>) { \
2090 return make_error<StringError>( \
2091 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2092 inconvertibleErrorCode()); \
2094 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2095 return Error::success(); \
2097#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2098 if (checkParametrizedPassName(Name, NAME)) { \
2099 auto Params = parsePassParameters(PARSER, Name, NAME); \
2101 return Params.takeError(); \
2102 auto CreatePass = CREATE_PASS; \
2103 if constexpr (std::is_constructible_v< \
2104 std::remove_reference_t<decltype(CreatePass( \
2106 const TargetMachine &, \
2107 std::remove_reference_t<decltype(Params.get())>>) { \
2109 return make_error<StringError>( \
2110 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2111 inconvertibleErrorCode()); \
2114 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2115 return Error::success(); \
2117#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2118 if (Name == NAME) { \
2119 MPM.addPass(createModuleToFunctionPassAdaptor( \
2120 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2121 return Error::success(); \
2123#define LOOP_PASS(NAME, CREATE_PASS) \
2124 if (Name == NAME) { \
2125 MPM.addPass(createModuleToFunctionPassAdaptor( \
2126 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2127 return Error::success(); \
2129#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2130 if (checkParametrizedPassName(Name, NAME)) { \
2131 auto Params = parsePassParameters(PARSER, Name, NAME); \
2133 return Params.takeError(); \
2134 MPM.addPass(createModuleToFunctionPassAdaptor( \
2135 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2136 return Error::success(); \
2138#include "PassRegistry.def"
2140 for (
auto &
C : ModulePipelineParsingCallbacks)
2141 if (
C(Name, MPM, InnerPipeline))
2144 formatv(
"unknown module pass '{}'", Name).str(),
2149 const PipelineElement &
E) {
2150 auto &
Name =
E.Name;
2151 auto &InnerPipeline =
E.InnerPipeline;
2154 if (!InnerPipeline.empty()) {
2155 if (Name ==
"cgscc") {
2157 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2160 CGPM.
addPass(std::move(NestedCGPM));
2165 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2169 std::move(FPM), Params->first, Params->second));
2174 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2181 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2182 if (
C(Name, CGPM, InnerPipeline))
2187 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2192#define CGSCC_PASS(NAME, CREATE_PASS) \
2193 if (Name == NAME) { \
2194 CGPM.addPass(CREATE_PASS); \
2195 return Error::success(); \
2197#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2198 if (checkParametrizedPassName(Name, NAME)) { \
2199 auto Params = parsePassParameters(PARSER, Name, NAME); \
2201 return Params.takeError(); \
2202 CGPM.addPass(CREATE_PASS(Params.get())); \
2203 return Error::success(); \
2205#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2206 if (Name == "require<" NAME ">") { \
2207 CGPM.addPass(RequireAnalysisPass< \
2208 std::remove_reference_t<decltype(CREATE_PASS)>, \
2209 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2210 CGSCCUpdateResult &>()); \
2211 return Error::success(); \
2213 if (Name == "invalidate<" NAME ">") { \
2214 CGPM.addPass(InvalidateAnalysisPass< \
2215 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2216 return Error::success(); \
2218#define FUNCTION_PASS(NAME, CREATE_PASS) \
2219 if (Name == NAME) { \
2220 if constexpr (std::is_constructible_v< \
2221 std::remove_reference_t<decltype(CREATE_PASS)>, \
2222 const TargetMachine &>) { \
2224 return make_error<StringError>( \
2225 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2226 inconvertibleErrorCode()); \
2228 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2229 return Error::success(); \
2231#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2232 if (checkParametrizedPassName(Name, NAME)) { \
2233 auto Params = parsePassParameters(PARSER, Name, NAME); \
2235 return Params.takeError(); \
2236 auto CreatePass = CREATE_PASS; \
2237 if constexpr (std::is_constructible_v< \
2238 std::remove_reference_t<decltype(CreatePass( \
2240 const TargetMachine &, \
2241 std::remove_reference_t<decltype(Params.get())>>) { \
2243 return make_error<StringError>( \
2244 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2245 inconvertibleErrorCode()); \
2248 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2249 return Error::success(); \
2251#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2252 if (Name == NAME) { \
2253 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2254 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2255 return Error::success(); \
2257#define LOOP_PASS(NAME, CREATE_PASS) \
2258 if (Name == NAME) { \
2259 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2260 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2261 return Error::success(); \
2263#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2264 if (checkParametrizedPassName(Name, NAME)) { \
2265 auto Params = parsePassParameters(PARSER, Name, NAME); \
2267 return Params.takeError(); \
2268 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2269 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2270 return Error::success(); \
2272#include "PassRegistry.def"
2274 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2275 if (
C(Name, CGPM, InnerPipeline))
2282 const PipelineElement &
E) {
2283 auto &
Name =
E.Name;
2284 auto &InnerPipeline =
E.InnerPipeline;
2287 if (!InnerPipeline.empty()) {
2288 if (Name ==
"function") {
2290 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2293 FPM.
addPass(std::move(NestedFPM));
2296 if (Name ==
"loop" || Name ==
"loop-mssa") {
2298 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2301 bool UseMemorySSA = (
Name ==
"loop-mssa");
2306 if (Name ==
"machine-function") {
2308 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2314 for (
auto &
C : FunctionPipelineParsingCallbacks)
2315 if (
C(Name, FPM, InnerPipeline))
2320 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2325#define FUNCTION_PASS(NAME, CREATE_PASS) \
2326 if (Name == NAME) { \
2327 if constexpr (std::is_constructible_v< \
2328 std::remove_reference_t<decltype(CREATE_PASS)>, \
2329 const TargetMachine &>) { \
2331 return make_error<StringError>( \
2332 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2333 inconvertibleErrorCode()); \
2335 FPM.addPass(CREATE_PASS); \
2336 return Error::success(); \
2338#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2339 if (checkParametrizedPassName(Name, NAME)) { \
2340 auto Params = parsePassParameters(PARSER, Name, NAME); \
2342 return Params.takeError(); \
2343 auto CreatePass = CREATE_PASS; \
2344 if constexpr (std::is_constructible_v< \
2345 std::remove_reference_t<decltype(CreatePass( \
2347 const TargetMachine &, \
2348 std::remove_reference_t<decltype(Params.get())>>) { \
2350 return make_error<StringError>( \
2351 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2352 inconvertibleErrorCode()); \
2355 FPM.addPass(CREATE_PASS(Params.get())); \
2356 return Error::success(); \
2358#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2359 if (Name == "require<" NAME ">") { \
2360 if constexpr (std::is_constructible_v< \
2361 std::remove_reference_t<decltype(CREATE_PASS)>, \
2362 const TargetMachine &>) { \
2364 return make_error<StringError>( \
2365 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2366 inconvertibleErrorCode()); \
2369 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2371 return Error::success(); \
2373 if (Name == "invalidate<" NAME ">") { \
2374 FPM.addPass(InvalidateAnalysisPass< \
2375 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2376 return Error::success(); \
2382#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2383 if (Name == NAME) { \
2384 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2385 return Error::success(); \
2387#define LOOP_PASS(NAME, CREATE_PASS) \
2388 if (Name == NAME) { \
2389 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2390 return Error::success(); \
2392#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2393 if (checkParametrizedPassName(Name, NAME)) { \
2394 auto Params = parsePassParameters(PARSER, Name, NAME); \
2396 return Params.takeError(); \
2398 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2399 return Error::success(); \
2401#include "PassRegistry.def"
2403 for (
auto &
C : FunctionPipelineParsingCallbacks)
2404 if (
C(Name, FPM, InnerPipeline))
2407 formatv(
"unknown function pass '{}'", Name).str(),
2412 const PipelineElement &
E) {
2413 StringRef
Name =
E.Name;
2414 auto &InnerPipeline =
E.InnerPipeline;
2417 if (!InnerPipeline.empty()) {
2418 if (Name ==
"loop") {
2420 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2423 LPM.addPass(std::move(NestedLPM));
2427 for (
auto &
C : LoopPipelineParsingCallbacks)
2428 if (
C(Name, LPM, InnerPipeline))
2433 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2438#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2439 if (Name == NAME) { \
2440 LPM.addPass(CREATE_PASS); \
2441 return Error::success(); \
2443#define LOOP_PASS(NAME, CREATE_PASS) \
2444 if (Name == NAME) { \
2445 LPM.addPass(CREATE_PASS); \
2446 return Error::success(); \
2448#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2449 if (checkParametrizedPassName(Name, NAME)) { \
2450 auto Params = parsePassParameters(PARSER, Name, NAME); \
2452 return Params.takeError(); \
2453 LPM.addPass(CREATE_PASS(Params.get())); \
2454 return Error::success(); \
2456#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2457 if (Name == "require<" NAME ">") { \
2458 LPM.addPass(RequireAnalysisPass< \
2459 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2460 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2462 return Error::success(); \
2464 if (Name == "invalidate<" NAME ">") { \
2465 LPM.addPass(InvalidateAnalysisPass< \
2466 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2467 return Error::success(); \
2469#include "PassRegistry.def"
2471 for (
auto &
C : LoopPipelineParsingCallbacks)
2472 if (
C(Name, LPM, InnerPipeline))
2479 const PipelineElement &
E) {
2480 StringRef
Name =
E.Name;
2482 if (!
E.InnerPipeline.empty()) {
2483 if (
E.Name ==
"machine-function") {
2485 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2487 MFPM.
addPass(std::move(NestedPM));
2494#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2495 if (Name == NAME) { \
2496 MFPM.addPass(CREATE_PASS); \
2497 return Error::success(); \
2499#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2500 if (Name == NAME) { \
2501 MFPM.addPass(CREATE_PASS); \
2502 return Error::success(); \
2504#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2506 if (checkParametrizedPassName(Name, NAME)) { \
2507 auto Params = parsePassParameters(PARSER, Name, NAME); \
2509 return Params.takeError(); \
2510 MFPM.addPass(CREATE_PASS(Params.get())); \
2511 return Error::success(); \
2513#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2514 if (Name == "require<" NAME ">") { \
2516 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2517 MachineFunction>()); \
2518 return Error::success(); \
2520 if (Name == "invalidate<" NAME ">") { \
2521 MFPM.addPass(InvalidateAnalysisPass< \
2522 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2523 return Error::success(); \
2525#include "llvm/Passes/MachinePassRegistry.def"
2527 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2528 if (
C(Name, MFPM,
E.InnerPipeline))
2531 formatv(
"unknown machine pass '{}'", Name).str(),
2536#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2537 if (Name == NAME) { \
2538 AA.registerModuleAnalysis< \
2539 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2542#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2543 if (Name == NAME) { \
2544 AA.registerFunctionAnalysis< \
2545 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2548#include "PassRegistry.def"
2550 for (
auto &
C : AAParsingCallbacks)
2556Error PassBuilder::parseMachinePassPipeline(
2558 for (
const auto &Element : Pipeline) {
2559 if (
auto Err = parseMachinePass(MFPM, Element))
2567 for (
const auto &Element : Pipeline) {
2568 if (
auto Err = parseLoopPass(LPM, Element))
2574Error PassBuilder::parseFunctionPassPipeline(
2576 for (
const auto &Element : Pipeline) {
2577 if (
auto Err = parseFunctionPass(FPM, Element))
2585 for (
const auto &Element : Pipeline) {
2586 if (
auto Err = parseCGSCCPass(CGPM, Element))
2618 for (
const auto &Element : Pipeline) {
2619 if (
auto Err = parseModulePass(MPM, Element))
2630 auto Pipeline = parsePipelineText(PipelineText);
2631 if (!Pipeline || Pipeline->empty())
2633 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2643 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2645 FunctionPipelineParsingCallbacks)) {
2646 Pipeline = {{
"function", std::move(*Pipeline)}};
2649 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2650 std::move(*Pipeline)}}}};
2651 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2653 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2654 std::move(*Pipeline)}}}};
2656 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2657 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2659 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2660 if (
C(MPM, *Pipeline))
2664 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2666 formatv(
"unknown {} name '{}'",
2667 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2673 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2681 auto Pipeline = parsePipelineText(PipelineText);
2682 if (!Pipeline || Pipeline->empty())
2684 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2690 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2695 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2704 auto Pipeline = parsePipelineText(PipelineText);
2705 if (!Pipeline || Pipeline->empty())
2707 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2713 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2718 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2726 auto Pipeline = parsePipelineText(PipelineText);
2727 if (!Pipeline || Pipeline->empty())
2729 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2732 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2740 auto Pipeline = parsePipelineText(PipelineText);
2741 if (!Pipeline || Pipeline->empty())
2743 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2746 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2755 if (PipelineText ==
"default") {
2760 while (!PipelineText.
empty()) {
2762 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2763 if (!parseAAPassName(
AA, Name))
2765 formatv(
"unknown alias analysis name '{}'", Name).str(),
2772std::optional<RegAllocFilterFunc>
2774 if (FilterName ==
"all")
2776 for (
auto &
C : RegClassFilterParsingCallbacks)
2777 if (
auto F =
C(FilterName))
2779 return std::nullopt;
2787 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2793 OS <<
"Module passes:\n";
2794#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2795#include "PassRegistry.def"
2797 OS <<
"Module passes with params:\n";
2798#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2799 printPassName(NAME, PARAMS, OS);
2800#include "PassRegistry.def"
2802 OS <<
"Module analyses:\n";
2803#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2804#include "PassRegistry.def"
2806 OS <<
"Module alias analyses:\n";
2807#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2808#include "PassRegistry.def"
2810 OS <<
"CGSCC passes:\n";
2811#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2812#include "PassRegistry.def"
2814 OS <<
"CGSCC passes with params:\n";
2815#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2816 printPassName(NAME, PARAMS, OS);
2817#include "PassRegistry.def"
2819 OS <<
"CGSCC analyses:\n";
2820#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2821#include "PassRegistry.def"
2823 OS <<
"Function passes:\n";
2824#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2825#include "PassRegistry.def"
2827 OS <<
"Function passes with params:\n";
2828#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2829 printPassName(NAME, PARAMS, OS);
2830#include "PassRegistry.def"
2832 OS <<
"Function analyses:\n";
2833#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2834#include "PassRegistry.def"
2836 OS <<
"Function alias analyses:\n";
2837#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2838#include "PassRegistry.def"
2840 OS <<
"LoopNest passes:\n";
2841#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2842#include "PassRegistry.def"
2844 OS <<
"Loop passes:\n";
2845#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2846#include "PassRegistry.def"
2848 OS <<
"Loop passes with params:\n";
2849#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2850 printPassName(NAME, PARAMS, OS);
2851#include "PassRegistry.def"
2853 OS <<
"Loop analyses:\n";
2854#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2855#include "PassRegistry.def"
2857 OS <<
"Machine module passes (WIP):\n";
2858#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2859#include "llvm/Passes/MachinePassRegistry.def"
2861 OS <<
"Machine function passes (WIP):\n";
2862#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2863#include "llvm/Passes/MachinePassRegistry.def"
2865 OS <<
"Machine function analyses (WIP):\n";
2866#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2867#include "llvm/Passes/MachinePassRegistry.def"
2873 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.
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.
ArrayRef - 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".
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.
StringRef - 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
str - 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
empty - Check if the string is empty.
char front() const
front - 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.
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.
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.
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 to automatically provide informational APIs needed for passes.
RegAllocFilterFunc Filter