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 while (!Params.
empty()) {
822 std::tie(ParamName, Params) = Params.
split(
';');
823 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
825 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
832 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
839 if (ParamName ==
"partial") {
841 }
else if (ParamName ==
"peeling") {
843 }
else if (ParamName ==
"profile-peeling") {
845 }
else if (ParamName ==
"runtime") {
847 }
else if (ParamName ==
"upperbound") {
851 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
860 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
880 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
889 "EntryExitInstrumenter");
894 "DropUnnecessaryAssumes");
903 "LowerMatrixIntrinsics");
908 while (!Params.
empty()) {
910 std::tie(ParamName, Params) = Params.
split(
';');
913 if (ParamName ==
"preserve-order")
915 else if (ParamName ==
"rename-all")
917 else if (ParamName ==
"fold-all")
919 else if (ParamName ==
"reorder-operands")
923 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
933 while (!Params.
empty()) {
935 std::tie(ParamName, Params) = Params.
split(
';');
937 if (ParamName ==
"kernel") {
938 Result.CompileKernel =
true;
939 }
else if (ParamName ==
"use-after-scope") {
940 Result.UseAfterScope =
true;
943 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
953 while (!Params.
empty()) {
955 std::tie(ParamName, Params) = Params.
split(
';');
957 if (ParamName ==
"recover") {
959 }
else if (ParamName ==
"kernel") {
960 Result.CompileKernel =
true;
963 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
972parseDropTypeTestsPassOptions(
StringRef Params) {
974 while (!Params.
empty()) {
976 std::tie(ParamName, Params) = Params.
split(
';');
978 if (ParamName ==
"all") {
980 }
else if (ParamName ==
"assume") {
984 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
993 while (!Params.
empty()) {
995 std::tie(ParamName, Params) = Params.
split(
';');
997 if (ParamName ==
"thinlto") {
999 }
else if (ParamName ==
"emit-summary") {
1000 Result.EmitLTOSummary =
true;
1003 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1011parseLowerAllowCheckPassOptions(
StringRef Params) {
1013 while (!Params.
empty()) {
1015 std::tie(ParamName, Params) = Params.
split(
';');
1026 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1033 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1038 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1040 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1041 IndicesStr, CutoffStr)
1045 while (IndicesStr !=
"") {
1047 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1053 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1054 firstIndexStr, IndicesStr)
1061 if (index >=
Result.cutoffs.size())
1062 Result.cutoffs.resize(index + 1, 0);
1064 Result.cutoffs[index] = cutoff;
1066 }
else if (ParamName.
starts_with(
"runtime_check")) {
1068 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1072 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1074 ValueString, Params)
1078 Result.runtime_check = runtime_check;
1081 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1092 while (!Params.
empty()) {
1094 std::tie(ParamName, Params) = Params.
split(
';');
1096 if (ParamName ==
"recover") {
1098 }
else if (ParamName ==
"kernel") {
1103 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1108 }
else if (ParamName ==
"eager-checks") {
1109 Result.EagerChecks =
true;
1112 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1122 while (!Params.
empty()) {
1124 std::tie(ParamName, Params) = Params.
split(
';');
1131 formatv(
"invalid argument to AllocToken pass mode "
1138 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1148 while (!Params.
empty()) {
1150 std::tie(ParamName, Params) = Params.
split(
';');
1153 if (ParamName ==
"speculate-blocks") {
1155 }
else if (ParamName ==
"simplify-cond-branch") {
1157 }
else if (ParamName ==
"forward-switch-cond") {
1159 }
else if (ParamName ==
"switch-range-to-icmp") {
1161 }
else if (ParamName ==
"switch-to-arithmetic") {
1163 }
else if (ParamName ==
"switch-to-lookup") {
1165 }
else if (ParamName ==
"keep-loops") {
1167 }
else if (ParamName ==
"hoist-common-insts") {
1169 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1171 }
else if (ParamName ==
"sink-common-insts") {
1173 }
else if (ParamName ==
"speculate-unpredictables") {
1176 APInt BonusInstThreshold;
1179 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1187 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1198 Result.setVerifyFixpoint(
true);
1199 while (!Params.
empty()) {
1201 std::tie(ParamName, Params) = Params.
split(
';');
1204 if (ParamName ==
"verify-fixpoint") {
1207 APInt MaxIterations;
1210 formatv(
"invalid argument to InstCombine pass max-iterations "
1218 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1228 while (!Params.
empty()) {
1230 std::tie(ParamName, Params) = Params.
split(
';');
1233 if (ParamName ==
"interleave-forced-only") {
1235 }
else if (ParamName ==
"vectorize-forced-only") {
1239 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1247 std::pair<bool, bool>
Result = {
false,
true};
1248 while (!Params.
empty()) {
1250 std::tie(ParamName, Params) = Params.
split(
';');
1253 if (ParamName ==
"nontrivial") {
1255 }
else if (ParamName ==
"trivial") {
1259 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1268 while (!Params.
empty()) {
1270 std::tie(ParamName, Params) = Params.
split(
';');
1273 if (ParamName ==
"allowspeculation") {
1277 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1284struct LoopRotateOptions {
1285 bool EnableHeaderDuplication =
true;
1286 bool PrepareForLTO =
false;
1287 bool CheckExitCount =
false;
1291 LoopRotateOptions
Result;
1292 while (!Params.
empty()) {
1294 std::tie(ParamName, Params) = Params.
split(
';');
1297 if (ParamName ==
"header-duplication") {
1299 }
else if (ParamName ==
"prepare-for-lto") {
1301 }
else if (ParamName ==
"check-exit-count") {
1305 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1314 while (!Params.
empty()) {
1316 std::tie(ParamName, Params) = Params.
split(
';');
1319 if (ParamName ==
"split-footer-bb") {
1323 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1334 while (!Params.
empty()) {
1336 std::tie(ParamName, Params) = Params.
split(
';');
1339 if (ParamName ==
"pre") {
1341 }
else if (ParamName ==
"load-pre") {
1343 }
else if (ParamName ==
"split-backedge-load-pre") {
1345 }
else if (ParamName ==
"memdep") {
1349 }
else if (ParamName ==
"memoryssa") {
1355 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1364 while (!Params.
empty()) {
1366 std::tie(ParamName, Params) = Params.
split(
';');
1369 if (ParamName ==
"func-spec")
1373 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1381 while (!Params.
empty()) {
1383 std::tie(ParamName, Params) = Params.
split(
';');
1388 formatv(
"invalid argument to Scalarizer pass min-bits "
1399 if (ParamName ==
"load-store")
1401 else if (ParamName ==
"variable-insert-extract")
1405 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1414 if (Params.
empty() || Params ==
"modify-cfg")
1416 if (Params ==
"preserve-cfg")
1419 formatv(
"invalid SROA pass parameter '{}' (either preserve-cfg or "
1420 "modify-cfg can be specified)",
1427parseStackLifetimeOptions(
StringRef Params) {
1429 while (!Params.
empty()) {
1431 std::tie(ParamName, Params) = Params.
split(
';');
1433 if (ParamName ==
"may") {
1435 }
else if (ParamName ==
"must") {
1439 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1448 "DependenceAnalysisPrinter");
1453 "SeparateConstOffsetFromGEP");
1462parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1466 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1474 "MemorySSAPrinterPass");
1479 "SpeculativeExecutionPass");
1484 while (!Params.
empty()) {
1486 std::tie(ParamName, Params) = Params.
split(
';');
1492 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1500parseStructuralHashPrinterPassOptions(
StringRef Params) {
1503 if (Params ==
"detailed")
1505 if (Params ==
"call-target-ignored")
1508 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1514 "WinEHPreparePass");
1519 while (!Params.
empty()) {
1521 std::tie(ParamName, Params) = Params.
split(
';');
1524 if (ParamName ==
"group-by-use")
1526 else if (ParamName ==
"ignore-single-use")
1528 else if (ParamName ==
"merge-const")
1530 else if (ParamName ==
"merge-const-aggressive")
1532 else if (ParamName ==
"merge-external")
1537 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1541 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1550 while (!Params.
empty()) {
1552 std::tie(ParamName, Params) = Params.
split(
';');
1558 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1569 while (!Params.
empty()) {
1571 std::tie(ParamName, Params) = Params.
split(
';');
1574 std::optional<RegAllocFilterFunc>
Filter =
1578 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1587 if (ParamName ==
"no-clear-vregs") {
1593 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1600parseBoundsCheckingOptions(
StringRef Params) {
1602 while (!Params.
empty()) {
1604 std::tie(ParamName, Params) = Params.
split(
';');
1605 if (ParamName ==
"trap") {
1607 }
else if (ParamName ==
"rt") {
1613 }
else if (ParamName ==
"rt-abort") {
1619 }
else if (ParamName ==
"min-rt") {
1625 }
else if (ParamName ==
"min-rt-abort") {
1631 }
else if (ParamName ==
"merge") {
1633 }
else if (ParamName ==
"handler-preserve-all-regs") {
1635 Options.Rt->HandlerPreserveAllRegs =
true;
1639 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1645 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1662 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1664 Param.str().c_str());
1667 if (!
Level.has_value())
1669 "invalid optimization level for expand-ir-insts pass: %s",
1670 Digit.str().c_str());
1677 if (Params.
empty() || Params ==
"all")
1678 return RAGreedyPass::Options();
1682 return RAGreedyPass::Options{*
Filter, Params};
1685 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1691 "MachineSinkingPass");
1695 bool AllowTailMerge =
true;
1696 if (!Params.
empty()) {
1698 if (Params !=
"tail-merge")
1700 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1704 return AllowTailMerge;
1708 bool ClearVirtRegs =
true;
1709 if (!Params.
empty()) {
1711 if (Params !=
"clear-vregs")
1713 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1716 return ClearVirtRegs;
1719struct FatLTOOptions {
1720 OptimizationLevel OptLevel;
1721 bool ThinLTO =
false;
1722 bool EmitSummary =
false;
1727 bool HaveOptLevel =
false;
1728 while (!Params.
empty()) {
1730 std::tie(ParamName, Params) = Params.
split(
';');
1732 if (ParamName ==
"thinlto") {
1734 }
else if (ParamName ==
"emit-summary") {
1735 Result.EmitSummary =
true;
1736 }
else if (std::optional<OptimizationLevel> OptLevel =
1738 Result.OptLevel = *OptLevel;
1739 HaveOptLevel =
true;
1742 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1749 "missing optimization level for fatlto-pre-link pipeline",
1764template <
typename PassManagerT,
typename CallbacksT>
1766 if (!Callbacks.empty()) {
1767 PassManagerT DummyPM;
1768 for (
auto &CB : Callbacks)
1769 if (CB(Name, DummyPM, {}))
1775template <
typename CallbacksT>
1777 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1780 if (Name ==
"module")
1782 if (Name ==
"cgscc")
1784 if (NameNoBracket ==
"function")
1786 if (Name ==
"coro-cond")
1789#define MODULE_PASS(NAME, CREATE_PASS) \
1792#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1793 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1795#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1796 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1798#include "PassRegistry.def"
1803template <
typename CallbacksT>
1806 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1807 if (Name ==
"cgscc")
1809 if (NameNoBracket ==
"function")
1816#define CGSCC_PASS(NAME, CREATE_PASS) \
1819#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1820 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1822#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1823 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1825#include "PassRegistry.def"
1830template <
typename CallbacksT>
1833 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1834 if (NameNoBracket ==
"function")
1836 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1839#define FUNCTION_PASS(NAME, CREATE_PASS) \
1842#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1843 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1845#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1846 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1848#include "PassRegistry.def"
1853template <
typename CallbacksT>
1856 if (Name ==
"machine-function")
1859#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1862#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1864 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1867#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1868 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1871#include "llvm/Passes/MachinePassRegistry.def"
1876template <
typename CallbacksT>
1878 bool &UseMemorySSA) {
1879 UseMemorySSA =
false;
1882 UseMemorySSA =
true;
1886#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1889#include "PassRegistry.def"
1894template <
typename CallbacksT>
1896 bool &UseMemorySSA) {
1897 UseMemorySSA =
false;
1900 UseMemorySSA =
true;
1904#define LOOP_PASS(NAME, CREATE_PASS) \
1907#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1908 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1910#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1911 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1913#include "PassRegistry.def"
1918std::optional<std::vector<PassBuilder::PipelineElement>>
1919PassBuilder::parsePipelineText(
StringRef Text) {
1920 std::vector<PipelineElement> ResultPipeline;
1925 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1926 size_t Pos =
Text.find_first_of(
",()");
1927 Pipeline.push_back({
Text.substr(0, Pos), {}});
1930 if (Pos ==
Text.npos)
1933 char Sep =
Text[Pos];
1941 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1945 assert(Sep ==
')' &&
"Bogus separator!");
1950 if (PipelineStack.
size() == 1)
1951 return std::nullopt;
1954 }
while (
Text.consume_front(
")"));
1962 if (!
Text.consume_front(
","))
1963 return std::nullopt;
1966 if (PipelineStack.
size() > 1)
1968 return std::nullopt;
1970 assert(PipelineStack.
back() == &ResultPipeline &&
1971 "Wrong pipeline at the bottom of the stack!");
1972 return {std::move(ResultPipeline)};
1982 const PipelineElement &
E) {
1983 auto &
Name =
E.Name;
1984 auto &InnerPipeline =
E.InnerPipeline;
1987 if (!InnerPipeline.empty()) {
1988 if (Name ==
"module") {
1990 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
1992 MPM.
addPass(std::move(NestedMPM));
1995 if (Name ==
"coro-cond") {
1997 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
1999 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2002 if (Name ==
"cgscc") {
2004 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2012 "cannot have a no-rerun module to function adaptor",
2015 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2022 for (
auto &
C : ModulePipelineParsingCallbacks)
2023 if (
C(Name, MPM, InnerPipeline))
2028 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2034#define MODULE_PASS(NAME, CREATE_PASS) \
2035 if (Name == NAME) { \
2036 MPM.addPass(CREATE_PASS); \
2037 return Error::success(); \
2039#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2040 if (checkParametrizedPassName(Name, NAME)) { \
2041 auto Params = parsePassParameters(PARSER, Name, NAME); \
2043 return Params.takeError(); \
2044 MPM.addPass(CREATE_PASS(Params.get())); \
2045 return Error::success(); \
2047#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2048 if (Name == "require<" NAME ">") { \
2050 RequireAnalysisPass< \
2051 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2052 return Error::success(); \
2054 if (Name == "invalidate<" NAME ">") { \
2055 MPM.addPass(InvalidateAnalysisPass< \
2056 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2057 return Error::success(); \
2059#define CGSCC_PASS(NAME, CREATE_PASS) \
2060 if (Name == NAME) { \
2061 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2062 return Error::success(); \
2064#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2065 if (checkParametrizedPassName(Name, NAME)) { \
2066 auto Params = parsePassParameters(PARSER, Name, NAME); \
2068 return Params.takeError(); \
2070 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2071 return Error::success(); \
2073#define FUNCTION_PASS(NAME, CREATE_PASS) \
2074 if (Name == NAME) { \
2075 if constexpr (std::is_constructible_v< \
2076 std::remove_reference_t<decltype(CREATE_PASS)>, \
2077 const TargetMachine &>) { \
2079 return make_error<StringError>( \
2080 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2081 inconvertibleErrorCode()); \
2083 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2084 return Error::success(); \
2086#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2087 if (checkParametrizedPassName(Name, NAME)) { \
2088 auto Params = parsePassParameters(PARSER, Name, NAME); \
2090 return Params.takeError(); \
2091 auto CreatePass = CREATE_PASS; \
2092 if constexpr (std::is_constructible_v< \
2093 std::remove_reference_t<decltype(CreatePass( \
2095 const TargetMachine &, \
2096 std::remove_reference_t<decltype(Params.get())>>) { \
2098 return make_error<StringError>( \
2099 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2100 inconvertibleErrorCode()); \
2103 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2104 return Error::success(); \
2106#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2107 if (Name == NAME) { \
2108 MPM.addPass(createModuleToFunctionPassAdaptor( \
2109 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2110 return Error::success(); \
2112#define LOOP_PASS(NAME, CREATE_PASS) \
2113 if (Name == NAME) { \
2114 MPM.addPass(createModuleToFunctionPassAdaptor( \
2115 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2116 return Error::success(); \
2118#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2119 if (checkParametrizedPassName(Name, NAME)) { \
2120 auto Params = parsePassParameters(PARSER, Name, NAME); \
2122 return Params.takeError(); \
2123 MPM.addPass(createModuleToFunctionPassAdaptor( \
2124 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2125 return Error::success(); \
2127#include "PassRegistry.def"
2129 for (
auto &
C : ModulePipelineParsingCallbacks)
2130 if (
C(Name, MPM, InnerPipeline))
2133 formatv(
"unknown module pass '{}'", Name).str(),
2138 const PipelineElement &
E) {
2139 auto &
Name =
E.Name;
2140 auto &InnerPipeline =
E.InnerPipeline;
2143 if (!InnerPipeline.empty()) {
2144 if (Name ==
"cgscc") {
2146 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2149 CGPM.
addPass(std::move(NestedCGPM));
2154 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2158 std::move(FPM), Params->first, Params->second));
2163 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2170 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2171 if (
C(Name, CGPM, InnerPipeline))
2176 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2181#define CGSCC_PASS(NAME, CREATE_PASS) \
2182 if (Name == NAME) { \
2183 CGPM.addPass(CREATE_PASS); \
2184 return Error::success(); \
2186#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2187 if (checkParametrizedPassName(Name, NAME)) { \
2188 auto Params = parsePassParameters(PARSER, Name, NAME); \
2190 return Params.takeError(); \
2191 CGPM.addPass(CREATE_PASS(Params.get())); \
2192 return Error::success(); \
2194#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2195 if (Name == "require<" NAME ">") { \
2196 CGPM.addPass(RequireAnalysisPass< \
2197 std::remove_reference_t<decltype(CREATE_PASS)>, \
2198 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2199 CGSCCUpdateResult &>()); \
2200 return Error::success(); \
2202 if (Name == "invalidate<" NAME ">") { \
2203 CGPM.addPass(InvalidateAnalysisPass< \
2204 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2205 return Error::success(); \
2207#define FUNCTION_PASS(NAME, CREATE_PASS) \
2208 if (Name == NAME) { \
2209 if constexpr (std::is_constructible_v< \
2210 std::remove_reference_t<decltype(CREATE_PASS)>, \
2211 const TargetMachine &>) { \
2213 return make_error<StringError>( \
2214 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2215 inconvertibleErrorCode()); \
2217 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2218 return Error::success(); \
2220#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2221 if (checkParametrizedPassName(Name, NAME)) { \
2222 auto Params = parsePassParameters(PARSER, Name, NAME); \
2224 return Params.takeError(); \
2225 auto CreatePass = CREATE_PASS; \
2226 if constexpr (std::is_constructible_v< \
2227 std::remove_reference_t<decltype(CreatePass( \
2229 const TargetMachine &, \
2230 std::remove_reference_t<decltype(Params.get())>>) { \
2232 return make_error<StringError>( \
2233 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2234 inconvertibleErrorCode()); \
2237 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2238 return Error::success(); \
2240#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2241 if (Name == NAME) { \
2242 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2243 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2244 return Error::success(); \
2246#define LOOP_PASS(NAME, CREATE_PASS) \
2247 if (Name == NAME) { \
2248 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2249 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2250 return Error::success(); \
2252#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2253 if (checkParametrizedPassName(Name, NAME)) { \
2254 auto Params = parsePassParameters(PARSER, Name, NAME); \
2256 return Params.takeError(); \
2257 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2258 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2259 return Error::success(); \
2261#include "PassRegistry.def"
2263 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2264 if (
C(Name, CGPM, InnerPipeline))
2271 const PipelineElement &
E) {
2272 auto &
Name =
E.Name;
2273 auto &InnerPipeline =
E.InnerPipeline;
2276 if (!InnerPipeline.empty()) {
2277 if (Name ==
"function") {
2279 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2282 FPM.
addPass(std::move(NestedFPM));
2285 if (Name ==
"loop" || Name ==
"loop-mssa") {
2287 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2290 bool UseMemorySSA = (
Name ==
"loop-mssa");
2295 if (Name ==
"machine-function") {
2297 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2303 for (
auto &
C : FunctionPipelineParsingCallbacks)
2304 if (
C(Name, FPM, InnerPipeline))
2309 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2314#define FUNCTION_PASS(NAME, CREATE_PASS) \
2315 if (Name == NAME) { \
2316 if constexpr (std::is_constructible_v< \
2317 std::remove_reference_t<decltype(CREATE_PASS)>, \
2318 const TargetMachine &>) { \
2320 return make_error<StringError>( \
2321 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2322 inconvertibleErrorCode()); \
2324 FPM.addPass(CREATE_PASS); \
2325 return Error::success(); \
2327#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2328 if (checkParametrizedPassName(Name, NAME)) { \
2329 auto Params = parsePassParameters(PARSER, Name, NAME); \
2331 return Params.takeError(); \
2332 auto CreatePass = CREATE_PASS; \
2333 if constexpr (std::is_constructible_v< \
2334 std::remove_reference_t<decltype(CreatePass( \
2336 const TargetMachine &, \
2337 std::remove_reference_t<decltype(Params.get())>>) { \
2339 return make_error<StringError>( \
2340 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2341 inconvertibleErrorCode()); \
2344 FPM.addPass(CREATE_PASS(Params.get())); \
2345 return Error::success(); \
2347#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2348 if (Name == "require<" NAME ">") { \
2349 if constexpr (std::is_constructible_v< \
2350 std::remove_reference_t<decltype(CREATE_PASS)>, \
2351 const TargetMachine &>) { \
2353 return make_error<StringError>( \
2354 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2355 inconvertibleErrorCode()); \
2358 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2360 return Error::success(); \
2362 if (Name == "invalidate<" NAME ">") { \
2363 FPM.addPass(InvalidateAnalysisPass< \
2364 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2365 return Error::success(); \
2371#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2372 if (Name == NAME) { \
2373 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2374 return Error::success(); \
2376#define LOOP_PASS(NAME, CREATE_PASS) \
2377 if (Name == NAME) { \
2378 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2379 return Error::success(); \
2381#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2382 if (checkParametrizedPassName(Name, NAME)) { \
2383 auto Params = parsePassParameters(PARSER, Name, NAME); \
2385 return Params.takeError(); \
2387 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2388 return Error::success(); \
2390#include "PassRegistry.def"
2392 for (
auto &
C : FunctionPipelineParsingCallbacks)
2393 if (
C(Name, FPM, InnerPipeline))
2396 formatv(
"unknown function pass '{}'", Name).str(),
2401 const PipelineElement &
E) {
2402 StringRef
Name =
E.Name;
2403 auto &InnerPipeline =
E.InnerPipeline;
2406 if (!InnerPipeline.empty()) {
2407 if (Name ==
"loop") {
2409 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2412 LPM.addPass(std::move(NestedLPM));
2416 for (
auto &
C : LoopPipelineParsingCallbacks)
2417 if (
C(Name, LPM, InnerPipeline))
2422 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2427#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2428 if (Name == NAME) { \
2429 LPM.addPass(CREATE_PASS); \
2430 return Error::success(); \
2432#define LOOP_PASS(NAME, CREATE_PASS) \
2433 if (Name == NAME) { \
2434 LPM.addPass(CREATE_PASS); \
2435 return Error::success(); \
2437#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2438 if (checkParametrizedPassName(Name, NAME)) { \
2439 auto Params = parsePassParameters(PARSER, Name, NAME); \
2441 return Params.takeError(); \
2442 LPM.addPass(CREATE_PASS(Params.get())); \
2443 return Error::success(); \
2445#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2446 if (Name == "require<" NAME ">") { \
2447 LPM.addPass(RequireAnalysisPass< \
2448 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2449 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2451 return Error::success(); \
2453 if (Name == "invalidate<" NAME ">") { \
2454 LPM.addPass(InvalidateAnalysisPass< \
2455 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2456 return Error::success(); \
2458#include "PassRegistry.def"
2460 for (
auto &
C : LoopPipelineParsingCallbacks)
2461 if (
C(Name, LPM, InnerPipeline))
2468 const PipelineElement &
E) {
2469 StringRef
Name =
E.Name;
2471 if (!
E.InnerPipeline.empty()) {
2472 if (
E.Name ==
"machine-function") {
2474 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2476 MFPM.
addPass(std::move(NestedPM));
2483#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2484 if (Name == NAME) { \
2485 MFPM.addPass(CREATE_PASS); \
2486 return Error::success(); \
2488#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2489 if (Name == NAME) { \
2490 MFPM.addPass(CREATE_PASS); \
2491 return Error::success(); \
2493#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2495 if (checkParametrizedPassName(Name, NAME)) { \
2496 auto Params = parsePassParameters(PARSER, Name, NAME); \
2498 return Params.takeError(); \
2499 MFPM.addPass(CREATE_PASS(Params.get())); \
2500 return Error::success(); \
2502#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2503 if (Name == "require<" NAME ">") { \
2505 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2506 MachineFunction>()); \
2507 return Error::success(); \
2509 if (Name == "invalidate<" NAME ">") { \
2510 MFPM.addPass(InvalidateAnalysisPass< \
2511 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2512 return Error::success(); \
2514#include "llvm/Passes/MachinePassRegistry.def"
2516 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2517 if (
C(Name, MFPM,
E.InnerPipeline))
2520 formatv(
"unknown machine pass '{}'", Name).str(),
2525#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2526 if (Name == NAME) { \
2527 AA.registerModuleAnalysis< \
2528 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2531#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2532 if (Name == NAME) { \
2533 AA.registerFunctionAnalysis< \
2534 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2537#include "PassRegistry.def"
2539 for (
auto &
C : AAParsingCallbacks)
2545Error PassBuilder::parseMachinePassPipeline(
2547 for (
const auto &Element : Pipeline) {
2548 if (
auto Err = parseMachinePass(MFPM, Element))
2556 for (
const auto &Element : Pipeline) {
2557 if (
auto Err = parseLoopPass(LPM, Element))
2563Error PassBuilder::parseFunctionPassPipeline(
2565 for (
const auto &Element : Pipeline) {
2566 if (
auto Err = parseFunctionPass(FPM, Element))
2574 for (
const auto &Element : Pipeline) {
2575 if (
auto Err = parseCGSCCPass(CGPM, Element))
2607 for (
const auto &Element : Pipeline) {
2608 if (
auto Err = parseModulePass(MPM, Element))
2619 auto Pipeline = parsePipelineText(PipelineText);
2620 if (!Pipeline || Pipeline->empty())
2622 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2632 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2634 FunctionPipelineParsingCallbacks)) {
2635 Pipeline = {{
"function", std::move(*Pipeline)}};
2638 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2639 std::move(*Pipeline)}}}};
2640 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2642 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2643 std::move(*Pipeline)}}}};
2645 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2646 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2648 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2649 if (
C(MPM, *Pipeline))
2653 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2655 formatv(
"unknown {} name '{}'",
2656 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2662 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2670 auto Pipeline = parsePipelineText(PipelineText);
2671 if (!Pipeline || Pipeline->empty())
2673 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2679 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2684 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2693 auto Pipeline = parsePipelineText(PipelineText);
2694 if (!Pipeline || Pipeline->empty())
2696 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2702 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2707 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2715 auto Pipeline = parsePipelineText(PipelineText);
2716 if (!Pipeline || Pipeline->empty())
2718 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2721 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2729 auto Pipeline = parsePipelineText(PipelineText);
2730 if (!Pipeline || Pipeline->empty())
2732 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2735 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2744 if (PipelineText ==
"default") {
2749 while (!PipelineText.
empty()) {
2751 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2752 if (!parseAAPassName(
AA, Name))
2754 formatv(
"unknown alias analysis name '{}'", Name).str(),
2761std::optional<RegAllocFilterFunc>
2763 if (FilterName ==
"all")
2765 for (
auto &
C : RegClassFilterParsingCallbacks)
2766 if (
auto F =
C(FilterName))
2768 return std::nullopt;
2776 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2782 OS <<
"Module passes:\n";
2783#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2784#include "PassRegistry.def"
2786 OS <<
"Module passes with params:\n";
2787#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2788 printPassName(NAME, PARAMS, OS);
2789#include "PassRegistry.def"
2791 OS <<
"Module analyses:\n";
2792#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2793#include "PassRegistry.def"
2795 OS <<
"Module alias analyses:\n";
2796#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2797#include "PassRegistry.def"
2799 OS <<
"CGSCC passes:\n";
2800#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2801#include "PassRegistry.def"
2803 OS <<
"CGSCC passes with params:\n";
2804#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2805 printPassName(NAME, PARAMS, OS);
2806#include "PassRegistry.def"
2808 OS <<
"CGSCC analyses:\n";
2809#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2810#include "PassRegistry.def"
2812 OS <<
"Function passes:\n";
2813#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2814#include "PassRegistry.def"
2816 OS <<
"Function passes with params:\n";
2817#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2818 printPassName(NAME, PARAMS, OS);
2819#include "PassRegistry.def"
2821 OS <<
"Function analyses:\n";
2822#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2823#include "PassRegistry.def"
2825 OS <<
"Function alias analyses:\n";
2826#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2827#include "PassRegistry.def"
2829 OS <<
"LoopNest passes:\n";
2830#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2831#include "PassRegistry.def"
2833 OS <<
"Loop passes:\n";
2834#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2835#include "PassRegistry.def"
2837 OS <<
"Loop passes with params:\n";
2838#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2839 printPassName(NAME, PARAMS, OS);
2840#include "PassRegistry.def"
2842 OS <<
"Loop analyses:\n";
2843#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2844#include "PassRegistry.def"
2846 OS <<
"Machine module passes (WIP):\n";
2847#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2848#include "llvm/Passes/MachinePassRegistry.def"
2850 OS <<
"Machine function passes (WIP):\n";
2851#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2852#include "llvm/Passes/MachinePassRegistry.def"
2854 OS <<
"Machine function analyses (WIP):\n";
2855#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2856#include "llvm/Passes/MachinePassRegistry.def"
2862 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.
DXILDebugInfoMap run(Module &M)
DropTestKind
Specifies how to drop type tests.
@ All
Drop only llvm.assumes using type test value.
This is an optimization pass for GlobalISel generic memory operations.
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
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