393 "print-pipeline-passes",
394 cl::desc(
"Print a '-passes' compatible string describing the pipeline "
395 "(best-effort only)."));
406class TriggerCrashModulePass :
public PassInfoMixin<TriggerCrashModulePass> {
412 static StringRef
name() {
return "TriggerCrashModulePass"; }
415class TriggerCrashFunctionPass
422 static StringRef
name() {
return "TriggerCrashFunctionPass"; }
427class TriggerVerifierErrorPass
433 auto *PtrTy = PointerType::getUnqual(
M.getContext());
435 GlobalValue::LinkageTypes::InternalLinkage,
436 "__bad_alias",
nullptr, &M);
456 static StringRef
name() {
return "TriggerVerifierErrorPass"; }
461class RequireAllMachineFunctionPropertiesPass
462 :
public PassInfoMixin<RequireAllMachineFunctionPropertiesPass> {
469 static MachineFunctionProperties getRequiredProperties() {
470 return MachineFunctionProperties()
472 .setFailsVerification()
477 .setRegBankSelected()
479 .setTiedOpsRewritten()
480 .setTracksDebugUserValues()
481 .setTracksLiveness();
483 static StringRef
name() {
return "RequireAllMachineFunctionPropertiesPass"; }
500 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(S);
504 formatv(
"invalid optimization level '{}'", S).str(),
509 std::optional<PGOOptions> PGOOpt,
512 : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(
std::
move(FS)) {
514 TM->registerPassBuilderCallbacks(*
this);
516 PIC->registerClassToPassNameCallback([
this, PIC]() {
520#define MODULE_PASS(NAME, CREATE_PASS) \
521 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
522#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
523 PIC->addClassToPassName(CLASS, NAME);
524#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
525 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
526#define FUNCTION_PASS(NAME, CREATE_PASS) \
527 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
528#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
529 PIC->addClassToPassName(CLASS, NAME);
530#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
531 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
532#define LOOPNEST_PASS(NAME, CREATE_PASS) \
533 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
534#define LOOP_PASS(NAME, CREATE_PASS) \
535 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
536#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
537 PIC->addClassToPassName(CLASS, NAME);
538#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
539 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
540#define CGSCC_PASS(NAME, CREATE_PASS) \
541 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
542#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
543 PIC->addClassToPassName(CLASS, NAME);
544#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
545 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
546#include "PassRegistry.def"
548#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
549 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
550#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
551 PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
552#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
554 PIC->addClassToPassName(CLASS, NAME);
555#include "llvm/Passes/MachinePassRegistry.def"
563#define MODULE_CALLBACK(NAME, INVOKE) \
564 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
565 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
567 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
570 INVOKE(PM, L.get()); \
573#include "PassRegistry.def"
581#define MODULE_LTO_CALLBACK(NAME, INVOKE) \
582 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
583 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
585 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
588 INVOKE(PM, L.get(), ThinOrFullLTOPhase::None); \
591#include "PassRegistry.def"
599#define FUNCTION_CALLBACK(NAME, INVOKE) \
600 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
601 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
603 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
606 INVOKE(PM, L.get()); \
609#include "PassRegistry.def"
617#define CGSCC_CALLBACK(NAME, INVOKE) \
618 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
619 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
621 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
624 INVOKE(PM, L.get()); \
627#include "PassRegistry.def"
635#define LOOP_CALLBACK(NAME, INVOKE) \
636 if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
637 auto L = PassBuilder::parsePassParameters(parseOptLevelParam, Name, NAME); \
639 errs() << NAME ": " << toString(L.takeError()) << '\n'; \
642 INVOKE(PM, L.get()); \
645#include "PassRegistry.def"
651#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
652 MAM.registerPass([&] { return CREATE_PASS; });
653#include "PassRegistry.def"
655 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
660#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
661 CGAM.registerPass([&] { return CREATE_PASS; });
662#include "PassRegistry.def"
664 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
674#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
675 if constexpr (std::is_constructible_v< \
676 std::remove_reference_t<decltype(CREATE_PASS)>, \
677 const TargetMachine &>) { \
679 FAM.registerPass([&] { return CREATE_PASS; }); \
681 FAM.registerPass([&] { return CREATE_PASS; }); \
683#include "PassRegistry.def"
685 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
692#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
693 MFAM.registerPass([&] { return CREATE_PASS; });
694#include "llvm/Passes/MachinePassRegistry.def"
696 for (
auto &
C : MachineFunctionAnalysisRegistrationCallbacks)
701#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
702 LAM.registerPass([&] { return CREATE_PASS; });
703#include "PassRegistry.def"
705 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
709static std::optional<std::pair<bool, bool>>
711 std::pair<bool, bool> Params;
712 if (!Name.consume_front(
"function"))
716 if (!Name.consume_front(
"<") || !Name.consume_back(
">"))
718 while (!Name.empty()) {
719 auto [Front, Back] = Name.split(
';');
721 if (Front ==
"eager-inv")
723 else if (Front ==
"no-rerun")
724 Params.second =
true;
732 if (!Name.consume_front(
"devirt<") || !Name.consume_back(
">"))
744 while (!Params.
empty()) {
746 std::tie(ParamName, Params) = Params.
split(
';');
748 if (ParamName == OptionName) {
765 while (!Params.
empty()) {
767 std::tie(ParamName, Params) = Params.
split(
';');
772 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
777 if (ParamName.
consume_front(
"hardware-loop-counter-bitwidth=")) {
781 formatv(
"invalid HardwareLoopPass parameter '{}'", ParamName).str(),
786 if (ParamName ==
"force-hardware-loops") {
788 }
else if (ParamName ==
"force-hardware-loop-phi") {
790 }
else if (ParamName ==
"force-nested-hardware-loop") {
792 }
else if (ParamName ==
"force-hardware-loop-guard") {
796 formatv(
"invalid HardwarePass parameter '{}'", ParamName).str(),
800 return HardwareLoopOpts;
812 while (!Params.
empty()) {
814 std::tie(ParamName, Params) = Params.
split(
';');
815 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
817 if (OptLevel && !OptLevel->isOptimizingForSize()) {
818 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
825 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
832 if (ParamName ==
"partial") {
834 }
else if (ParamName ==
"peeling") {
836 }
else if (ParamName ==
"profile-peeling") {
838 }
else if (ParamName ==
"runtime") {
840 }
else if (ParamName ==
"upperbound") {
844 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
853 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
873 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
883 formatv(
"too many CFGuardPass parameters '{}'", Params).str(),
886 if (Param ==
"check")
888 if (Param ==
"dispatch")
892 formatv(
"invalid CFGuardPass mechanism: '{}'", Param).str(),
902 "EntryExitInstrumenter");
907 "DropUnnecessaryAssumes");
916 "LowerMatrixIntrinsics");
921 while (!Params.
empty()) {
923 std::tie(ParamName, Params) = Params.
split(
';');
926 if (ParamName ==
"preserve-order")
928 else if (ParamName ==
"rename-all")
930 else if (ParamName ==
"fold-all")
932 else if (ParamName ==
"reorder-operands")
936 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
946 while (!Params.
empty()) {
948 std::tie(ParamName, Params) = Params.
split(
';');
950 if (ParamName ==
"kernel") {
951 Result.CompileKernel =
true;
952 }
else if (ParamName ==
"use-after-scope") {
953 Result.UseAfterScope =
true;
956 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
966 while (!Params.
empty()) {
968 std::tie(ParamName, Params) = Params.
split(
';');
970 if (ParamName ==
"recover") {
972 }
else if (ParamName ==
"kernel") {
973 Result.CompileKernel =
true;
976 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
986 while (!Params.
empty()) {
988 std::tie(ParamName, Params) = Params.
split(
';');
990 if (ParamName ==
"thinlto") {
992 }
else if (ParamName ==
"emit-summary") {
993 Result.EmitLTOSummary =
true;
996 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1004parseLowerAllowCheckPassOptions(
StringRef Params) {
1006 while (!Params.
empty()) {
1008 std::tie(ParamName, Params) = Params.
split(
';');
1019 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1026 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1031 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1033 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1034 IndicesStr, CutoffStr)
1038 while (IndicesStr !=
"") {
1040 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1046 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1047 firstIndexStr, IndicesStr)
1054 if (index >=
Result.cutoffs.size())
1055 Result.cutoffs.resize(index + 1, 0);
1057 Result.cutoffs[index] = cutoff;
1059 }
else if (ParamName.
starts_with(
"runtime_check")) {
1061 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1065 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1067 ValueString, Params)
1071 Result.runtime_check = runtime_check;
1074 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1085 while (!Params.
empty()) {
1087 std::tie(ParamName, Params) = Params.
split(
';');
1089 if (ParamName ==
"recover") {
1091 }
else if (ParamName ==
"kernel") {
1096 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1101 }
else if (ParamName ==
"eager-checks") {
1102 Result.EagerChecks =
true;
1105 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1115 while (!Params.
empty()) {
1117 std::tie(ParamName, Params) = Params.
split(
';');
1124 formatv(
"invalid argument to AllocToken pass mode "
1131 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1141 while (!Params.
empty()) {
1143 std::tie(ParamName, Params) = Params.
split(
';');
1146 if (ParamName ==
"speculate-blocks") {
1148 }
else if (ParamName ==
"simplify-cond-branch") {
1150 }
else if (ParamName ==
"forward-switch-cond") {
1152 }
else if (ParamName ==
"switch-range-to-icmp") {
1154 }
else if (ParamName ==
"switch-to-arithmetic") {
1156 }
else if (ParamName ==
"switch-to-lookup") {
1158 }
else if (ParamName ==
"keep-loops") {
1160 }
else if (ParamName ==
"hoist-common-insts") {
1162 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1164 }
else if (ParamName ==
"sink-common-insts") {
1166 }
else if (ParamName ==
"speculate-unpredictables") {
1169 APInt BonusInstThreshold;
1172 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1180 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1191 Result.setVerifyFixpoint(
true);
1192 while (!Params.
empty()) {
1194 std::tie(ParamName, Params) = Params.
split(
';');
1197 if (ParamName ==
"verify-fixpoint") {
1200 APInt MaxIterations;
1203 formatv(
"invalid argument to InstCombine pass max-iterations "
1211 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1221 while (!Params.
empty()) {
1223 std::tie(ParamName, Params) = Params.
split(
';');
1226 if (ParamName ==
"interleave-forced-only") {
1228 }
else if (ParamName ==
"vectorize-forced-only") {
1232 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1240 std::pair<bool, bool>
Result = {
false,
true};
1241 while (!Params.
empty()) {
1243 std::tie(ParamName, Params) = Params.
split(
';');
1246 if (ParamName ==
"nontrivial") {
1248 }
else if (ParamName ==
"trivial") {
1252 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1261 while (!Params.
empty()) {
1263 std::tie(ParamName, Params) = Params.
split(
';');
1266 if (ParamName ==
"allowspeculation") {
1270 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1277struct LoopRotateOptions {
1278 bool EnableHeaderDuplication =
true;
1279 bool PrepareForLTO =
false;
1280 bool CheckExitCount =
false;
1284 LoopRotateOptions
Result;
1285 while (!Params.
empty()) {
1287 std::tie(ParamName, Params) = Params.
split(
';');
1290 if (ParamName ==
"header-duplication") {
1292 }
else if (ParamName ==
"prepare-for-lto") {
1294 }
else if (ParamName ==
"check-exit-count") {
1298 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1307 while (!Params.
empty()) {
1309 std::tie(ParamName, Params) = Params.
split(
';');
1312 if (ParamName ==
"split-footer-bb") {
1316 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1327 while (!Params.
empty()) {
1329 std::tie(ParamName, Params) = Params.
split(
';');
1332 if (ParamName ==
"pre") {
1334 }
else if (ParamName ==
"load-pre") {
1336 }
else if (ParamName ==
"split-backedge-load-pre") {
1338 }
else if (ParamName ==
"memdep") {
1342 }
else if (ParamName ==
"memoryssa") {
1348 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1357 while (!Params.
empty()) {
1359 std::tie(ParamName, Params) = Params.
split(
';');
1362 if (ParamName ==
"func-spec")
1366 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1374 while (!Params.
empty()) {
1376 std::tie(ParamName, Params) = Params.
split(
';');
1381 formatv(
"invalid argument to Scalarizer pass min-bits "
1392 if (ParamName ==
"load-store")
1394 else if (ParamName ==
"variable-insert-extract")
1398 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1407 if (Params.
empty() || Params ==
"modify-cfg")
1409 if (Params ==
"preserve-cfg")
1412 formatv(
"invalid SROA pass parameter '{}' (either preserve-cfg or "
1413 "modify-cfg can be specified)",
1420parseStackLifetimeOptions(
StringRef Params) {
1422 while (!Params.
empty()) {
1424 std::tie(ParamName, Params) = Params.
split(
';');
1426 if (ParamName ==
"may") {
1428 }
else if (ParamName ==
"must") {
1432 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1441 "DependenceAnalysisPrinter");
1446 "SeparateConstOffsetFromGEP");
1455parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1459 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1467 "MemorySSAPrinterPass");
1472 "SpeculativeExecutionPass");
1477 while (!Params.
empty()) {
1479 std::tie(ParamName, Params) = Params.
split(
';');
1485 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1493parseStructuralHashPrinterPassOptions(
StringRef Params) {
1496 if (Params ==
"detailed")
1498 if (Params ==
"call-target-ignored")
1501 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1507 "WinEHPreparePass");
1512 while (!Params.
empty()) {
1514 std::tie(ParamName, Params) = Params.
split(
';');
1517 if (ParamName ==
"group-by-use")
1519 else if (ParamName ==
"ignore-single-use")
1521 else if (ParamName ==
"merge-const")
1523 else if (ParamName ==
"merge-const-aggressive")
1525 else if (ParamName ==
"merge-external")
1530 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1534 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1543 while (!Params.
empty()) {
1545 std::tie(ParamName, Params) = Params.
split(
';');
1551 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1562 while (!Params.
empty()) {
1564 std::tie(ParamName, Params) = Params.
split(
';');
1567 std::optional<RegAllocFilterFunc>
Filter =
1571 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1580 if (ParamName ==
"no-clear-vregs") {
1586 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1593parseBoundsCheckingOptions(
StringRef Params) {
1595 while (!Params.
empty()) {
1597 std::tie(ParamName, Params) = Params.
split(
';');
1598 if (ParamName ==
"trap") {
1600 }
else if (ParamName ==
"rt") {
1606 }
else if (ParamName ==
"rt-abort") {
1612 }
else if (ParamName ==
"min-rt") {
1618 }
else if (ParamName ==
"min-rt-abort") {
1624 }
else if (ParamName ==
"merge") {
1626 }
else if (ParamName ==
"handler-preserve-all-regs") {
1628 Options.Rt->HandlerPreserveAllRegs =
true;
1632 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1638 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1655 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1657 Param.str().c_str());
1660 if (!
Level.has_value())
1662 "invalid optimization level for expand-ir-insts pass: %s",
1663 Digit.str().c_str());
1670 if (Params.
empty() || Params ==
"all")
1671 return RAGreedyPass::Options();
1675 return RAGreedyPass::Options{*
Filter, Params};
1678 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1684 "MachineSinkingPass");
1688 bool AllowTailMerge =
true;
1689 if (!Params.
empty()) {
1691 if (Params !=
"tail-merge")
1693 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1697 return AllowTailMerge;
1701 bool ClearVirtRegs =
true;
1702 if (!Params.
empty()) {
1704 if (Params !=
"clear-vregs")
1706 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1709 return ClearVirtRegs;
1712struct FatLTOOptions {
1713 OptimizationLevel OptLevel;
1714 bool ThinLTO =
false;
1715 bool EmitSummary =
false;
1720 bool HaveOptLevel =
false;
1721 while (!Params.
empty()) {
1723 std::tie(ParamName, Params) = Params.
split(
';');
1725 if (ParamName ==
"thinlto") {
1727 }
else if (ParamName ==
"emit-summary") {
1728 Result.EmitSummary =
true;
1729 }
else if (std::optional<OptimizationLevel> OptLevel =
1731 Result.OptLevel = *OptLevel;
1732 HaveOptLevel =
true;
1735 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1742 "missing optimization level for fatlto-pre-link pipeline",
1757template <
typename PassManagerT,
typename CallbacksT>
1759 if (!Callbacks.empty()) {
1760 PassManagerT DummyPM;
1761 for (
auto &CB : Callbacks)
1762 if (CB(Name, DummyPM, {}))
1768template <
typename CallbacksT>
1770 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1773 if (Name ==
"module")
1775 if (Name ==
"cgscc")
1777 if (NameNoBracket ==
"function")
1779 if (Name ==
"coro-cond")
1782#define MODULE_PASS(NAME, CREATE_PASS) \
1785#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1786 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1788#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1789 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1791#include "PassRegistry.def"
1796template <
typename CallbacksT>
1799 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1800 if (Name ==
"cgscc")
1802 if (NameNoBracket ==
"function")
1809#define CGSCC_PASS(NAME, CREATE_PASS) \
1812#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1813 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1815#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1816 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1818#include "PassRegistry.def"
1823template <
typename CallbacksT>
1826 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1827 if (NameNoBracket ==
"function")
1829 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1832#define FUNCTION_PASS(NAME, CREATE_PASS) \
1835#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1836 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1838#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1839 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1841#include "PassRegistry.def"
1846template <
typename CallbacksT>
1849 if (Name ==
"machine-function")
1852#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1855#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1857 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1860#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1861 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1864#include "llvm/Passes/MachinePassRegistry.def"
1869template <
typename CallbacksT>
1871 bool &UseMemorySSA) {
1872 UseMemorySSA =
false;
1875 UseMemorySSA =
true;
1879#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1882#include "PassRegistry.def"
1887template <
typename CallbacksT>
1889 bool &UseMemorySSA) {
1890 UseMemorySSA =
false;
1893 UseMemorySSA =
true;
1897#define LOOP_PASS(NAME, CREATE_PASS) \
1900#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1901 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1903#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1904 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1906#include "PassRegistry.def"
1911std::optional<std::vector<PassBuilder::PipelineElement>>
1912PassBuilder::parsePipelineText(
StringRef Text) {
1913 std::vector<PipelineElement> ResultPipeline;
1918 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1919 size_t Pos =
Text.find_first_of(
",()");
1920 Pipeline.push_back({
Text.substr(0, Pos), {}});
1923 if (Pos ==
Text.npos)
1926 char Sep =
Text[Pos];
1934 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1938 assert(Sep ==
')' &&
"Bogus separator!");
1943 if (PipelineStack.
size() == 1)
1944 return std::nullopt;
1947 }
while (
Text.consume_front(
")"));
1955 if (!
Text.consume_front(
","))
1956 return std::nullopt;
1959 if (PipelineStack.
size() > 1)
1961 return std::nullopt;
1963 assert(PipelineStack.
back() == &ResultPipeline &&
1964 "Wrong pipeline at the bottom of the stack!");
1965 return {std::move(ResultPipeline)};
1978 const PipelineElement &
E) {
1979 auto &
Name =
E.Name;
1980 auto &InnerPipeline =
E.InnerPipeline;
1983 if (!InnerPipeline.empty()) {
1984 if (Name ==
"module") {
1986 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
1988 MPM.
addPass(std::move(NestedMPM));
1991 if (Name ==
"coro-cond") {
1993 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
1995 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
1998 if (Name ==
"cgscc") {
2000 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2008 "cannot have a no-rerun module to function adaptor",
2011 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2018 for (
auto &
C : ModulePipelineParsingCallbacks)
2019 if (
C(Name, MPM, InnerPipeline))
2024 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2030#define MODULE_PASS(NAME, CREATE_PASS) \
2031 if (Name == NAME) { \
2032 MPM.addPass(CREATE_PASS); \
2033 return Error::success(); \
2035#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2036 if (checkParametrizedPassName(Name, NAME)) { \
2037 auto Params = parsePassParameters(PARSER, Name, NAME); \
2039 return Params.takeError(); \
2040 MPM.addPass(CREATE_PASS(Params.get())); \
2041 return Error::success(); \
2043#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2044 if (Name == "require<" NAME ">") { \
2046 RequireAnalysisPass< \
2047 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2048 return Error::success(); \
2050 if (Name == "invalidate<" NAME ">") { \
2051 MPM.addPass(InvalidateAnalysisPass< \
2052 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2053 return Error::success(); \
2055#define CGSCC_PASS(NAME, CREATE_PASS) \
2056 if (Name == NAME) { \
2057 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2058 return Error::success(); \
2060#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2061 if (checkParametrizedPassName(Name, NAME)) { \
2062 auto Params = parsePassParameters(PARSER, Name, NAME); \
2064 return Params.takeError(); \
2066 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2067 return Error::success(); \
2069#define FUNCTION_PASS(NAME, CREATE_PASS) \
2070 if (Name == NAME) { \
2071 if constexpr (std::is_constructible_v< \
2072 std::remove_reference_t<decltype(CREATE_PASS)>, \
2073 const TargetMachine &>) { \
2075 return make_error<StringError>( \
2076 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2077 inconvertibleErrorCode()); \
2079 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2080 return Error::success(); \
2082#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2083 if (checkParametrizedPassName(Name, NAME)) { \
2084 auto Params = parsePassParameters(PARSER, Name, NAME); \
2086 return Params.takeError(); \
2087 auto CreatePass = CREATE_PASS; \
2088 if constexpr (std::is_constructible_v< \
2089 std::remove_reference_t<decltype(CreatePass( \
2091 const TargetMachine &, \
2092 std::remove_reference_t<decltype(Params.get())>>) { \
2094 return make_error<StringError>( \
2095 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2096 inconvertibleErrorCode()); \
2099 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2100 return Error::success(); \
2102#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2103 if (Name == NAME) { \
2104 MPM.addPass(createModuleToFunctionPassAdaptor( \
2105 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2106 return Error::success(); \
2108#define LOOP_PASS(NAME, CREATE_PASS) \
2109 if (Name == NAME) { \
2110 MPM.addPass(createModuleToFunctionPassAdaptor( \
2111 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2112 return Error::success(); \
2114#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2115 if (checkParametrizedPassName(Name, NAME)) { \
2116 auto Params = parsePassParameters(PARSER, Name, NAME); \
2118 return Params.takeError(); \
2119 MPM.addPass(createModuleToFunctionPassAdaptor( \
2120 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2121 return Error::success(); \
2123#include "PassRegistry.def"
2125 for (
auto &
C : ModulePipelineParsingCallbacks)
2126 if (
C(Name, MPM, InnerPipeline))
2129 formatv(
"unknown module pass '{}'", Name).str(),
2134 const PipelineElement &
E) {
2135 auto &
Name =
E.Name;
2136 auto &InnerPipeline =
E.InnerPipeline;
2139 if (!InnerPipeline.empty()) {
2140 if (Name ==
"cgscc") {
2142 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2145 CGPM.
addPass(std::move(NestedCGPM));
2150 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2154 std::move(FPM), Params->first, Params->second));
2159 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2166 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2167 if (
C(Name, CGPM, InnerPipeline))
2172 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2177#define CGSCC_PASS(NAME, CREATE_PASS) \
2178 if (Name == NAME) { \
2179 CGPM.addPass(CREATE_PASS); \
2180 return Error::success(); \
2182#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2183 if (checkParametrizedPassName(Name, NAME)) { \
2184 auto Params = parsePassParameters(PARSER, Name, NAME); \
2186 return Params.takeError(); \
2187 CGPM.addPass(CREATE_PASS(Params.get())); \
2188 return Error::success(); \
2190#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2191 if (Name == "require<" NAME ">") { \
2192 CGPM.addPass(RequireAnalysisPass< \
2193 std::remove_reference_t<decltype(CREATE_PASS)>, \
2194 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2195 CGSCCUpdateResult &>()); \
2196 return Error::success(); \
2198 if (Name == "invalidate<" NAME ">") { \
2199 CGPM.addPass(InvalidateAnalysisPass< \
2200 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2201 return Error::success(); \
2203#define FUNCTION_PASS(NAME, CREATE_PASS) \
2204 if (Name == NAME) { \
2205 if constexpr (std::is_constructible_v< \
2206 std::remove_reference_t<decltype(CREATE_PASS)>, \
2207 const TargetMachine &>) { \
2209 return make_error<StringError>( \
2210 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2211 inconvertibleErrorCode()); \
2213 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2214 return Error::success(); \
2216#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2217 if (checkParametrizedPassName(Name, NAME)) { \
2218 auto Params = parsePassParameters(PARSER, Name, NAME); \
2220 return Params.takeError(); \
2221 auto CreatePass = CREATE_PASS; \
2222 if constexpr (std::is_constructible_v< \
2223 std::remove_reference_t<decltype(CreatePass( \
2225 const TargetMachine &, \
2226 std::remove_reference_t<decltype(Params.get())>>) { \
2228 return make_error<StringError>( \
2229 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2230 inconvertibleErrorCode()); \
2233 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2234 return Error::success(); \
2236#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2237 if (Name == NAME) { \
2238 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2239 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2240 return Error::success(); \
2242#define LOOP_PASS(NAME, CREATE_PASS) \
2243 if (Name == NAME) { \
2244 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2245 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2246 return Error::success(); \
2248#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2249 if (checkParametrizedPassName(Name, NAME)) { \
2250 auto Params = parsePassParameters(PARSER, Name, NAME); \
2252 return Params.takeError(); \
2253 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2254 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2255 return Error::success(); \
2257#include "PassRegistry.def"
2259 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2260 if (
C(Name, CGPM, InnerPipeline))
2267 const PipelineElement &
E) {
2268 auto &
Name =
E.Name;
2269 auto &InnerPipeline =
E.InnerPipeline;
2272 if (!InnerPipeline.empty()) {
2273 if (Name ==
"function") {
2275 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2278 FPM.
addPass(std::move(NestedFPM));
2281 if (Name ==
"loop" || Name ==
"loop-mssa") {
2283 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2286 bool UseMemorySSA = (
Name ==
"loop-mssa");
2291 if (Name ==
"machine-function") {
2293 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2299 for (
auto &
C : FunctionPipelineParsingCallbacks)
2300 if (
C(Name, FPM, InnerPipeline))
2305 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2310#define FUNCTION_PASS(NAME, CREATE_PASS) \
2311 if (Name == NAME) { \
2312 if constexpr (std::is_constructible_v< \
2313 std::remove_reference_t<decltype(CREATE_PASS)>, \
2314 const TargetMachine &>) { \
2316 return make_error<StringError>( \
2317 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2318 inconvertibleErrorCode()); \
2320 FPM.addPass(CREATE_PASS); \
2321 return Error::success(); \
2323#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2324 if (checkParametrizedPassName(Name, NAME)) { \
2325 auto Params = parsePassParameters(PARSER, Name, NAME); \
2327 return Params.takeError(); \
2328 auto CreatePass = CREATE_PASS; \
2329 if constexpr (std::is_constructible_v< \
2330 std::remove_reference_t<decltype(CreatePass( \
2332 const TargetMachine &, \
2333 std::remove_reference_t<decltype(Params.get())>>) { \
2335 return make_error<StringError>( \
2336 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2337 inconvertibleErrorCode()); \
2340 FPM.addPass(CREATE_PASS(Params.get())); \
2341 return Error::success(); \
2343#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2344 if (Name == "require<" NAME ">") { \
2345 if constexpr (std::is_constructible_v< \
2346 std::remove_reference_t<decltype(CREATE_PASS)>, \
2347 const TargetMachine &>) { \
2349 return make_error<StringError>( \
2350 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2351 inconvertibleErrorCode()); \
2354 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2356 return Error::success(); \
2358 if (Name == "invalidate<" NAME ">") { \
2359 FPM.addPass(InvalidateAnalysisPass< \
2360 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2361 return Error::success(); \
2367#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2368 if (Name == NAME) { \
2369 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2370 return Error::success(); \
2372#define LOOP_PASS(NAME, CREATE_PASS) \
2373 if (Name == NAME) { \
2374 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2375 return Error::success(); \
2377#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2378 if (checkParametrizedPassName(Name, NAME)) { \
2379 auto Params = parsePassParameters(PARSER, Name, NAME); \
2381 return Params.takeError(); \
2383 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2384 return Error::success(); \
2386#include "PassRegistry.def"
2388 for (
auto &
C : FunctionPipelineParsingCallbacks)
2389 if (
C(Name, FPM, InnerPipeline))
2392 formatv(
"unknown function pass '{}'", Name).str(),
2397 const PipelineElement &
E) {
2398 StringRef
Name =
E.Name;
2399 auto &InnerPipeline =
E.InnerPipeline;
2402 if (!InnerPipeline.empty()) {
2403 if (Name ==
"loop") {
2405 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2408 LPM.addPass(std::move(NestedLPM));
2412 for (
auto &
C : LoopPipelineParsingCallbacks)
2413 if (
C(Name, LPM, InnerPipeline))
2418 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2423#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2424 if (Name == NAME) { \
2425 LPM.addPass(CREATE_PASS); \
2426 return Error::success(); \
2428#define LOOP_PASS(NAME, CREATE_PASS) \
2429 if (Name == NAME) { \
2430 LPM.addPass(CREATE_PASS); \
2431 return Error::success(); \
2433#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2434 if (checkParametrizedPassName(Name, NAME)) { \
2435 auto Params = parsePassParameters(PARSER, Name, NAME); \
2437 return Params.takeError(); \
2438 LPM.addPass(CREATE_PASS(Params.get())); \
2439 return Error::success(); \
2441#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2442 if (Name == "require<" NAME ">") { \
2443 LPM.addPass(RequireAnalysisPass< \
2444 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2445 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2447 return Error::success(); \
2449 if (Name == "invalidate<" NAME ">") { \
2450 LPM.addPass(InvalidateAnalysisPass< \
2451 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2452 return Error::success(); \
2454#include "PassRegistry.def"
2456 for (
auto &
C : LoopPipelineParsingCallbacks)
2457 if (
C(Name, LPM, InnerPipeline))
2464 const PipelineElement &
E) {
2465 StringRef
Name =
E.Name;
2467 if (!
E.InnerPipeline.empty()) {
2468 if (
E.Name ==
"machine-function") {
2470 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2472 MFPM.
addPass(std::move(NestedPM));
2479#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2480 if (Name == NAME) { \
2481 MFPM.addPass(CREATE_PASS); \
2482 return Error::success(); \
2484#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2485 if (Name == NAME) { \
2486 MFPM.addPass(CREATE_PASS); \
2487 return Error::success(); \
2489#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2491 if (checkParametrizedPassName(Name, NAME)) { \
2492 auto Params = parsePassParameters(PARSER, Name, NAME); \
2494 return Params.takeError(); \
2495 MFPM.addPass(CREATE_PASS(Params.get())); \
2496 return Error::success(); \
2498#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2499 if (Name == "require<" NAME ">") { \
2501 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2502 MachineFunction>()); \
2503 return Error::success(); \
2505 if (Name == "invalidate<" NAME ">") { \
2506 MFPM.addPass(InvalidateAnalysisPass< \
2507 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2508 return Error::success(); \
2510#include "llvm/Passes/MachinePassRegistry.def"
2512 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2513 if (
C(Name, MFPM,
E.InnerPipeline))
2516 formatv(
"unknown machine pass '{}'", Name).str(),
2521#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2522 if (Name == NAME) { \
2523 AA.registerModuleAnalysis< \
2524 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2527#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2528 if (Name == NAME) { \
2529 AA.registerFunctionAnalysis< \
2530 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2533#include "PassRegistry.def"
2535 for (
auto &
C : AAParsingCallbacks)
2541Error PassBuilder::parseMachinePassPipeline(
2543 for (
const auto &Element : Pipeline) {
2544 if (
auto Err = parseMachinePass(MFPM, Element))
2552 for (
const auto &Element : Pipeline) {
2553 if (
auto Err = parseLoopPass(LPM, Element))
2559Error PassBuilder::parseFunctionPassPipeline(
2561 for (
const auto &Element : Pipeline) {
2562 if (
auto Err = parseFunctionPass(FPM, Element))
2570 for (
const auto &Element : Pipeline) {
2571 if (
auto Err = parseCGSCCPass(CGPM, Element))
2603 for (
const auto &Element : Pipeline) {
2604 if (
auto Err = parseModulePass(MPM, Element))
2615 auto Pipeline = parsePipelineText(PipelineText);
2616 if (!Pipeline || Pipeline->empty())
2618 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2628 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2630 FunctionPipelineParsingCallbacks)) {
2631 Pipeline = {{
"function", std::move(*Pipeline)}};
2634 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2635 std::move(*Pipeline)}}}};
2636 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2638 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2639 std::move(*Pipeline)}}}};
2641 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2642 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2644 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2645 if (
C(MPM, *Pipeline))
2649 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2651 formatv(
"unknown {} name '{}'",
2652 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2658 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2666 auto Pipeline = parsePipelineText(PipelineText);
2667 if (!Pipeline || Pipeline->empty())
2669 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2675 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2680 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2689 auto Pipeline = parsePipelineText(PipelineText);
2690 if (!Pipeline || Pipeline->empty())
2692 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2698 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2703 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2711 auto Pipeline = parsePipelineText(PipelineText);
2712 if (!Pipeline || Pipeline->empty())
2714 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2717 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2725 auto Pipeline = parsePipelineText(PipelineText);
2726 if (!Pipeline || Pipeline->empty())
2728 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2731 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2740 if (PipelineText ==
"default") {
2745 while (!PipelineText.
empty()) {
2747 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2748 if (!parseAAPassName(
AA, Name))
2750 formatv(
"unknown alias analysis name '{}'", Name).str(),
2757std::optional<RegAllocFilterFunc>
2759 if (FilterName ==
"all")
2761 for (
auto &
C : RegClassFilterParsingCallbacks)
2762 if (
auto F =
C(FilterName))
2764 return std::nullopt;
2772 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2778 OS <<
"Module passes:\n";
2779#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2780#include "PassRegistry.def"
2782 OS <<
"Module passes with params:\n";
2783#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2784 printPassName(NAME, PARAMS, OS);
2785#include "PassRegistry.def"
2787 OS <<
"Module analyses:\n";
2788#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2789#include "PassRegistry.def"
2791 OS <<
"Module alias analyses:\n";
2792#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2793#include "PassRegistry.def"
2795 OS <<
"CGSCC passes:\n";
2796#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2797#include "PassRegistry.def"
2799 OS <<
"CGSCC passes with params:\n";
2800#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2801 printPassName(NAME, PARAMS, OS);
2802#include "PassRegistry.def"
2804 OS <<
"CGSCC analyses:\n";
2805#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2806#include "PassRegistry.def"
2808 OS <<
"Function passes:\n";
2809#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2810#include "PassRegistry.def"
2812 OS <<
"Function passes with params:\n";
2813#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2814 printPassName(NAME, PARAMS, OS);
2815#include "PassRegistry.def"
2817 OS <<
"Function analyses:\n";
2818#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2819#include "PassRegistry.def"
2821 OS <<
"Function alias analyses:\n";
2822#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2823#include "PassRegistry.def"
2825 OS <<
"LoopNest passes:\n";
2826#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2827#include "PassRegistry.def"
2829 OS <<
"Loop passes:\n";
2830#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2831#include "PassRegistry.def"
2833 OS <<
"Loop passes with params:\n";
2834#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2835 printPassName(NAME, PARAMS, OS);
2836#include "PassRegistry.def"
2838 OS <<
"Loop analyses:\n";
2839#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2840#include "PassRegistry.def"
2842 OS <<
"Machine module passes (WIP):\n";
2843#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2844#include "llvm/Passes/MachinePassRegistry.def"
2846 OS <<
"Machine function passes (WIP):\n";
2847#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2848#include "llvm/Passes/MachinePassRegistry.def"
2850 OS <<
"Machine function analyses (WIP):\n";
2851#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2852#include "llvm/Passes/MachinePassRegistry.def"
2858 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...
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 if the block is well formed or null if the block is not well forme...
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 Oz
A very specialized mode that will optimize for code size at any and all costs.
static LLVM_ABI const OptimizationLevel O0
Disable as many optimizations as possible.
static LLVM_ABI const OptimizationLevel Os
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
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.
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.
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.
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