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 "FunctionPropertiesStatisticsPass");
823 while (!Params.
empty()) {
825 std::tie(ParamName, Params) = Params.
split(
';');
826 std::optional<OptimizationLevel> OptLevel =
parseOptLevel(ParamName);
828 if (OptLevel && !OptLevel->isOptimizingForSize()) {
829 UnrollOpts.
setOptLevel(OptLevel->getSpeedupLevel());
836 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
843 if (ParamName ==
"partial") {
845 }
else if (ParamName ==
"peeling") {
847 }
else if (ParamName ==
"profile-peeling") {
849 }
else if (ParamName ==
"runtime") {
851 }
else if (ParamName ==
"upperbound") {
855 formatv(
"invalid LoopUnrollPass parameter '{}'", ParamName).str(),
864 Params,
"vfe-linkage-unit-visibility",
"GlobalDCE");
884 Params,
"skip-non-recursive-function-attrs",
"PostOrderFunctionAttrs");
894 formatv(
"too many CFGuardPass parameters '{}'", Params).str(),
897 if (Param ==
"check")
899 if (Param ==
"dispatch")
903 formatv(
"invalid CFGuardPass mechanism: '{}'", Param).str(),
913 "EntryExitInstrumenter");
918 "DropUnnecessaryAssumes");
927 "LowerMatrixIntrinsics");
932 while (!Params.
empty()) {
934 std::tie(ParamName, Params) = Params.
split(
';');
937 if (ParamName ==
"preserve-order")
939 else if (ParamName ==
"rename-all")
941 else if (ParamName ==
"fold-all")
943 else if (ParamName ==
"reorder-operands")
947 formatv(
"invalid normalize pass parameter '{}'", ParamName).str(),
957 while (!Params.
empty()) {
959 std::tie(ParamName, Params) = Params.
split(
';');
961 if (ParamName ==
"kernel") {
962 Result.CompileKernel =
true;
963 }
else if (ParamName ==
"use-after-scope") {
964 Result.UseAfterScope =
true;
967 formatv(
"invalid AddressSanitizer pass parameter '{}'", ParamName)
977 while (!Params.
empty()) {
979 std::tie(ParamName, Params) = Params.
split(
';');
981 if (ParamName ==
"recover") {
983 }
else if (ParamName ==
"kernel") {
984 Result.CompileKernel =
true;
987 formatv(
"invalid HWAddressSanitizer pass parameter '{}'", ParamName)
997 while (!Params.
empty()) {
999 std::tie(ParamName, Params) = Params.
split(
';');
1001 if (ParamName ==
"thinlto") {
1003 }
else if (ParamName ==
"emit-summary") {
1004 Result.EmitLTOSummary =
true;
1007 formatv(
"invalid EmbedBitcode pass parameter '{}'", ParamName).str(),
1015parseLowerAllowCheckPassOptions(
StringRef Params) {
1017 while (!Params.
empty()) {
1019 std::tie(ParamName, Params) = Params.
split(
';');
1030 std::tie(IndicesStr, CutoffStr) = ParamName.
split(
"]=");
1037 formatv(
"invalid LowerAllowCheck pass cutoffs parameter '{}' ({})",
1042 if (!IndicesStr.
consume_front(
"cutoffs[") || IndicesStr ==
"")
1044 formatv(
"invalid LowerAllowCheck pass index parameter '{}' ({})",
1045 IndicesStr, CutoffStr)
1049 while (IndicesStr !=
"") {
1051 std::tie(firstIndexStr, IndicesStr) = IndicesStr.
split(
'|');
1057 "invalid LowerAllowCheck pass index parameter '{}' ({}) {}",
1058 firstIndexStr, IndicesStr)
1065 if (index >=
Result.cutoffs.size())
1066 Result.cutoffs.resize(index + 1, 0);
1068 Result.cutoffs[index] = cutoff;
1070 }
else if (ParamName.
starts_with(
"runtime_check")) {
1072 std::tie(std::ignore, ValueString) = ParamName.
split(
"=");
1076 formatv(
"invalid LowerAllowCheck pass runtime_check parameter '{}' "
1078 ValueString, Params)
1082 Result.runtime_check = runtime_check;
1085 formatv(
"invalid LowerAllowCheck pass parameter '{}'", ParamName)
1096 while (!Params.
empty()) {
1098 std::tie(ParamName, Params) = Params.
split(
';');
1100 if (ParamName ==
"recover") {
1102 }
else if (ParamName ==
"kernel") {
1107 formatv(
"invalid argument to MemorySanitizer pass track-origins "
1112 }
else if (ParamName ==
"eager-checks") {
1113 Result.EagerChecks =
true;
1116 formatv(
"invalid MemorySanitizer pass parameter '{}'", ParamName)
1126 while (!Params.
empty()) {
1128 std::tie(ParamName, Params) = Params.
split(
';');
1135 formatv(
"invalid argument to AllocToken pass mode "
1142 formatv(
"invalid AllocToken pass parameter '{}'", ParamName).str(),
1152 while (!Params.
empty()) {
1154 std::tie(ParamName, Params) = Params.
split(
';');
1157 if (ParamName ==
"speculate-blocks") {
1159 }
else if (ParamName ==
"simplify-cond-branch") {
1161 }
else if (ParamName ==
"forward-switch-cond") {
1163 }
else if (ParamName ==
"switch-range-to-icmp") {
1165 }
else if (ParamName ==
"switch-to-arithmetic") {
1167 }
else if (ParamName ==
"switch-to-lookup") {
1169 }
else if (ParamName ==
"keep-loops") {
1171 }
else if (ParamName ==
"hoist-common-insts") {
1173 }
else if (ParamName ==
"hoist-loads-stores-with-cond-faulting") {
1175 }
else if (ParamName ==
"sink-common-insts") {
1177 }
else if (ParamName ==
"speculate-unpredictables") {
1180 APInt BonusInstThreshold;
1183 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold "
1191 formatv(
"invalid SimplifyCFG pass parameter '{}'", ParamName).str(),
1202 Result.setVerifyFixpoint(
true);
1203 while (!Params.
empty()) {
1205 std::tie(ParamName, Params) = Params.
split(
';');
1208 if (ParamName ==
"verify-fixpoint") {
1211 APInt MaxIterations;
1214 formatv(
"invalid argument to InstCombine pass max-iterations "
1222 formatv(
"invalid InstCombine pass parameter '{}'", ParamName).str(),
1232 while (!Params.
empty()) {
1234 std::tie(ParamName, Params) = Params.
split(
';');
1237 if (ParamName ==
"interleave-forced-only") {
1239 }
else if (ParamName ==
"vectorize-forced-only") {
1243 formatv(
"invalid LoopVectorize parameter '{}'", ParamName).str(),
1251 std::pair<bool, bool>
Result = {
false,
true};
1252 while (!Params.
empty()) {
1254 std::tie(ParamName, Params) = Params.
split(
';');
1257 if (ParamName ==
"nontrivial") {
1259 }
else if (ParamName ==
"trivial") {
1263 formatv(
"invalid LoopUnswitch pass parameter '{}'", ParamName).str(),
1272 while (!Params.
empty()) {
1274 std::tie(ParamName, Params) = Params.
split(
';');
1277 if (ParamName ==
"allowspeculation") {
1281 formatv(
"invalid LICM pass parameter '{}'", ParamName).str(),
1288struct LoopRotateOptions {
1289 bool EnableHeaderDuplication =
true;
1290 bool PrepareForLTO =
false;
1291 bool CheckExitCount =
false;
1295 LoopRotateOptions
Result;
1296 while (!Params.
empty()) {
1298 std::tie(ParamName, Params) = Params.
split(
';');
1301 if (ParamName ==
"header-duplication") {
1303 }
else if (ParamName ==
"prepare-for-lto") {
1305 }
else if (ParamName ==
"check-exit-count") {
1309 formatv(
"invalid LoopRotate pass parameter '{}'", ParamName).str(),
1318 while (!Params.
empty()) {
1320 std::tie(ParamName, Params) = Params.
split(
';');
1323 if (ParamName ==
"split-footer-bb") {
1327 formatv(
"invalid MergedLoadStoreMotion pass parameter '{}'",
1338 while (!Params.
empty()) {
1340 std::tie(ParamName, Params) = Params.
split(
';');
1343 if (ParamName ==
"pre") {
1345 }
else if (ParamName ==
"load-pre") {
1347 }
else if (ParamName ==
"split-backedge-load-pre") {
1349 }
else if (ParamName ==
"memdep") {
1353 }
else if (ParamName ==
"memoryssa") {
1359 formatv(
"invalid GVN pass parameter '{}'", ParamName).str(),
1368 while (!Params.
empty()) {
1370 std::tie(ParamName, Params) = Params.
split(
';');
1373 if (ParamName ==
"func-spec")
1377 formatv(
"invalid IPSCCP pass parameter '{}'", ParamName).str(),
1385 while (!Params.
empty()) {
1387 std::tie(ParamName, Params) = Params.
split(
';');
1392 formatv(
"invalid argument to Scalarizer pass min-bits "
1403 if (ParamName ==
"load-store")
1405 else if (ParamName ==
"variable-insert-extract")
1409 formatv(
"invalid Scalarizer pass parameter '{}'", ParamName).str(),
1418 if (Params.
empty() || Params ==
"modify-cfg")
1420 if (Params ==
"preserve-cfg")
1423 formatv(
"invalid SROA pass parameter '{}' (either preserve-cfg or "
1424 "modify-cfg can be specified)",
1431parseStackLifetimeOptions(
StringRef Params) {
1433 while (!Params.
empty()) {
1435 std::tie(ParamName, Params) = Params.
split(
';');
1437 if (ParamName ==
"may") {
1439 }
else if (ParamName ==
"must") {
1443 formatv(
"invalid StackLifetime parameter '{}'", ParamName).str(),
1452 "DependenceAnalysisPrinter");
1457 "SeparateConstOffsetFromGEP");
1466parseFunctionSimplificationPipelineOptions(
StringRef Params) {
1470 formatv(
"invalid function-simplification parameter '{}'", Params).str(),
1478 "MemorySSAPrinterPass");
1483 "SpeculativeExecutionPass");
1488 while (!Params.
empty()) {
1490 std::tie(ParamName, Params) = Params.
split(
';');
1496 formatv(
"invalid MemProfUse pass parameter '{}'", ParamName).str(),
1504parseStructuralHashPrinterPassOptions(
StringRef Params) {
1507 if (Params ==
"detailed")
1509 if (Params ==
"call-target-ignored")
1512 formatv(
"invalid structural hash printer parameter '{}'", Params).str(),
1518 "WinEHPreparePass");
1523 while (!Params.
empty()) {
1525 std::tie(ParamName, Params) = Params.
split(
';');
1528 if (ParamName ==
"group-by-use")
1530 else if (ParamName ==
"ignore-single-use")
1532 else if (ParamName ==
"merge-const")
1534 else if (ParamName ==
"merge-const-aggressive")
1536 else if (ParamName ==
"merge-external")
1541 formatv(
"invalid GlobalMergePass parameter '{}'", ParamName).str(),
1545 formatv(
"invalid global-merge pass parameter '{}'", Params).str(),
1554 while (!Params.
empty()) {
1556 std::tie(ParamName, Params) = Params.
split(
';');
1562 formatv(
"invalid Internalize pass parameter '{}'", ParamName).str(),
1573 while (!Params.
empty()) {
1575 std::tie(ParamName, Params) = Params.
split(
';');
1578 std::optional<RegAllocFilterFunc>
Filter =
1582 formatv(
"invalid regallocfast register filter '{}'", ParamName)
1591 if (ParamName ==
"no-clear-vregs") {
1597 formatv(
"invalid regallocfast pass parameter '{}'", ParamName).str(),
1604parseBoundsCheckingOptions(
StringRef Params) {
1606 while (!Params.
empty()) {
1608 std::tie(ParamName, Params) = Params.
split(
';');
1609 if (ParamName ==
"trap") {
1611 }
else if (ParamName ==
"rt") {
1617 }
else if (ParamName ==
"rt-abort") {
1623 }
else if (ParamName ==
"min-rt") {
1629 }
else if (ParamName ==
"min-rt-abort") {
1635 }
else if (ParamName ==
"merge") {
1637 }
else if (ParamName ==
"handler-preserve-all-regs") {
1639 Options.Rt->HandlerPreserveAllRegs =
true;
1643 std::tie(ParamEQ, Val) = ParamName.
split(
'=');
1649 formatv(
"invalid BoundsChecking pass parameter '{}'", ParamName)
1666 if (!
Prefix.empty() || Digit.getAsInteger(10,
N))
1668 Param.str().c_str());
1671 if (!
Level.has_value())
1673 "invalid optimization level for expand-ir-insts pass: %s",
1674 Digit.str().c_str());
1681 if (Params.
empty() || Params ==
"all")
1682 return RAGreedyPass::Options();
1686 return RAGreedyPass::Options{*
Filter, Params};
1689 formatv(
"invalid regallocgreedy register filter '{}'", Params).str(),
1695 "MachineSinkingPass");
1699 bool AllowTailMerge =
true;
1700 if (!Params.
empty()) {
1702 if (Params !=
"tail-merge")
1704 formatv(
"invalid MachineBlockPlacementPass parameter '{}'", Params)
1708 return AllowTailMerge;
1712 bool ClearVirtRegs =
true;
1713 if (!Params.
empty()) {
1715 if (Params !=
"clear-vregs")
1717 formatv(
"invalid VirtRegRewriter pass parameter '{}'", Params).str(),
1720 return ClearVirtRegs;
1723struct FatLTOOptions {
1724 OptimizationLevel OptLevel;
1725 bool ThinLTO =
false;
1726 bool EmitSummary =
false;
1731 bool HaveOptLevel =
false;
1732 while (!Params.
empty()) {
1734 std::tie(ParamName, Params) = Params.
split(
';');
1736 if (ParamName ==
"thinlto") {
1738 }
else if (ParamName ==
"emit-summary") {
1739 Result.EmitSummary =
true;
1740 }
else if (std::optional<OptimizationLevel> OptLevel =
1742 Result.OptLevel = *OptLevel;
1743 HaveOptLevel =
true;
1746 formatv(
"invalid fatlto-pre-link pass parameter '{}'", ParamName)
1753 "missing optimization level for fatlto-pre-link pipeline",
1768template <
typename PassManagerT,
typename CallbacksT>
1770 if (!Callbacks.empty()) {
1771 PassManagerT DummyPM;
1772 for (
auto &CB : Callbacks)
1773 if (CB(Name, DummyPM, {}))
1779template <
typename CallbacksT>
1781 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1784 if (Name ==
"module")
1786 if (Name ==
"cgscc")
1788 if (NameNoBracket ==
"function")
1790 if (Name ==
"coro-cond")
1793#define MODULE_PASS(NAME, CREATE_PASS) \
1796#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1797 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1799#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
1800 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1802#include "PassRegistry.def"
1807template <
typename CallbacksT>
1810 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1811 if (Name ==
"cgscc")
1813 if (NameNoBracket ==
"function")
1820#define CGSCC_PASS(NAME, CREATE_PASS) \
1823#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1824 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1826#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
1827 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1829#include "PassRegistry.def"
1834template <
typename CallbacksT>
1837 StringRef NameNoBracket = Name.take_until([](
char C) {
return C ==
'<'; });
1838 if (NameNoBracket ==
"function")
1840 if (Name ==
"loop" || Name ==
"loop-mssa" || Name ==
"machine-function")
1843#define FUNCTION_PASS(NAME, CREATE_PASS) \
1846#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1847 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1849#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1850 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1852#include "PassRegistry.def"
1857template <
typename CallbacksT>
1860 if (Name ==
"machine-function")
1863#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
1866#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
1868 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1871#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
1872 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1875#include "llvm/Passes/MachinePassRegistry.def"
1880template <
typename CallbacksT>
1882 bool &UseMemorySSA) {
1883 UseMemorySSA =
false;
1886 UseMemorySSA =
true;
1890#define LOOPNEST_PASS(NAME, CREATE_PASS) \
1893#include "PassRegistry.def"
1898template <
typename CallbacksT>
1900 bool &UseMemorySSA) {
1901 UseMemorySSA =
false;
1904 UseMemorySSA =
true;
1908#define LOOP_PASS(NAME, CREATE_PASS) \
1911#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
1912 if (PassBuilder::checkParametrizedPassName(Name, NAME)) \
1914#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
1915 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \
1917#include "PassRegistry.def"
1922std::optional<std::vector<PassBuilder::PipelineElement>>
1923PassBuilder::parsePipelineText(
StringRef Text) {
1924 std::vector<PipelineElement> ResultPipeline;
1929 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1930 size_t Pos =
Text.find_first_of(
",()");
1931 Pipeline.push_back({
Text.substr(0, Pos), {}});
1934 if (Pos ==
Text.npos)
1937 char Sep =
Text[Pos];
1945 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1949 assert(Sep ==
')' &&
"Bogus separator!");
1954 if (PipelineStack.
size() == 1)
1955 return std::nullopt;
1958 }
while (
Text.consume_front(
")"));
1966 if (!
Text.consume_front(
","))
1967 return std::nullopt;
1970 if (PipelineStack.
size() > 1)
1972 return std::nullopt;
1974 assert(PipelineStack.
back() == &ResultPipeline &&
1975 "Wrong pipeline at the bottom of the stack!");
1976 return {std::move(ResultPipeline)};
1986 const PipelineElement &
E) {
1987 auto &
Name =
E.Name;
1988 auto &InnerPipeline =
E.InnerPipeline;
1991 if (!InnerPipeline.empty()) {
1992 if (Name ==
"module") {
1994 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
1996 MPM.
addPass(std::move(NestedMPM));
1999 if (Name ==
"coro-cond") {
2001 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline))
2003 MPM.
addPass(CoroConditionalWrapper(std::move(NestedMPM)));
2006 if (Name ==
"cgscc") {
2008 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline))
2016 "cannot have a no-rerun module to function adaptor",
2019 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2026 for (
auto &
C : ModulePipelineParsingCallbacks)
2027 if (
C(Name, MPM, InnerPipeline))
2032 formatv(
"invalid use of '{}' pass as module pipeline", Name).str(),
2038#define MODULE_PASS(NAME, CREATE_PASS) \
2039 if (Name == NAME) { \
2040 MPM.addPass(CREATE_PASS); \
2041 return Error::success(); \
2043#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2044 if (checkParametrizedPassName(Name, NAME)) { \
2045 auto Params = parsePassParameters(PARSER, Name, NAME); \
2047 return Params.takeError(); \
2048 MPM.addPass(CREATE_PASS(Params.get())); \
2049 return Error::success(); \
2051#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
2052 if (Name == "require<" NAME ">") { \
2054 RequireAnalysisPass< \
2055 std::remove_reference_t<decltype(CREATE_PASS)>, Module>()); \
2056 return Error::success(); \
2058 if (Name == "invalidate<" NAME ">") { \
2059 MPM.addPass(InvalidateAnalysisPass< \
2060 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2061 return Error::success(); \
2063#define CGSCC_PASS(NAME, CREATE_PASS) \
2064 if (Name == NAME) { \
2065 MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS)); \
2066 return Error::success(); \
2068#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2069 if (checkParametrizedPassName(Name, NAME)) { \
2070 auto Params = parsePassParameters(PARSER, Name, NAME); \
2072 return Params.takeError(); \
2074 createModuleToPostOrderCGSCCPassAdaptor(CREATE_PASS(Params.get()))); \
2075 return Error::success(); \
2077#define FUNCTION_PASS(NAME, CREATE_PASS) \
2078 if (Name == NAME) { \
2079 if constexpr (std::is_constructible_v< \
2080 std::remove_reference_t<decltype(CREATE_PASS)>, \
2081 const TargetMachine &>) { \
2083 return make_error<StringError>( \
2084 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2085 inconvertibleErrorCode()); \
2087 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS)); \
2088 return Error::success(); \
2090#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2091 if (checkParametrizedPassName(Name, NAME)) { \
2092 auto Params = parsePassParameters(PARSER, Name, NAME); \
2094 return Params.takeError(); \
2095 auto CreatePass = CREATE_PASS; \
2096 if constexpr (std::is_constructible_v< \
2097 std::remove_reference_t<decltype(CreatePass( \
2099 const TargetMachine &, \
2100 std::remove_reference_t<decltype(Params.get())>>) { \
2102 return make_error<StringError>( \
2103 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2104 inconvertibleErrorCode()); \
2107 MPM.addPass(createModuleToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2108 return Error::success(); \
2110#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2111 if (Name == NAME) { \
2112 MPM.addPass(createModuleToFunctionPassAdaptor( \
2113 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2114 return Error::success(); \
2116#define LOOP_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_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2123 if (checkParametrizedPassName(Name, NAME)) { \
2124 auto Params = parsePassParameters(PARSER, Name, NAME); \
2126 return Params.takeError(); \
2127 MPM.addPass(createModuleToFunctionPassAdaptor( \
2128 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2129 return Error::success(); \
2131#include "PassRegistry.def"
2133 for (
auto &
C : ModulePipelineParsingCallbacks)
2134 if (
C(Name, MPM, InnerPipeline))
2137 formatv(
"unknown module pass '{}'", Name).str(),
2142 const PipelineElement &
E) {
2143 auto &
Name =
E.Name;
2144 auto &InnerPipeline =
E.InnerPipeline;
2147 if (!InnerPipeline.empty()) {
2148 if (Name ==
"cgscc") {
2150 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2153 CGPM.
addPass(std::move(NestedCGPM));
2158 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline))
2162 std::move(FPM), Params->first, Params->second));
2167 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline))
2174 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2175 if (
C(Name, CGPM, InnerPipeline))
2180 formatv(
"invalid use of '{}' pass as cgscc pipeline", Name).str(),
2185#define CGSCC_PASS(NAME, CREATE_PASS) \
2186 if (Name == NAME) { \
2187 CGPM.addPass(CREATE_PASS); \
2188 return Error::success(); \
2190#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2191 if (checkParametrizedPassName(Name, NAME)) { \
2192 auto Params = parsePassParameters(PARSER, Name, NAME); \
2194 return Params.takeError(); \
2195 CGPM.addPass(CREATE_PASS(Params.get())); \
2196 return Error::success(); \
2198#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
2199 if (Name == "require<" NAME ">") { \
2200 CGPM.addPass(RequireAnalysisPass< \
2201 std::remove_reference_t<decltype(CREATE_PASS)>, \
2202 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \
2203 CGSCCUpdateResult &>()); \
2204 return Error::success(); \
2206 if (Name == "invalidate<" NAME ">") { \
2207 CGPM.addPass(InvalidateAnalysisPass< \
2208 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2209 return Error::success(); \
2211#define FUNCTION_PASS(NAME, CREATE_PASS) \
2212 if (Name == NAME) { \
2213 if constexpr (std::is_constructible_v< \
2214 std::remove_reference_t<decltype(CREATE_PASS)>, \
2215 const TargetMachine &>) { \
2217 return make_error<StringError>( \
2218 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2219 inconvertibleErrorCode()); \
2221 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS)); \
2222 return Error::success(); \
2224#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2225 if (checkParametrizedPassName(Name, NAME)) { \
2226 auto Params = parsePassParameters(PARSER, Name, NAME); \
2228 return Params.takeError(); \
2229 auto CreatePass = CREATE_PASS; \
2230 if constexpr (std::is_constructible_v< \
2231 std::remove_reference_t<decltype(CreatePass( \
2233 const TargetMachine &, \
2234 std::remove_reference_t<decltype(Params.get())>>) { \
2236 return make_error<StringError>( \
2237 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2238 inconvertibleErrorCode()); \
2241 CGPM.addPass(createCGSCCToFunctionPassAdaptor(CREATE_PASS(Params.get()))); \
2242 return Error::success(); \
2244#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2245 if (Name == NAME) { \
2246 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2247 createFunctionToLoopPassAdaptor(CREATE_PASS, false))); \
2248 return Error::success(); \
2250#define LOOP_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_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2257 if (checkParametrizedPassName(Name, NAME)) { \
2258 auto Params = parsePassParameters(PARSER, Name, NAME); \
2260 return Params.takeError(); \
2261 CGPM.addPass(createCGSCCToFunctionPassAdaptor( \
2262 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false))); \
2263 return Error::success(); \
2265#include "PassRegistry.def"
2267 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2268 if (
C(Name, CGPM, InnerPipeline))
2275 const PipelineElement &
E) {
2276 auto &
Name =
E.Name;
2277 auto &InnerPipeline =
E.InnerPipeline;
2280 if (!InnerPipeline.empty()) {
2281 if (Name ==
"function") {
2283 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline))
2286 FPM.
addPass(std::move(NestedFPM));
2289 if (Name ==
"loop" || Name ==
"loop-mssa") {
2291 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline))
2294 bool UseMemorySSA = (
Name ==
"loop-mssa");
2299 if (Name ==
"machine-function") {
2301 if (
auto Err = parseMachinePassPipeline(MFPM, InnerPipeline))
2307 for (
auto &
C : FunctionPipelineParsingCallbacks)
2308 if (
C(Name, FPM, InnerPipeline))
2313 formatv(
"invalid use of '{}' pass as function pipeline", Name).str(),
2318#define FUNCTION_PASS(NAME, CREATE_PASS) \
2319 if (Name == NAME) { \
2320 if constexpr (std::is_constructible_v< \
2321 std::remove_reference_t<decltype(CREATE_PASS)>, \
2322 const TargetMachine &>) { \
2324 return make_error<StringError>( \
2325 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2326 inconvertibleErrorCode()); \
2328 FPM.addPass(CREATE_PASS); \
2329 return Error::success(); \
2331#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2332 if (checkParametrizedPassName(Name, NAME)) { \
2333 auto Params = parsePassParameters(PARSER, Name, NAME); \
2335 return Params.takeError(); \
2336 auto CreatePass = CREATE_PASS; \
2337 if constexpr (std::is_constructible_v< \
2338 std::remove_reference_t<decltype(CreatePass( \
2340 const TargetMachine &, \
2341 std::remove_reference_t<decltype(Params.get())>>) { \
2343 return make_error<StringError>( \
2344 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2345 inconvertibleErrorCode()); \
2348 FPM.addPass(CREATE_PASS(Params.get())); \
2349 return Error::success(); \
2351#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2352 if (Name == "require<" NAME ">") { \
2353 if constexpr (std::is_constructible_v< \
2354 std::remove_reference_t<decltype(CREATE_PASS)>, \
2355 const TargetMachine &>) { \
2357 return make_error<StringError>( \
2358 formatv("pass '{0}' requires TargetMachine", Name).str(), \
2359 inconvertibleErrorCode()); \
2362 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2364 return Error::success(); \
2366 if (Name == "invalidate<" NAME ">") { \
2367 FPM.addPass(InvalidateAnalysisPass< \
2368 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2369 return Error::success(); \
2375#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2376 if (Name == NAME) { \
2377 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2378 return Error::success(); \
2380#define LOOP_PASS(NAME, CREATE_PASS) \
2381 if (Name == NAME) { \
2382 FPM.addPass(createFunctionToLoopPassAdaptor(CREATE_PASS, false)); \
2383 return Error::success(); \
2385#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2386 if (checkParametrizedPassName(Name, NAME)) { \
2387 auto Params = parsePassParameters(PARSER, Name, NAME); \
2389 return Params.takeError(); \
2391 createFunctionToLoopPassAdaptor(CREATE_PASS(Params.get()), false)); \
2392 return Error::success(); \
2394#include "PassRegistry.def"
2396 for (
auto &
C : FunctionPipelineParsingCallbacks)
2397 if (
C(Name, FPM, InnerPipeline))
2400 formatv(
"unknown function pass '{}'", Name).str(),
2405 const PipelineElement &
E) {
2406 StringRef
Name =
E.Name;
2407 auto &InnerPipeline =
E.InnerPipeline;
2410 if (!InnerPipeline.empty()) {
2411 if (Name ==
"loop") {
2413 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline))
2416 LPM.addPass(std::move(NestedLPM));
2420 for (
auto &
C : LoopPipelineParsingCallbacks)
2421 if (
C(Name, LPM, InnerPipeline))
2426 formatv(
"invalid use of '{}' pass as loop pipeline", Name).str(),
2431#define LOOPNEST_PASS(NAME, CREATE_PASS) \
2432 if (Name == NAME) { \
2433 LPM.addPass(CREATE_PASS); \
2434 return Error::success(); \
2436#define LOOP_PASS(NAME, CREATE_PASS) \
2437 if (Name == NAME) { \
2438 LPM.addPass(CREATE_PASS); \
2439 return Error::success(); \
2441#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2442 if (checkParametrizedPassName(Name, NAME)) { \
2443 auto Params = parsePassParameters(PARSER, Name, NAME); \
2445 return Params.takeError(); \
2446 LPM.addPass(CREATE_PASS(Params.get())); \
2447 return Error::success(); \
2449#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
2450 if (Name == "require<" NAME ">") { \
2451 LPM.addPass(RequireAnalysisPass< \
2452 std::remove_reference_t<decltype(CREATE_PASS)>, Loop, \
2453 LoopAnalysisManager, LoopStandardAnalysisResults &, \
2455 return Error::success(); \
2457 if (Name == "invalidate<" NAME ">") { \
2458 LPM.addPass(InvalidateAnalysisPass< \
2459 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2460 return Error::success(); \
2462#include "PassRegistry.def"
2464 for (
auto &
C : LoopPipelineParsingCallbacks)
2465 if (
C(Name, LPM, InnerPipeline))
2472 const PipelineElement &
E) {
2473 StringRef
Name =
E.Name;
2475 if (!
E.InnerPipeline.empty()) {
2476 if (
E.Name ==
"machine-function") {
2478 if (
auto Err = parseMachinePassPipeline(NestedPM,
E.InnerPipeline))
2480 MFPM.
addPass(std::move(NestedPM));
2487#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) \
2488 if (Name == NAME) { \
2489 MFPM.addPass(CREATE_PASS); \
2490 return Error::success(); \
2492#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) \
2493 if (Name == NAME) { \
2494 MFPM.addPass(CREATE_PASS); \
2495 return Error::success(); \
2497#define MACHINE_FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, \
2499 if (checkParametrizedPassName(Name, NAME)) { \
2500 auto Params = parsePassParameters(PARSER, Name, NAME); \
2502 return Params.takeError(); \
2503 MFPM.addPass(CREATE_PASS(Params.get())); \
2504 return Error::success(); \
2506#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
2507 if (Name == "require<" NAME ">") { \
2509 RequireAnalysisPass<std::remove_reference_t<decltype(CREATE_PASS)>, \
2510 MachineFunction>()); \
2511 return Error::success(); \
2513 if (Name == "invalidate<" NAME ">") { \
2514 MFPM.addPass(InvalidateAnalysisPass< \
2515 std::remove_reference_t<decltype(CREATE_PASS)>>()); \
2516 return Error::success(); \
2518#include "llvm/Passes/MachinePassRegistry.def"
2520 for (
auto &
C : MachineFunctionPipelineParsingCallbacks)
2521 if (
C(Name, MFPM,
E.InnerPipeline))
2524 formatv(
"unknown machine pass '{}'", Name).str(),
2529#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2530 if (Name == NAME) { \
2531 AA.registerModuleAnalysis< \
2532 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2535#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
2536 if (Name == NAME) { \
2537 AA.registerFunctionAnalysis< \
2538 std::remove_reference_t<decltype(CREATE_PASS)>>(); \
2541#include "PassRegistry.def"
2543 for (
auto &
C : AAParsingCallbacks)
2549Error PassBuilder::parseMachinePassPipeline(
2551 for (
const auto &Element : Pipeline) {
2552 if (
auto Err = parseMachinePass(MFPM, Element))
2560 for (
const auto &Element : Pipeline) {
2561 if (
auto Err = parseLoopPass(LPM, Element))
2567Error PassBuilder::parseFunctionPassPipeline(
2569 for (
const auto &Element : Pipeline) {
2570 if (
auto Err = parseFunctionPass(FPM, Element))
2578 for (
const auto &Element : Pipeline) {
2579 if (
auto Err = parseCGSCCPass(CGPM, Element))
2611 for (
const auto &Element : Pipeline) {
2612 if (
auto Err = parseModulePass(MPM, Element))
2623 auto Pipeline = parsePipelineText(PipelineText);
2624 if (!Pipeline || Pipeline->empty())
2626 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2636 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2638 FunctionPipelineParsingCallbacks)) {
2639 Pipeline = {{
"function", std::move(*Pipeline)}};
2642 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2643 std::move(*Pipeline)}}}};
2644 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks,
2646 Pipeline = {{
"function", {{UseMemorySSA ?
"loop-mssa" :
"loop",
2647 std::move(*Pipeline)}}}};
2649 FirstName, MachineFunctionPipelineParsingCallbacks)) {
2650 Pipeline = {{
"function", {{
"machine-function", std::move(*Pipeline)}}}};
2652 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2653 if (
C(MPM, *Pipeline))
2657 auto &InnerPipeline = Pipeline->front().InnerPipeline;
2659 formatv(
"unknown {} name '{}'",
2660 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2666 if (
auto Err = parseModulePassPipeline(MPM, *Pipeline))
2674 auto Pipeline = parsePipelineText(PipelineText);
2675 if (!Pipeline || Pipeline->empty())
2677 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2683 formatv(
"unknown cgscc pass '{}' in pipeline '{}'", FirstName,
2688 if (
auto Err = parseCGSCCPassPipeline(CGPM, *Pipeline))
2697 auto Pipeline = parsePipelineText(PipelineText);
2698 if (!Pipeline || Pipeline->empty())
2700 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2706 formatv(
"unknown function pass '{}' in pipeline '{}'", FirstName,
2711 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline))
2719 auto Pipeline = parsePipelineText(PipelineText);
2720 if (!Pipeline || Pipeline->empty())
2722 formatv(
"invalid pipeline '{}'", PipelineText).str(),
2725 if (
auto Err = parseLoopPassPipeline(CGPM, *Pipeline))
2733 auto Pipeline = parsePipelineText(PipelineText);
2734 if (!Pipeline || Pipeline->empty())
2736 formatv(
"invalid machine pass pipeline '{}'", PipelineText).str(),
2739 if (
auto Err = parseMachinePassPipeline(MFPM, *Pipeline))
2748 if (PipelineText ==
"default") {
2753 while (!PipelineText.
empty()) {
2755 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2756 if (!parseAAPassName(
AA, Name))
2758 formatv(
"unknown alias analysis name '{}'", Name).str(),
2765std::optional<RegAllocFilterFunc>
2767 if (FilterName ==
"all")
2769 for (
auto &
C : RegClassFilterParsingCallbacks)
2770 if (
auto F =
C(FilterName))
2772 return std::nullopt;
2780 OS <<
" " <<
PassName <<
"<" << Params <<
">\n";
2786 OS <<
"Module passes:\n";
2787#define MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2788#include "PassRegistry.def"
2790 OS <<
"Module passes with params:\n";
2791#define MODULE_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2792 printPassName(NAME, PARAMS, OS);
2793#include "PassRegistry.def"
2795 OS <<
"Module analyses:\n";
2796#define MODULE_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2797#include "PassRegistry.def"
2799 OS <<
"Module alias analyses:\n";
2800#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2801#include "PassRegistry.def"
2803 OS <<
"CGSCC passes:\n";
2804#define CGSCC_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2805#include "PassRegistry.def"
2807 OS <<
"CGSCC passes with params:\n";
2808#define CGSCC_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2809 printPassName(NAME, PARAMS, OS);
2810#include "PassRegistry.def"
2812 OS <<
"CGSCC analyses:\n";
2813#define CGSCC_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2814#include "PassRegistry.def"
2816 OS <<
"Function passes:\n";
2817#define FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2818#include "PassRegistry.def"
2820 OS <<
"Function passes with params:\n";
2821#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2822 printPassName(NAME, PARAMS, OS);
2823#include "PassRegistry.def"
2825 OS <<
"Function analyses:\n";
2826#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2827#include "PassRegistry.def"
2829 OS <<
"Function alias analyses:\n";
2830#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2831#include "PassRegistry.def"
2833 OS <<
"LoopNest passes:\n";
2834#define LOOPNEST_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2835#include "PassRegistry.def"
2837 OS <<
"Loop passes:\n";
2838#define LOOP_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2839#include "PassRegistry.def"
2841 OS <<
"Loop passes with params:\n";
2842#define LOOP_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS) \
2843 printPassName(NAME, PARAMS, OS);
2844#include "PassRegistry.def"
2846 OS <<
"Loop analyses:\n";
2847#define LOOP_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2848#include "PassRegistry.def"
2850 OS <<
"Machine module passes (WIP):\n";
2851#define MACHINE_MODULE_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2852#include "llvm/Passes/MachinePassRegistry.def"
2854 OS <<
"Machine function passes (WIP):\n";
2855#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) printPassName(NAME, OS);
2856#include "llvm/Passes/MachinePassRegistry.def"
2858 OS <<
"Machine function analyses (WIP):\n";
2859#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) printPassName(NAME, OS);
2860#include "llvm/Passes/MachinePassRegistry.def"
2866 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; 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 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