396 "print-pipeline-passes",
397 cl::desc(
"Print a '-passes' compatible string describing the pipeline "
398 "(best-effort only)."));
409class TriggerCrashModulePass :
public PassInfoMixin<TriggerCrashModulePass> {
415 static StringRef
name() {
return "TriggerCrashModulePass"; }
418class TriggerCrashFunctionPass
425 static StringRef
name() {
return "TriggerCrashFunctionPass"; }
430class TriggerVerifierErrorPass
436 auto *PtrTy = PointerType::getUnqual(
M.getContext());
438 GlobalValue::LinkageTypes::InternalLinkage,
439 "__bad_alias",
nullptr, &M);
459 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
464class RequireAllMachineFunctionPropertiesPass
465 :
public PassInfoMixin<RequireAllMachineFunctionPropertiesPass> {
472 static MachineFunctionProperties getRequiredProperties() {
473 return MachineFunctionProperties()
475 .setFailsVerification()
480 .setRegBankSelected()
482 .setTiedOpsRewritten()
483 .setTracksDebugUserValues()
484 .setTracksLiveness();
486 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
492 if (S ==
"Os" || S ==
"Oz")
494 Twine(
"The optimization level \"") + S +
495 "\" is no longer supported. Use O2 in conjunction with the " +
496 (S ==
"Os" ?
"optsize" :
"minsize") +
" attribute instead.");
507 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
511 formatv(
"invalid optimization level '{}'", S).str(),
516 std::optional<PGOOptions> PGOOpt,
519 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
521 TM->registerPassBuilderCallbacks(*
this);
523 PIC->registerClassToPassNameCallback([
this, PIC]() {
527#define MODULE_PASS(NAME, CREATE_PASS) \
528 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
529#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
530 PIC->addClassToPassName(CLASS, NAME);
531#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
532 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
533#define FUNCTION_PASS(NAME, CREATE_PASS) \
534 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
535#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
536 PIC->addClassToPassName(CLASS, NAME);
537#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
538 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
539#define LOOPNEST_PASS(NAME, CREATE_PASS) \
540 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
541#define LOOP_PASS(NAME, CREATE_PASS) \
542 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
543#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
544 PIC->addClassToPassName(CLASS, NAME);
545#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
546 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
547#define CGSCC_PASS(NAME, CREATE_PASS) \
548 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
549#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
550 PIC->addClassToPassName(CLASS, NAME);
551#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
552 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
553#include "PassRegistry.def"
555#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
556 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
557#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
558 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
559#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
561 PIC->addClassToPassName(CLASS, NAME);
562#include "llvm/Passes/MachinePassRegistry.def"
570#define MODULE_CALLBACK(NAME, INVOKE) \
571 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
572 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
574 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
577 INVOKE(PM, L.get()); \
580#include "PassRegistry.def"
588#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
589 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
590 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
592 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
595 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
598#include "PassRegistry.def"
606#define FUNCTION_CALLBACK(NAME, INVOKE) \
607 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
608 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
610 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
613 INVOKE(PM, L.get()); \
616#include "PassRegistry.def"
624#define CGSCC_CALLBACK(NAME, INVOKE) \
625 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
626 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
628 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
631 INVOKE(PM, L.get()); \
634#include "PassRegistry.def"
642#define LOOP_CALLBACK(NAME, INVOKE) \
643 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
644 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
646 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
649 INVOKE(PM, L.get()); \
652#include "PassRegistry.def"
658#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
659 MAM.registerPass([&] { return CREATE_PASS; });
660#include "PassRegistry.def"
662 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
667#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
668 CGAM.registerPass([&] { return CREATE_PASS; });
669#include "PassRegistry.def"
671 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
681#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
682 if constexpr (std::is_constructible_v< \
683 std::remove_reference_t<decltype(CREATE_PASS)>, \
684 const TargetMachine &>) { \
686 FAM.registerPass([&] { return CREATE_PASS; }); \
688 FAM.registerPass([&] { return CREATE_PASS; }); \
690#include "PassRegistry.def"
692 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
699#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
700 MFAM.registerPass([&] { return CREATE_PASS; });
701#include "llvm/Passes/MachinePassRegistry.def"
703 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
708#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
709 LAM.registerPass([&] { return CREATE_PASS; });
710#include "PassRegistry.def"
712 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
716static std::optional<std::pair<bool, bool>>
718 std::pair<bool, bool> Params;
719 if (!Name.consume_front(
"function"))
723 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
725 while (!Name.empty()) {
726 auto [Front, Back] = Name.split(
';');
728 if (Front ==
"eager-inv")
730 else if (Front ==
"no-rerun")
731 Params.second =
true;
739 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
751 while (!Params.
empty()) {
753 std::tie(ParamName, Params) = Params.
split(
';');
755 if (ParamName == OptionName) {
772 while (!Params.
empty()) {
774 std::tie(ParamName, Params) = Params.
split(
';');
779 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
784 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
788 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
793 if (ParamName ==
"force-hardware-loops") {
795 }
else if (ParamName ==
"force-hardware-loop-phi") {
797 }
else if (ParamName ==
"force-nested-hardware-loop") {
799 }
else if (ParamName ==
"force-hardware-loop-guard") {
803 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
807 return HardwareLoopOpts;
819 "FunctionPropertiesStatisticsPass");
830 while (!Params.
empty()) {
832 std::tie(ParamName, Params) = Params.
split(
';');
833 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
835 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
842 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
849 if (ParamName ==
"partial") {
851 }
else if (ParamName ==
"peeling") {
853 }
else if (ParamName ==
"profile-peeling") {
855 }
else if (ParamName ==
"runtime") {
857 }
else if (ParamName ==
"upperbound") {
861 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
870 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
890 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
899 "EntryExitInstrumenter");
904 "DropUnnecessaryAssumes");
913 "LowerMatrixIntrinsics");
918 while (!Params.
empty()) {
920 std::tie(ParamName, Params) = Params.
split(
';');
923 if (ParamName ==
"preserve-order")
925 else if (ParamName ==
"rename-all")
927 else if (ParamName ==
"fold-all")
929 else if (ParamName ==
"reorder-operands")
933 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
943 while (!Params.
empty()) {
945 std::tie(ParamName, Params) = Params.
split(
';');
947 if (ParamName ==
"kernel") {
948 Result.CompileKernel =
true;
949 }
else if (ParamName ==
"use-after-scope") {
950 Result.UseAfterScope =
true;
953 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
963 while (!Params.
empty()) {
965 std::tie(ParamName, Params) = Params.
split(
';');
967 if (ParamName ==
"recover") {
969 }
else if (ParamName ==
"kernel") {
970 Result.CompileKernel =
true;
973 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
982parseDropTypeTestsPassOptions(
StringRef Params) {
984 while (!Params.
empty()) {
986 std::tie(ParamName, Params) = Params.
split(
';');
988 if (ParamName ==
"all") {
990 }
else if (ParamName ==
"assume") {
994 formatv(
"invalid DropTypeTestsPass parameter '{}'", ParamName).str(),
1003 while (!Params.
empty()) {
1005 std::tie(ParamName, Params) = Params.
split(
';');
1007 if (ParamName ==
"thinlto") {
1009 }
else if (ParamName ==
"emit-summary") {
1010 Result.EmitLTOSummary =
true;
1013 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1021parseLowerAllowCheckPassOptions(
StringRef Params) {
1023 while (!Params.
empty()) {
1025 std::tie(ParamName, Params) = Params.
split(
';');
1036 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1043 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1048 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1050 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1051 IndicesStr, CutoffStr)
1055 while (IndicesStr !=
"") {
1057 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1063 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1064 firstIndexStr, IndicesStr)
1071 if (index >=
Result.cutoffs.size())
1072 Result.cutoffs.resize(index + 1, 0);
1074 Result.cutoffs[index] = cutoff;
1076 }
else if (ParamName.
starts_with(
"runtime_check")) {
1078 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1082 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1084 ValueString, Params)
1088 Result.runtime_check = runtime_check;
1091 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1102 while (!Params.
empty()) {
1104 std::tie(ParamName, Params) = Params.
split(
';');
1106 if (ParamName ==
"recover") {
1108 }
else if (ParamName ==
"kernel") {
1113 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1118 }
else if (ParamName ==
"eager-checks") {
1119 Result.EagerChecks =
true;
1122 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1132 while (!Params.
empty()) {
1134 std::tie(ParamName, Params) = Params.
split(
';');
1141 formatv(
"invalid argument to AllocToken pass mode "
1148 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1158 while (!Params.
empty()) {
1160 std::tie(ParamName, Params) = Params.
split(
';');
1163 if (ParamName ==
"speculate-blocks") {
1165 }
else if (ParamName ==
"simplify-cond-branch") {
1167 }
else if (ParamName ==
"forward-switch-cond") {
1169 }
else if (ParamName ==
"switch-range-to-icmp") {
1171 }
else if (ParamName ==
"switch-to-arithmetic") {
1173 }
else if (ParamName ==
"switch-to-lookup") {
1175 }
else if (ParamName ==
"keep-loops") {
1177 }
else if (ParamName ==
"hoist-common-insts") {
1179 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1181 }
else if (ParamName ==
"sink-common-insts") {
1183 }
else if (ParamName ==
"speculate-unpredictables") {
1186 APInt BonusInstThreshold;
1189 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1197 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1208 Result.setVerifyFixpoint(
true);
1209 while (!Params.
empty()) {
1211 std::tie(ParamName, Params) = Params.
split(
';');
1214 if (ParamName ==
"verify-fixpoint") {
1217 APInt MaxIterations;
1220 formatv(
"invalid argument to InstCombine pass max-iterations "
1228 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1238 while (!Params.
empty()) {
1240 std::tie(ParamName, Params) = Params.
split(
';');
1243 if (ParamName ==
"interleave-forced-only") {
1245 }
else if (ParamName ==
"vectorize-forced-only") {
1249 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1257 std::pair<bool, bool>
Result = {
false,
true};
1258 while (!Params.
empty()) {
1260 std::tie(ParamName, Params) = Params.
split(
';');
1263 if (ParamName ==
"nontrivial") {
1265 }
else if (ParamName ==
"trivial") {
1269 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1278 while (!Params.
empty()) {
1280 std::tie(ParamName, Params) = Params.
split(
';');
1283 if (ParamName ==
"allowspeculation") {
1287 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1294struct LoopRotateOptions {
1295 bool EnableHeaderDuplication =
true;
1296 bool PrepareForLTO =
false;
1297 bool CheckExitCount =
false;
1301 LoopRotateOptions
Result;
1302 while (!Params.
empty()) {
1304 std::tie(ParamName, Params) = Params.
split(
';');
1307 if (ParamName ==
"header-duplication") {
1309 }
else if (ParamName ==
"prepare-for-lto") {
1311 }
else if (ParamName ==
"check-exit-count") {
1315 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1324 while (!Params.
empty()) {
1326 std::tie(ParamName, Params) = Params.
split(
';');
1329 if (ParamName ==
"split-footer-bb") {
1333 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1344 while (!Params.
empty()) {
1346 std::tie(ParamName, Params) = Params.
split(
';');
1349 if (ParamName ==
"pre") {
1351 }
else if (ParamName ==
"load-pre") {
1353 }
else if (ParamName ==
"split-backedge-load-pre") {
1355 }
else if (ParamName ==
"memdep") {
1359 }
else if (ParamName ==
"memoryssa") {
1365 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1374 while (!Params.
empty()) {
1376 std::tie(ParamName, Params) = Params.
split(
';');
1379 if (ParamName ==
"func-spec")
1383 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1391 while (!Params.
empty()) {
1393 std::tie(ParamName, Params) = Params.
split(
';');
1398 formatv(
"invalid argument to Scalarizer pass min-bits "
1409 if (ParamName ==
"load-store")
1411 else if (ParamName ==
"variable-insert-extract")
1415 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1424 if (Params.
empty() || Params ==
"modify-cfg")
1426 if (Params ==
"preserve-cfg")
1429 formatv(
"invalid SROA pass parameter '{}' (either preserve-cfg or "
1430 "modify-cfg can be specified)",
1437parseStackLifetimeOptions(
StringRef Params) {
1439 while (!Params.
empty()) {
1441 std::tie(ParamName, Params) = Params.
split(
';');
1443 if (ParamName ==
"may") {
1445 }
else if (ParamName ==
"must") {
1449 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1458 "DependenceAnalysisPrinter");
1463 "SeparateConstOffsetFromGEP");
1472parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1476 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1484 "MemorySSAPrinterPass");
1489 "SpeculativeExecutionPass");
1494 while (!Params.
empty()) {
1496 std::tie(ParamName, Params) = Params.
split(
';');
1502 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1510parseStructuralHashPrinterPassOptions(
StringRef Params) {
1513 if (Params ==
"detailed")
1515 if (Params ==
"call-target-ignored")
1518 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1524 "WinEHPreparePass");
1529 while (!Params.
empty()) {
1531 std::tie(ParamName, Params) = Params.
split(
';');
1534 if (ParamName ==
"group-by-use")
1536 else if (ParamName ==
"ignore-single-use")
1538 else if (ParamName ==
"merge-const")
1540 else if (ParamName ==
"merge-const-aggressive")
1542 else if (ParamName ==
"merge-external")
1547 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1551 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1560 while (!Params.
empty()) {
1562 std::tie(ParamName, Params) = Params.
split(
';');
1568 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1579 while (!Params.
empty()) {
1581 std::tie(ParamName, Params) = Params.
split(
';');
1584 std::optional<RegAllocFilterFunc>
Filter =
1588 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1597 if (ParamName ==
"no-clear-vregs") {
1603 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1610parseBoundsCheckingOptions(
StringRef Params) {
1612 while (!Params.
empty()) {
1614 std::tie(ParamName, Params) = Params.
split(
';');
1615 if (ParamName ==
"trap") {
1617 }
else if (ParamName ==
"rt") {
1623 }
else if (ParamName ==
"rt-abort") {
1629 }
else if (ParamName ==
"min-rt") {
1635 }
else if (ParamName ==
"min-rt-abort") {
1641 }
else if (ParamName ==
"merge") {
1643 }
else if (ParamName ==
"handler-preserve-all-regs") {
1645 Options.Rt->HandlerPreserveAllRegs =
true;
1649 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1655 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1672 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1674 Param.str().c_str());
1677 if (!
Level.has_value())
1679 "invalid optimization level for expand-ir-insts pass: %s",
1680 Digit.str().c_str());
1687 if (Params.
empty() || Params ==
"all")
1688 return RAGreedyPass::Options();
1692 return RAGreedyPass::Options{*
Filter, Params};
1695 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1701 "MachineSinkingPass");
1705 bool AllowTailMerge =
true;
1706 if (!Params.
empty()) {
1708 if (Params !=
"tail-merge")
1710 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1714 return AllowTailMerge;
1718 bool ClearVirtRegs =
true;
1719 if (!Params.
empty()) {
1721 if (Params !=
"clear-vregs")
1723 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1726 return ClearVirtRegs;
1729struct FatLTOOptions {
1730 OptimizationLevel OptLevel;
1731 bool ThinLTO =
false;
1732 bool EmitSummary =
false;
1737 bool HaveOptLevel =
false;
1738 while (!Params.
empty()) {
1740 std::tie(ParamName, Params) = Params.
split(
';');
1742 if (ParamName ==
"thinlto") {
1744 }
else if (ParamName ==
"emit-summary") {
1745 Result.EmitSummary =
true;
1746 }
else if (std::optional<OptimizationLevel> OptLevel =
1748 Result.OptLevel = *OptLevel;
1749 HaveOptLevel =
true;
1752 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1759 "missing optimization level for fatlto-pre-link pipeline",
1774template <
typename PassManagerT,
typename CallbacksT>
1776 if (!Callbacks.empty()) {
1777 PassManagerT DummyPM;
1778 for (
auto &CB : Callbacks)
1779 if (CB(Name, DummyPM, {}))
1785template <
typename CallbacksT>
1787 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1790 if (Name ==
"module")
1792 if (Name ==
"cgscc")
1794 if (NameNoBracket ==
"function")
1796 if (Name ==
"coro-cond")
1799#define MODULE_PASS(NAME, CREATE_PASS) \
1802#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1803 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1805#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1806 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1808#include "PassRegistry.def"
1813template <
typename CallbacksT>
1816 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1817 if (Name ==
"cgscc")
1819 if (NameNoBracket ==
"function")
1826#define CGSCC_PASS(NAME, CREATE_PASS) \
1829#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1830 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1832#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1833 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1835#include "PassRegistry.def"
1840template <
typename CallbacksT>
1843 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1844 if (NameNoBracket ==
"function")
1846 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1849#define FUNCTION_PASS(NAME, CREATE_PASS) \
1852#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1853 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1855#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1856 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1858#include "PassRegistry.def"
1863template <
typename CallbacksT>
1866 if (Name ==
"machine-function")
1869#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1872#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1874 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1877#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1878 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1881#include "llvm/Passes/MachinePassRegistry.def"
1886template <
typename CallbacksT>
1888 bool &UseMemorySSA) {
1889 UseMemorySSA =
false;
1892 UseMemorySSA =
true;
1896#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1899#include "PassRegistry.def"
1904template <
typename CallbacksT>
1906 bool &UseMemorySSA) {
1907 UseMemorySSA =
false;
1910 UseMemorySSA =
true;
1914#define LOOP_PASS(NAME, CREATE_PASS) \
1917#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1918 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1920#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1921 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1923#include "PassRegistry.def"
1928std::optional<std::vector<PassBuilder::PipelineElement>>
1929PassBuilder::parsePipelineText(
StringRef Text) {
1930 std::vector<PipelineElement> ResultPipeline;
1935 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1936 size_t Pos =
Text.find_first_of(
",()");
1937 Pipeline.push_back({
Text.substr(0, Pos), {}});
1940 if (Pos ==
Text.npos)
1943 char Sep =
Text[Pos];
1951 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1955 assert(Sep ==
')' &&
"Bogus separator!");
1960 if (PipelineStack.
size() == 1)
1961 return std::nullopt;
1964 }
while (
Text.consume_front(
")"));
1972 if (!
Text.consume_front(
","))
1973 return std::nullopt;
1976 if (PipelineStack.
size() > 1)
1978 return std::nullopt;
1980 assert(PipelineStack.
back() == &ResultPipeline &&
1981 "Wrong pipeline at the bottom of the stack!");
1982 return {std::move(ResultPipeline)};
1992 const PipelineElement &
E) {
1993 auto &
Name =
E.Name;
1994 auto &InnerPipeline =
E.InnerPipeline;
1997 if (!InnerPipeline.empty()) {
1998 if (Name ==
"module") {
2000 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2002 MPM.
addPass(std::move(NestedMPM));
2005 if (Name ==
"coro-cond") {
2007 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2009 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2012 if (Name ==
"cgscc") {
2014 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2022 "cannot have a no-rerun module to function adaptor",
2025 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2032 for (
auto &
C : ModulePipelineParsingCallbacks)
2033 if (
C(Name, MPM, InnerPipeline))
2038 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2044#define MODULE_PASS(NAME, CREATE_PASS) \
2045 if (Name == NAME) { \
2046 MPM.addPass(CREATE_PASS); \
2047 return Error::success(); \
2049#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2050 if (checkParametrizedPassName(Name, NAME)) { \
2051 auto Params = parsePassParameters(PARSER, Name, NAME); \
2053 return Params.takeError(); \
2054 MPM.addPass(CREATE_PASS(Params.get())); \
2055 return Error::success(); \
2057#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2058 if (Name == "require<" NAME ">") { \
2060 RequireAnalysisPass< \
2061 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2062 return Error::success(); \
2064 if (Name == "invalidate<" NAME ">") { \
2065 MPM.addPass(InvalidateAnalysisPass< \
2066 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2067 return Error::success(); \
2069#define CGSCC_PASS(NAME, CREATE_PASS) \
2070 if (Name == NAME) { \
2071 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2072 return Error::success(); \
2074#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2075 if (checkParametrizedPassName(Name, NAME)) { \
2076 auto Params = parsePassParameters(PARSER, Name, NAME); \
2078 return Params.takeError(); \
2080 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2081 return Error::success(); \
2083#define FUNCTION_PASS(NAME, CREATE_PASS) \
2084 if (Name == NAME) { \
2085 if constexpr (std::is_constructible_v< \
2086 std::remove_reference_t<decltype(CREATE_PASS)>, \
2087 const TargetMachine &>) { \
2089 return make_error<StringError>( \
2090 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2091 inconvertibleErrorCode()); \
2093 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2094 return Error::success(); \
2096#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2097 if (checkParametrizedPassName(Name, NAME)) { \
2098 auto Params = parsePassParameters(PARSER, Name, NAME); \
2100 return Params.takeError(); \
2101 auto CreatePass = CREATE_PASS; \
2102 if constexpr (std::is_constructible_v< \
2103 std::remove_reference_t<decltype(CreatePass( \
2105 const TargetMachine &, \
2106 std::remove_reference_t<decltype(Params.get())>>) { \
2108 return make_error<StringError>( \
2109 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2110 inconvertibleErrorCode()); \
2113 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2114 return Error::success(); \
2116#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2117 if (Name == NAME) { \
2118 MPM.addPass(createModuleToFunctionPassAdaptor( \
2119 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2120 return Error::success(); \
2122#define LOOP_PASS(NAME, CREATE_PASS) \
2123 if (Name == NAME) { \
2124 MPM.addPass(createModuleToFunctionPassAdaptor( \
2125 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2126 return Error::success(); \
2128#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2129 if (checkParametrizedPassName(Name, NAME)) { \
2130 auto Params = parsePassParameters(PARSER, Name, NAME); \
2132 return Params.takeError(); \
2133 MPM.addPass(createModuleToFunctionPassAdaptor( \
2134 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2135 return Error::success(); \
2137#include "PassRegistry.def"
2139 for (
auto &
C : ModulePipelineParsingCallbacks)
2140 if (
C(Name, MPM, InnerPipeline))
2143 formatv(
"unknown module pass '{}'", Name).str(),
2148 const PipelineElement &
E) {
2149 auto &
Name =
E.Name;
2150 auto &InnerPipeline =
E.InnerPipeline;
2153 if (!InnerPipeline.empty()) {
2154 if (Name ==
"cgscc") {
2156 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2159 CGPM.
addPass(std::move(NestedCGPM));
2164 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2168 std::move(FPM), Params->first, Params->second));
2173 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2180 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2181 if (
C(Name, CGPM, InnerPipeline))
2186 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2191#define CGSCC_PASS(NAME, CREATE_PASS) \
2192 if (Name == NAME) { \
2193 CGPM.addPass(CREATE_PASS); \
2194 return Error::success(); \
2196#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2197 if (checkParametrizedPassName(Name, NAME)) { \
2198 auto Params = parsePassParameters(PARSER, Name, NAME); \
2200 return Params.takeError(); \
2201 CGPM.addPass(CREATE_PASS(Params.get())); \
2202 return Error::success(); \
2204#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2205 if (Name == "require<" NAME ">") { \
2206 CGPM.addPass(RequireAnalysisPass< \
2207 std::remove_reference_t<decltype(CREATE_PASS)>, \
2208 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2209 CGSCCUpdateResult &>()); \
2210 return Error::success(); \
2212 if (Name == "invalidate<" NAME ">") { \
2213 CGPM.addPass(InvalidateAnalysisPass< \
2214 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2215 return Error::success(); \
2217#define FUNCTION_PASS(NAME, CREATE_PASS) \
2218 if (Name == NAME) { \
2219 if constexpr (std::is_constructible_v< \
2220 std::remove_reference_t<decltype(CREATE_PASS)>, \
2221 const TargetMachine &>) { \
2223 return make_error<StringError>( \
2224 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2225 inconvertibleErrorCode()); \
2227 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2228 return Error::success(); \
2230#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2231 if (checkParametrizedPassName(Name, NAME)) { \
2232 auto Params = parsePassParameters(PARSER, Name, NAME); \
2234 return Params.takeError(); \
2235 auto CreatePass = CREATE_PASS; \
2236 if constexpr (std::is_constructible_v< \
2237 std::remove_reference_t<decltype(CreatePass( \
2239 const TargetMachine &, \
2240 std::remove_reference_t<decltype(Params.get())>>) { \
2242 return make_error<StringError>( \
2243 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2244 inconvertibleErrorCode()); \
2247 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2248 return Error::success(); \
2250#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2251 if (Name == NAME) { \
2252 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2253 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2254 return Error::success(); \
2256#define LOOP_PASS(NAME, CREATE_PASS) \
2257 if (Name == NAME) { \
2258 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2259 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2260 return Error::success(); \
2262#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2263 if (checkParametrizedPassName(Name, NAME)) { \
2264 auto Params = parsePassParameters(PARSER, Name, NAME); \
2266 return Params.takeError(); \
2267 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2268 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2269 return Error::success(); \
2271#include "PassRegistry.def"
2273 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2274 if (
C(Name, CGPM, InnerPipeline))
2281 const PipelineElement &
E) {
2282 auto &
Name =
E.Name;
2283 auto &InnerPipeline =
E.InnerPipeline;
2286 if (!InnerPipeline.empty()) {
2287 if (Name ==
"function") {
2289 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2292 FPM.
addPass(std::move(NestedFPM));
2295 if (Name ==
"loop" || Name ==
"loop-mssa") {
2297 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2300 bool UseMemorySSA = (
Name ==
"loop-mssa");
2305 if (Name ==
"machine-function") {
2307 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2313 for (
auto &
C : FunctionPipelineParsingCallbacks)
2314 if (
C(Name, FPM, InnerPipeline))
2319 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2324#define FUNCTION_PASS(NAME, CREATE_PASS) \
2325 if (Name == NAME) { \
2326 if constexpr (std::is_constructible_v< \
2327 std::remove_reference_t<decltype(CREATE_PASS)>, \
2328 const TargetMachine &>) { \
2330 return make_error<StringError>( \
2331 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2332 inconvertibleErrorCode()); \
2334 FPM.addPass(CREATE_PASS); \
2335 return Error::success(); \
2337#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2338 if (checkParametrizedPassName(Name, NAME)) { \
2339 auto Params = parsePassParameters(PARSER, Name, NAME); \
2341 return Params.takeError(); \
2342 auto CreatePass = CREATE_PASS; \
2343 if constexpr (std::is_constructible_v< \
2344 std::remove_reference_t<decltype(CreatePass( \
2346 const TargetMachine &, \
2347 std::remove_reference_t<decltype(Params.get())>>) { \
2349 return make_error<StringError>( \
2350 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2351 inconvertibleErrorCode()); \
2354 FPM.addPass(CREATE_PASS(Params.get())); \
2355 return Error::success(); \
2357#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2358 if (Name == "require<" NAME ">") { \
2359 if constexpr (std::is_constructible_v< \
2360 std::remove_reference_t<decltype(CREATE_PASS)>, \
2361 const TargetMachine &>) { \
2363 return make_error<StringError>( \
2364 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2365 inconvertibleErrorCode()); \
2368 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2370 return Error::success(); \
2372 if (Name == "invalidate<" NAME ">") { \
2373 FPM.addPass(InvalidateAnalysisPass< \
2374 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2375 return Error::success(); \
2381#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2382 if (Name == NAME) { \
2383 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2384 return Error::success(); \
2386#define LOOP_PASS(NAME, CREATE_PASS) \
2387 if (Name == NAME) { \
2388 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2389 return Error::success(); \
2391#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2392 if (checkParametrizedPassName(Name, NAME)) { \
2393 auto Params = parsePassParameters(PARSER, Name, NAME); \
2395 return Params.takeError(); \
2397 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2398 return Error::success(); \
2400#include "PassRegistry.def"
2402 for (
auto &
C : FunctionPipelineParsingCallbacks)
2403 if (
C(Name, FPM, InnerPipeline))
2406 formatv(
"unknown function pass '{}'", Name).str(),
2411 const PipelineElement &
E) {
2412 StringRef
Name =
E.Name;
2413 auto &InnerPipeline =
E.InnerPipeline;
2416 if (!InnerPipeline.empty()) {
2417 if (Name ==
"loop") {
2419 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2422 LPM.addPass(std::move(NestedLPM));
2426 for (
auto &
C : LoopPipelineParsingCallbacks)
2427 if (
C(Name, LPM, InnerPipeline))
2432 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2437#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2438 if (Name == NAME) { \
2439 LPM.addPass(CREATE_PASS); \
2440 return Error::success(); \
2442#define LOOP_PASS(NAME, CREATE_PASS) \
2443 if (Name == NAME) { \
2444 LPM.addPass(CREATE_PASS); \
2445 return Error::success(); \
2447#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2448 if (checkParametrizedPassName(Name, NAME)) { \
2449 auto Params = parsePassParameters(PARSER, Name, NAME); \
2451 return Params.takeError(); \
2452 LPM.addPass(CREATE_PASS(Params.get())); \
2453 return Error::success(); \
2455#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2456 if (Name == "require<" NAME ">") { \
2457 LPM.addPass(RequireAnalysisPass< \
2458 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2459 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2461 return Error::success(); \
2463 if (Name == "invalidate<" NAME ">") { \
2464 LPM.addPass(InvalidateAnalysisPass< \
2465 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2466 return Error::success(); \
2468#include "PassRegistry.def"
2470 for (
auto &
C : LoopPipelineParsingCallbacks)
2471 if (
C(Name, LPM, InnerPipeline))
2478 const PipelineElement &
E) {
2479 StringRef
Name =
E.Name;
2481 if (!
E.InnerPipeline.empty()) {
2482 if (
E.Name ==
"machine-function") {
2484 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2486 MFPM.
addPass(std::move(NestedPM));
2493#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2494 if (Name == NAME) { \
2495 MFPM.addPass(CREATE_PASS); \
2496 return Error::success(); \
2498#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2499 if (Name == NAME) { \
2500 MFPM.addPass(CREATE_PASS); \
2501 return Error::success(); \
2503#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2505 if (checkParametrizedPassName(Name, NAME)) { \
2506 auto Params = parsePassParameters(PARSER, Name, NAME); \
2508 return Params.takeError(); \
2509 MFPM.addPass(CREATE_PASS(Params.get())); \
2510 return Error::success(); \
2512#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2513 if (Name == "require<" NAME ">") { \
2515 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2516 MachineFunction>()); \
2517 return Error::success(); \
2519 if (Name == "invalidate<" NAME ">") { \
2520 MFPM.addPass(InvalidateAnalysisPass< \
2521 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2522 return Error::success(); \
2524#include "llvm/Passes/MachinePassRegistry.def"
2526 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2527 if (
C(Name, MFPM,
E.InnerPipeline))
2530 formatv(
"unknown machine pass '{}'", Name).str(),
2535#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2536 if (Name == NAME) { \
2537 AA.registerModuleAnalysis< \
2538 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2541#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2542 if (Name == NAME) { \
2543 AA.registerFunctionAnalysis< \
2544 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2547#include "PassRegistry.def"
2549 for (
auto &
C : AAParsingCallbacks)
2555Error PassBuilder::parseMachinePassPipeline(
2557 for (
const auto &Element : Pipeline) {
2558 if (
auto Err = parseMachinePass(MFPM, Element))
2566 for (
const auto &Element : Pipeline) {
2567 if (
auto Err = parseLoopPass(LPM, Element))
2573Error PassBuilder::parseFunctionPassPipeline(
2575 for (
const auto &Element : Pipeline) {
2576 if (
auto Err = parseFunctionPass(FPM, Element))
2584 for (
const auto &Element : Pipeline) {
2585 if (
auto Err = parseCGSCCPass(CGPM, Element))
2617 for (
const auto &Element : Pipeline) {
2618 if (
auto Err = parseModulePass(MPM, Element))
2629 auto Pipeline = parsePipelineText(PipelineText);
2630 if (!Pipeline || Pipeline->empty())
2632 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2642 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2644 FunctionPipelineParsingCallbacks)) {
2645 Pipeline = {{
"function", std::move(*Pipeline)}};
2648 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2649 std::move(*Pipeline)}}}};
2650 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2652 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2653 std::move(*Pipeline)}}}};
2655 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2656 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2658 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2659 if (
C(MPM, *Pipeline))
2663 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2665 formatv(
"unknown {} name '{}'",
2666 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2672 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2680 auto Pipeline = parsePipelineText(PipelineText);
2681 if (!Pipeline || Pipeline->empty())
2683 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2689 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2694 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2703 auto Pipeline = parsePipelineText(PipelineText);
2704 if (!Pipeline || Pipeline->empty())
2706 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2712 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2717 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2725 auto Pipeline = parsePipelineText(PipelineText);
2726 if (!Pipeline || Pipeline->empty())
2728 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2731 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2739 auto Pipeline = parsePipelineText(PipelineText);
2740 if (!Pipeline || Pipeline->empty())
2742 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2745 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2754 if (PipelineText ==
"default") {
2759 while (!PipelineText.
empty()) {
2761 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2762 if (!parseAAPassName(
AA, Name))
2764 formatv(
"unknown alias analysis name '{}'", Name).str(),
2771std::optional<RegAllocFilterFunc>
2773 if (FilterName ==
"all")
2775 for (
auto &
C : RegClassFilterParsingCallbacks)
2776 if (
auto F =
C(FilterName))
2778 return std::nullopt;
2786 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2792 OS <<
"Module passes:\n";
2793#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2794#include "PassRegistry.def"
2796 OS <<
"Module passes with params:\n";
2797#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2798 printPassName(NAME, PARAMS, OS);
2799#include "PassRegistry.def"
2801 OS <<
"Module analyses:\n";
2802#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2803#include "PassRegistry.def"
2805 OS <<
"Module alias analyses:\n";
2806#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2807#include "PassRegistry.def"
2809 OS <<
"CGSCC passes:\n";
2810#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2811#include "PassRegistry.def"
2813 OS <<
"CGSCC passes with params:\n";
2814#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2815 printPassName(NAME, PARAMS, OS);
2816#include "PassRegistry.def"
2818 OS <<
"CGSCC analyses:\n";
2819#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2820#include "PassRegistry.def"
2822 OS <<
"Function passes:\n";
2823#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2824#include "PassRegistry.def"
2826 OS <<
"Function passes with params:\n";
2827#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2828 printPassName(NAME, PARAMS, OS);
2829#include "PassRegistry.def"
2831 OS <<
"Function analyses:\n";
2832#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2833#include "PassRegistry.def"
2835 OS <<
"Function alias analyses:\n";
2836#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2837#include "PassRegistry.def"
2839 OS <<
"LoopNest passes:\n";
2840#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2841#include "PassRegistry.def"
2843 OS <<
"Loop passes:\n";
2844#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2845#include "PassRegistry.def"
2847 OS <<
"Loop passes with params:\n";
2848#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2849 printPassName(NAME, PARAMS, OS);
2850#include "PassRegistry.def"
2852 OS <<
"Loop analyses:\n";
2853#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2854#include "PassRegistry.def"
2856 OS <<
"Machine module passes (WIP):\n";
2857#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2858#include "llvm/Passes/MachinePassRegistry.def"
2860 OS <<
"Machine function passes (WIP):\n";
2861#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2862#include "llvm/Passes/MachinePassRegistry.def"
2864 OS <<
"Machine function analyses (WIP):\n";
2865#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2866#include "llvm/Passes/MachinePassRegistry.def"
2872 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 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