187 using namespace llvm;
194 cl::desc(
"Run Partial inlinining pass"));
198 cl::desc(
"Control the amount of inlining in pre-instrumentation inliner " 204 cl::desc(
"Run NewGVN instead of GVN"));
208 cl::desc(
"Enable the GVN hoisting pass for the new PM (default = off)"));
212 cl::desc(
"Enable the GVN hoisting pass for the new PM (default = off)"));
216 cl::desc(
"Enable the Unroll and Jam pass for the new PM (default = off)"));
220 cl::desc(
"Run synthetic function entry count generation " 224 "^(default|thinlto-pre-link|thinlto|lto-pre-link|lto)<(O[0123sz])>$");
230 cl::desc(
"Enable control height reduction optimization (CHR)"));
265 struct NoOpModulePass {
284 struct NoOpCGSCCPass {
306 struct NoOpFunctionPass {
325 struct NoOpLoopPass {
353 void PassBuilder::invokePeepholeEPCallbacks(
355 for (
auto &
C : PeepholeEPCallbacks)
360 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ 361 MAM.registerPass([&] { return CREATE_PASS; }); 362 #include "PassRegistry.def" 364 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
369 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ 370 CGAM.registerPass([&] { return CREATE_PASS; }); 371 #include "PassRegistry.def" 373 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
378 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ 379 FAM.registerPass([&] { return CREATE_PASS; }); 380 #include "PassRegistry.def" 382 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
387 #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ 388 LAM.registerPass([&] { return CREATE_PASS; }); 389 #include "PassRegistry.def" 391 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
399 assert(Level != O0 &&
"Must request optimizations!");
437 invokePeepholeEPCallbacks(FPM, Level);
475 LPM1.addPass(
LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap));
480 for (
auto &
C : LateLoopOptimizationsEPCallbacks)
487 if ((Phase != ThinLTOPhase::PreLink || !PGOOpt ||
491 PTO.ForgetAllSCEVInLoopUnroll));
493 for (
auto &
C : LoopOptimizerEndEPCallbacks)
507 std::move(LPM2),
false, DebugLogging));
538 invokePeepholeEPCallbacks(FPM, Level);
547 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap),
551 for (
auto &
C : ScalarOptimizerLateEPCallbacks)
560 invokePeepholeEPCallbacks(FPM, Level);
562 if (
EnableCHR && Level == O3 && PGOOpt &&
572 bool RunProfileGen,
bool IsCS,
573 std::string ProfileFile,
574 std::string ProfileRemappingFile) {
575 assert(Level != O0 &&
"Not expecting O0 here!");
600 invokePeepholeEPCallbacks(FPM, Level);
612 if (!RunProfileGen) {
613 assert(!ProfileFile.empty() &&
"Profile use expecting a profile file!");
631 if (!ProfileFile.empty())
640 bool DebugLogging,
bool RunProfileGen,
641 bool IsCS, std::string ProfileFile,
642 std::string ProfileRemappingFile) {
643 if (!RunProfileGen) {
644 assert(!ProfileFile.empty() &&
"Profile use expecting a profile file!");
656 if (!ProfileFile.empty())
667 unsigned OptLevel = Level > O3 ? 2 :
Level;
668 unsigned SizeLevel = Level > O3 ? Level - O3 : 0;
683 bool LoadSampleProfile =
685 !(FlattenedProfileUsed && Phase == ThinLTOPhase::PostLink);
701 if (Phase == ThinLTOPhase::PostLink && !LoadSampleProfile)
724 if (LoadSampleProfile)
728 if (LoadSampleProfile) {
732 PGOOpt->ProfileRemappingFile,
733 Phase == ThinLTOPhase::PreLink));
739 if (Phase != ThinLTOPhase::PreLink)
776 invokePeepholeEPCallbacks(GlobalCleanupPM, Level);
782 if (PGOOpt && Phase != ThinLTOPhase::PostLink &&
785 addPGOInstrPasses(MPM, DebugLogging, Level,
787 false, PGOOpt->ProfileFile,
788 PGOOpt->ProfileRemappingFile);
791 if (PGOOpt && Phase != ThinLTOPhase::PostLink &&
824 if (Phase == ThinLTOPhase::PreLink && PGOOpt &&
840 buildFunctionSimplificationPipeline(Level, Phase, DebugLogging)));
842 for (
auto &
C : CGSCCOptimizerLateEPCallbacks)
843 C(MainCGPipeline, Level);
882 if (EnableOrderFileInstrumentation)
894 if (!LTOPreLink && PGOOpt) {
896 addPGOInstrPasses(MPM, DebugLogging, Level,
true,
897 true, PGOOpt->CSProfileGenFile,
898 PGOOpt->ProfileRemappingFile);
900 addPGOInstrPasses(MPM, DebugLogging, Level,
false,
901 true, PGOOpt->ProfileFile,
902 PGOOpt->ProfileRemappingFile);
925 for (
auto &
C : VectorizerStartEPCallbacks)
926 C(OptimizePM, Level);
959 forwardSwitchCondToPhi(
true).
960 convertSwitchToLookupTable(
true).
961 needCanonicalLoops(
false).
962 sinkCommonInsts(
true)));
965 if (PTO.SLPVectorization)
982 PTO.ForgetAllSCEVInLoopUnroll)));
987 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap),
997 if (EnableHotColdSplit && !LTOPreLink)
1023 for (
auto &
C : OptimizerLastEPCallbacks)
1024 C(OptimizePM, Level);
1043 bool DebugLogging,
bool LTOPreLink) {
1044 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
1052 for (
auto &
C : PipelineStartEPCallbacks)
1055 if (PGOOpt && PGOOpt->SamplePGOSupport)
1063 MPM.
addPass(buildModuleOptimizationPipeline(Level, DebugLogging, LTOPreLink));
1070 bool DebugLogging) {
1071 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
1078 if (PGOOpt && PGOOpt->SamplePGOSupport)
1082 for (
auto &
C : PipelineStartEPCallbacks)
1088 MPM.
addPass(buildModuleSimplificationPipeline(Level, ThinLTOPhase::PreLink,
1112 if (ImportSummary) {
1139 MPM.
addPass(buildModuleSimplificationPipeline(Level, ThinLTOPhase::PostLink,
1143 MPM.
addPass(buildModuleOptimizationPipeline(Level, DebugLogging));
1150 bool DebugLogging) {
1151 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
1153 return buildPerModuleDefaultPipeline(Level, DebugLogging,
1173 PGOOpt->ProfileRemappingFile,
1257 invokePeepholeEPCallbacks(PeepholeFPM, Level);
1279 invokePeepholeEPCallbacks(FPM, Level);
1287 addPGOInstrPasses(MPM, DebugLogging, Level,
true,
1288 true, PGOOpt->CSProfileGenFile,
1289 PGOOpt->ProfileRemappingFile);
1291 addPGOInstrPasses(MPM, DebugLogging, Level,
false,
1292 true, PGOOpt->ProfileFile,
1293 PGOOpt->ProfileRemappingFile);
1347 invokePeepholeEPCallbacks(MainFPM, Level);
1363 if (EnableHotColdSplit)
1449 template <
typename ParametersParseCallableT>
1450 auto parsePassParameters(ParametersParseCallableT &&Parser,
StringRef Name,
1452 using ParametersT =
typename decltype(Parser(
StringRef{}))::value_type;
1457 "unable to strip pass name from parametrized pass specification");
1460 return ParametersT{};
1462 assert(
false &&
"invalid format for parametrized pass name");
1466 assert((Result || Result.template errorIsA<StringError>()) &&
1467 "Pass parameter parser can only return StringErrors.");
1474 while (!Params.
empty()) {
1476 std::tie(ParamName, Params) = Params.
split(
';');
1483 if (OptLevel >= 0) {
1490 return make_error<StringError>(
1491 formatv(
"invalid LoopUnrollPass parameter '{0}' ", ParamName).str(),
1498 if (ParamName ==
"partial") {
1500 }
else if (ParamName ==
"peeling") {
1502 }
else if (ParamName ==
"profile-peeling") {
1504 }
else if (ParamName ==
"runtime") {
1506 }
else if (ParamName ==
"upperbound") {
1509 return make_error<StringError>(
1510 formatv(
"invalid LoopUnrollPass parameter '{0}' ", ParamName).str(),
1519 while (!Params.
empty()) {
1521 std::tie(ParamName, Params) = Params.
split(
';');
1523 if (ParamName ==
"recover") {
1525 }
else if (ParamName ==
"kernel") {
1529 return make_error<StringError>(
1530 formatv(
"invalid argument to MemorySanitizer pass track-origins " 1531 "parameter: '{0}' ",
1536 return make_error<StringError>(
1537 formatv(
"invalid MemorySanitizer pass parameter '{0}' ", ParamName)
1548 while (!Params.
empty()) {
1550 std::tie(ParamName, Params) = Params.
split(
';');
1553 if (ParamName ==
"forward-switch-cond") {
1555 }
else if (ParamName ==
"switch-to-lookup") {
1557 }
else if (ParamName ==
"keep-loops") {
1559 }
else if (ParamName ==
"sink-common-insts") {
1561 }
else if (Enable && ParamName.
consume_front(
"bonus-inst-threshold=")) {
1562 APInt BonusInstThreshold;
1564 return make_error<StringError>(
1565 formatv(
"invalid argument to SimplifyCFG pass bonus-threshold " 1566 "parameter: '{0}' ",
1571 return make_error<StringError>(
1572 formatv(
"invalid SimplifyCFG pass parameter '{0}' ", ParamName).str(),
1582 while (!Params.
empty()) {
1584 std::tie(ParamName, Params) = Params.
split(
';');
1587 if (ParamName ==
"interleave-forced-only") {
1589 }
else if (ParamName ==
"vectorize-forced-only") {
1592 return make_error<StringError>(
1593 formatv(
"invalid LoopVectorize parameter '{0}' ", ParamName).str(),
1601 bool Result =
false;
1602 while (!Params.
empty()) {
1604 std::tie(ParamName, Params) = Params.
split(
';');
1607 if (ParamName ==
"nontrivial") {
1610 return make_error<StringError>(
1611 formatv(
"invalid LoopUnswitch pass parameter '{0}' ", ParamName)
1620 bool Result =
false;
1621 while (!Params.
empty()) {
1623 std::tie(ParamName, Params) = Params.
split(
';');
1626 if (ParamName ==
"split-footer-bb") {
1629 return make_error<StringError>(
1630 formatv(
"invalid MergedLoadStoreMotion pass parameter '{0}' ",
1655 template <
typename PassManagerT,
typename CallbacksT>
1657 if (!Callbacks.empty()) {
1658 PassManagerT DummyPM;
1659 for (
auto &CB : Callbacks)
1660 if (CB(Name, DummyPM, {}))
1666 template <
typename CallbacksT>
1673 if (Name ==
"module")
1675 if (Name ==
"cgscc")
1677 if (Name ==
"function")
1684 #define MODULE_PASS(NAME, CREATE_PASS) \ 1687 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ 1688 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1690 #include "PassRegistry.def" 1692 return callbacksAcceptPassName<ModulePassManager>(
Name, Callbacks);
1695 template <
typename CallbacksT>
1698 if (Name ==
"cgscc")
1700 if (Name ==
"function")
1709 #define CGSCC_PASS(NAME, CREATE_PASS) \ 1712 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ 1713 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1715 #include "PassRegistry.def" 1717 return callbacksAcceptPassName<CGSCCPassManager>(
Name, Callbacks);
1720 template <
typename CallbacksT>
1723 if (Name ==
"function")
1725 if (Name ==
"loop" || Name ==
"loop-mssa")
1732 #define FUNCTION_PASS(NAME, CREATE_PASS) \ 1735 #define FUNCTION_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER) \ 1736 if (checkParametrizedPassName(Name, NAME)) \ 1738 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ 1739 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1741 #include "PassRegistry.def" 1743 return callbacksAcceptPassName<FunctionPassManager>(
Name, Callbacks);
1746 template <
typename CallbacksT>
1749 if (Name ==
"loop" || Name ==
"loop-mssa")
1756 #define LOOP_PASS(NAME, CREATE_PASS) \ 1759 #define LOOP_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER) \ 1760 if (checkParametrizedPassName(Name, NAME)) \ 1762 #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ 1763 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1765 #include "PassRegistry.def" 1767 return callbacksAcceptPassName<LoopPassManager>(
Name, Callbacks);
1771 PassBuilder::parsePipelineText(
StringRef Text) {
1772 std::vector<PipelineElement> ResultPipeline;
1777 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1779 Pipeline.push_back({Text.
substr(0, Pos), {}});
1782 if (Pos == Text.
npos)
1785 char Sep = Text[Pos];
1786 Text = Text.
substr(Pos + 1);
1793 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1797 assert(Sep ==
')' &&
"Bogus separator!");
1802 if (PipelineStack.
size() == 1)
1818 if (PipelineStack.
size() > 1)
1822 assert(PipelineStack.
back() == &ResultPipeline &&
1823 "Wrong pipeline at the bottom of the stack!");
1824 return {std::move(ResultPipeline)};
1828 const PipelineElement &
E,
1829 bool VerifyEachPass,
bool DebugLogging) {
1830 auto &
Name = E.Name;
1831 auto &InnerPipeline = E.InnerPipeline;
1834 if (!InnerPipeline.empty()) {
1835 if (
Name ==
"module") {
1837 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline,
1838 VerifyEachPass, DebugLogging))
1840 MPM.
addPass(std::move(NestedMPM));
1843 if (
Name ==
"cgscc") {
1845 if (
auto Err = parseCGSCCPassPipeline(CGPM, InnerPipeline, VerifyEachPass,
1851 if (
Name ==
"function") {
1853 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline,
1854 VerifyEachPass, DebugLogging))
1861 if (
auto Err = parseModulePassPipeline(NestedMPM, InnerPipeline,
1862 VerifyEachPass, DebugLogging))
1868 for (
auto &
C : ModulePipelineParsingCallbacks)
1869 if (
C(
Name, MPM, InnerPipeline))
1873 return make_error<StringError>(
1874 formatv(
"invalid use of '{0}' pass as module pipeline",
Name).str(),
1883 return make_error<StringError>(
1884 formatv(
"unknown default pipeline alias '{0}'",
Name).str(),
1887 assert(Matches.
size() == 3 &&
"Must capture two matched strings!");
1898 if (PGOOpt && Matches[1] !=
"thinlto" &&
1901 addPGOInstrPassesForO0(
1904 false, PGOOpt->ProfileFile,
1905 PGOOpt->ProfileRemappingFile);
1913 PTO.LoopVectorization = L > O1 && L < Oz;
1914 PTO.SLPVectorization = L > O1 && L < Oz;
1916 if (Matches[1] ==
"default") {
1917 MPM.
addPass(buildPerModuleDefaultPipeline(L, DebugLogging));
1918 }
else if (Matches[1] ==
"thinlto-pre-link") {
1919 MPM.
addPass(buildThinLTOPreLinkDefaultPipeline(L, DebugLogging));
1920 }
else if (Matches[1] ==
"thinlto") {
1921 MPM.
addPass(buildThinLTODefaultPipeline(L, DebugLogging,
nullptr));
1922 }
else if (Matches[1] ==
"lto-pre-link") {
1923 MPM.
addPass(buildLTOPreLinkDefaultPipeline(L, DebugLogging));
1925 assert(Matches[1] ==
"lto" &&
"Not one of the matched options!");
1926 MPM.
addPass(buildLTODefaultPipeline(L, DebugLogging,
nullptr));
1932 #define MODULE_PASS(NAME, CREATE_PASS) \ 1933 if (Name == NAME) { \ 1934 MPM.addPass(CREATE_PASS); \ 1935 return Error::success(); \ 1937 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ 1938 if (Name == "require<" NAME ">") { \ 1940 RequireAnalysisPass< \ 1941 std::remove_reference<decltype(CREATE_PASS)>::type, Module>()); \ 1942 return Error::success(); \ 1944 if (Name == "invalidate<" NAME ">") { \ 1945 MPM.addPass(InvalidateAnalysisPass< \ 1946 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 1947 return Error::success(); \ 1949 #include "PassRegistry.def" 1951 for (
auto &
C : ModulePipelineParsingCallbacks)
1952 if (
C(
Name, MPM, InnerPipeline))
1954 return make_error<StringError>(
1960 const PipelineElement &E,
bool VerifyEachPass,
1961 bool DebugLogging) {
1962 auto &
Name = E.Name;
1963 auto &InnerPipeline = E.InnerPipeline;
1966 if (!InnerPipeline.empty()) {
1967 if (
Name ==
"cgscc") {
1969 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline,
1970 VerifyEachPass, DebugLogging))
1973 CGPM.
addPass(std::move(NestedCGPM));
1976 if (
Name ==
"function") {
1978 if (
auto Err = parseFunctionPassPipeline(FPM, InnerPipeline,
1979 VerifyEachPass, DebugLogging))
1987 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline,
1988 VerifyEachPass, DebugLogging))
1995 if (
auto Err = parseCGSCCPassPipeline(NestedCGPM, InnerPipeline,
1996 VerifyEachPass, DebugLogging))
2003 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2004 if (
C(
Name, CGPM, InnerPipeline))
2008 return make_error<StringError>(
2009 formatv(
"invalid use of '{0}' pass as cgscc pipeline",
Name).str(),
2014 #define CGSCC_PASS(NAME, CREATE_PASS) \ 2015 if (Name == NAME) { \ 2016 CGPM.addPass(CREATE_PASS); \ 2017 return Error::success(); \ 2019 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ 2020 if (Name == "require<" NAME ">") { \ 2021 CGPM.addPass(RequireAnalysisPass< \ 2022 std::remove_reference<decltype(CREATE_PASS)>::type, \ 2023 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \ 2024 CGSCCUpdateResult &>()); \ 2025 return Error::success(); \ 2027 if (Name == "invalidate<" NAME ">") { \ 2028 CGPM.addPass(InvalidateAnalysisPass< \ 2029 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 2030 return Error::success(); \ 2032 #include "PassRegistry.def" 2034 for (
auto &
C : CGSCCPipelineParsingCallbacks)
2035 if (
C(
Name, CGPM, InnerPipeline))
2037 return make_error<StringError>(
2043 const PipelineElement &E,
2044 bool VerifyEachPass,
bool DebugLogging) {
2045 auto &
Name = E.Name;
2046 auto &InnerPipeline = E.InnerPipeline;
2049 if (!InnerPipeline.empty()) {
2050 if (
Name ==
"function") {
2052 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline,
2053 VerifyEachPass, DebugLogging))
2056 FPM.
addPass(std::move(NestedFPM));
2059 if (
Name ==
"loop" ||
Name ==
"loop-mssa") {
2061 if (
auto Err = parseLoopPassPipeline(LPM, InnerPipeline, VerifyEachPass,
2065 bool UseMemorySSA = (
Name ==
"loop-mssa");
2072 if (
auto Err = parseFunctionPassPipeline(NestedFPM, InnerPipeline,
2073 VerifyEachPass, DebugLogging))
2079 for (
auto &
C : FunctionPipelineParsingCallbacks)
2080 if (
C(
Name, FPM, InnerPipeline))
2084 return make_error<StringError>(
2085 formatv(
"invalid use of '{0}' pass as function pipeline",
Name).str(),
2090 #define FUNCTION_PASS(NAME, CREATE_PASS) \ 2091 if (Name == NAME) { \ 2092 FPM.addPass(CREATE_PASS); \ 2093 return Error::success(); \ 2095 #define FUNCTION_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER) \ 2096 if (checkParametrizedPassName(Name, NAME)) { \ 2097 auto Params = parsePassParameters(PARSER, Name, NAME); \ 2099 return Params.takeError(); \ 2100 FPM.addPass(CREATE_PASS(Params.get())); \ 2101 return Error::success(); \ 2103 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ 2104 if (Name == "require<" NAME ">") { \ 2106 RequireAnalysisPass< \ 2107 std::remove_reference<decltype(CREATE_PASS)>::type, Function>()); \ 2108 return Error::success(); \ 2110 if (Name == "invalidate<" NAME ">") { \ 2111 FPM.addPass(InvalidateAnalysisPass< \ 2112 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 2113 return Error::success(); \ 2115 #include "PassRegistry.def" 2117 for (
auto &
C : FunctionPipelineParsingCallbacks)
2118 if (
C(
Name, FPM, InnerPipeline))
2120 return make_error<StringError>(
2121 formatv(
"unknown function pass '{0}'",
Name).str(),
2126 bool VerifyEachPass,
bool DebugLogging) {
2128 auto &InnerPipeline = E.InnerPipeline;
2131 if (!InnerPipeline.empty()) {
2132 if (Name ==
"loop") {
2134 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline,
2135 VerifyEachPass, DebugLogging))
2138 LPM.
addPass(std::move(NestedLPM));
2143 if (
auto Err = parseLoopPassPipeline(NestedLPM, InnerPipeline,
2144 VerifyEachPass, DebugLogging))
2150 for (
auto &
C : LoopPipelineParsingCallbacks)
2151 if (
C(Name, LPM, InnerPipeline))
2155 return make_error<StringError>(
2156 formatv(
"invalid use of '{0}' pass as loop pipeline", Name).str(),
2161 #define LOOP_PASS(NAME, CREATE_PASS) \ 2162 if (Name == NAME) { \ 2163 LPM.addPass(CREATE_PASS); \ 2164 return Error::success(); \ 2166 #define LOOP_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER) \ 2167 if (checkParametrizedPassName(Name, NAME)) { \ 2168 auto Params = parsePassParameters(PARSER, Name, NAME); \ 2170 return Params.takeError(); \ 2171 LPM.addPass(CREATE_PASS(Params.get())); \ 2172 return Error::success(); \ 2174 #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ 2175 if (Name == "require<" NAME ">") { \ 2176 LPM.addPass(RequireAnalysisPass< \ 2177 std::remove_reference<decltype(CREATE_PASS)>::type, Loop, \ 2178 LoopAnalysisManager, LoopStandardAnalysisResults &, \ 2180 return Error::success(); \ 2182 if (Name == "invalidate<" NAME ">") { \ 2183 LPM.addPass(InvalidateAnalysisPass< \ 2184 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 2185 return Error::success(); \ 2187 #include "PassRegistry.def" 2189 for (
auto &
C : LoopPipelineParsingCallbacks)
2190 if (
C(Name, LPM, InnerPipeline))
2192 return make_error<StringError>(
formatv(
"unknown loop pass '{0}'", Name).str(),
2197 #define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ 2198 if (Name == NAME) { \ 2199 AA.registerModuleAnalysis< \ 2200 std::remove_reference<decltype(CREATE_PASS)>::type>(); \ 2203 #define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ 2204 if (Name == NAME) { \ 2205 AA.registerFunctionAnalysis< \ 2206 std::remove_reference<decltype(CREATE_PASS)>::type>(); \ 2209 #include "PassRegistry.def" 2211 for (
auto &
C : AAParsingCallbacks)
2219 bool VerifyEachPass,
2220 bool DebugLogging) {
2221 for (
const auto &Element : Pipeline) {
2222 if (
auto Err = parseLoopPass(LPM, Element, VerifyEachPass, DebugLogging))
2231 bool VerifyEachPass,
2232 bool DebugLogging) {
2233 for (
const auto &Element : Pipeline) {
2235 parseFunctionPass(FPM, Element, VerifyEachPass, DebugLogging))
2245 bool VerifyEachPass,
2246 bool DebugLogging) {
2247 for (
const auto &Element : Pipeline) {
2248 if (
auto Err = parseCGSCCPass(CGPM, Element, VerifyEachPass, DebugLogging))
2270 bool VerifyEachPass,
2271 bool DebugLogging) {
2272 for (
const auto &Element : Pipeline) {
2273 if (
auto Err = parseModulePass(MPM, Element, VerifyEachPass, DebugLogging))
2286 bool VerifyEachPass,
bool DebugLogging) {
2287 auto Pipeline = parsePipelineText(PipelineText);
2288 if (!Pipeline || Pipeline->
empty())
2289 return make_error<StringError>(
2290 formatv(
"invalid pipeline '{0}'", PipelineText).str(),
2299 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
2301 FunctionPipelineParsingCallbacks)) {
2302 Pipeline = {{
"function", std::move(*Pipeline)}};
2303 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks)) {
2304 Pipeline = {{
"function", {{
"loop", std::move(*Pipeline)}}}};
2306 for (
auto &
C : TopLevelPipelineParsingCallbacks)
2307 if (
C(MPM, *Pipeline, VerifyEachPass, DebugLogging))
2311 auto &InnerPipeline = Pipeline->
front().InnerPipeline;
2312 return make_error<StringError>(
2313 formatv(
"unknown {0} name '{1}'",
2314 (InnerPipeline.empty() ?
"pass" :
"pipeline"), FirstName)
2321 parseModulePassPipeline(MPM, *Pipeline, VerifyEachPass, DebugLogging))
2329 bool VerifyEachPass,
bool DebugLogging) {
2330 auto Pipeline = parsePipelineText(PipelineText);
2331 if (!Pipeline || Pipeline->
empty())
2332 return make_error<StringError>(
2333 formatv(
"invalid pipeline '{0}'", PipelineText).str(),
2338 return make_error<StringError>(
2339 formatv(
"unknown cgscc pass '{0}' in pipeline '{1}'", FirstName,
2345 parseCGSCCPassPipeline(CGPM, *Pipeline, VerifyEachPass, DebugLogging))
2354 bool VerifyEachPass,
bool DebugLogging) {
2355 auto Pipeline = parsePipelineText(PipelineText);
2356 if (!Pipeline || Pipeline->
empty())
2357 return make_error<StringError>(
2358 formatv(
"invalid pipeline '{0}'", PipelineText).str(),
2363 return make_error<StringError>(
2364 formatv(
"unknown function pass '{0}' in pipeline '{1}'", FirstName,
2369 if (
auto Err = parseFunctionPassPipeline(FPM, *Pipeline, VerifyEachPass,
2378 bool VerifyEachPass,
bool DebugLogging) {
2379 auto Pipeline = parsePipelineText(PipelineText);
2380 if (!Pipeline || Pipeline->
empty())
2381 return make_error<StringError>(
2382 formatv(
"invalid pipeline '{0}'", PipelineText).str(),
2386 parseLoopPassPipeline(CGPM, *Pipeline, VerifyEachPass, DebugLogging))
2395 if (PipelineText ==
"default") {
2396 AA = buildDefaultAAPipeline();
2400 while (!PipelineText.
empty()) {
2402 std::tie(Name, PipelineText) = PipelineText.
split(
',');
2403 if (!parseAAPassName(AA, Name))
2404 return make_error<StringError>(
2405 formatv(
"unknown alias analysis name '{0}'", Name).str(),
Super simple passes to force specific function attrs from the commandline into the IR for debugging p...
Defines passes for running instruction simplification across chunks of IR.
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
const T & front() const
front - Get the first element.
Analysis pass providing a never-invalidated alias analysis result.
static cl::opt< int > PreInlineThreshold("npm-preinline-threshold", cl::Hidden, cl::init(75), cl::ZeroOrMore, cl::desc("Control the amount of inlining in pre-instrumentation inliner " "(default = 75)"))
A set of parameters used to control various transforms performed by the LoopUnroll pass...
Computes function attributes in post-order over the call graph.
ModulePassManager buildPerModuleDefaultPipeline(OptimizationLevel Level, bool DebugLogging=false, bool LTOPreLink=false)
Build a per-module default optimization pipeline.
A simple loop rotation transformation.
A simple and fast domtree-based CSE pass.
The profile annotation (profile-instr-use) pass for IR based PGO.
Thresholds to tune inline cost analysis.
bool LoopVectorization
Tuning option to enable/disable loop vectorization.
Interfaces for registering analysis passes, producing common pass manager configurations, and parsing of pass pipelines.
AAManager buildDefaultAAPipeline()
Build the default AAManager with the default alias analysis pipeline registered.
Eliminate dead arguments (and return values) from functions.
LLVM_NODISCARD bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
This is the interface for LLVM's inclusion-based alias analysis implemented with CFL graph reachabili...
This class represents lattice values for constants.
static Optional< int > parseRepeatPassName(StringRef Name)
This header provides classes for managing a pipeline of passes over loops in LLVM IR...
cl::opt< bool > ForgetSCEVInLoopUnroll
This is the interface for a simple mod/ref and alias analysis over globals.
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Error parseAAPipeline(AAManager &AA, StringRef PipelineText)
Parse a textual alias analysis pipeline into the provided AA manager.
This is the interface to build a ModuleSummaryIndex for a module.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Uses an "inverted" value numbering to decide the similarity of expressions and sinks similar expressi...
InnerAnalysisManagerProxy< LoopAnalysisManager, Function > LoopAnalysisManagerFunctionProxy
A proxy from a LoopAnalysisManager to a Function.
Performs basic CFG simplifications to assist other loop passes.
This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.
void push_back(const T &Elt)
This file implements a simple N^2 alias analysis accuracy evaluator.
InnerAnalysisManagerProxy< CGSCCAnalysisManager, Module > CGSCCAnalysisManagerModuleProxy
A proxy from a CGSCCAnalysisManager to a Module.
Implements a lazy call graph analysis and related passes for the new pass manager.
RepeatedPass< PassT > createRepeatedPass(int Count, PassT P)
This file implements the Loop Fusion pass.
void registerModuleAnalyses(ModuleAnalysisManager &MAM)
Registers all available module analysis passes.
bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
This is the interface for a metadata-based scoped no-alias analysis.
SimplifyCFGOptions & bonusInstThreshold(int I)
SimplifyCFGOptions & sinkCommonInsts(bool B)
void registerModuleAnalysis()
Register a specific AA result.
LoopUnrollOptions & setFullUnrollMaxCount(unsigned O)
The instrumentation pass for recording function order.
ModulePassManager buildModuleOptimizationPipeline(OptimizationLevel Level, bool DebugLogging=false, bool LTOPreLink=false)
Construct the core LLVM module optimization pipeline.
LoopUnrollOptions & setUpperBound(bool UpperBound)
Enables or disables the use of trip count upper bound in loop unrolling.
ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT > createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
CGSCCToFunctionPassAdaptor< FunctionPassT > createCGSCCToFunctionPassAdaptor(FunctionPassT Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
Pass to remove unused function declarations.
OptimizationLevel
LLVM-provided high-level optimization levels.
ModulePassManager buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level, bool DebugLogging=false)
Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager.
This file provides the interface for LLVM's PGO Instrumentation lowering pass.
OuterAnalysisManagerProxy< FunctionAnalysisManager, Loop, LoopStandardAnalysisResults & > FunctionAnalysisManagerLoopProxy
A proxy from a FunctionAnalysisManager to a Loop.
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
Loop unroll pass that only does full loop unrolling.
Loop unroll pass that will support both full and partial unrolling.
Pass to perform split of global variables.
This pass transforms loops that contain branches or switches on loop- invariant conditions to have mu...
A DCE pass that assumes instructions are dead until proven otherwise.
static cl::opt< bool > EnableSyntheticCounts("enable-npm-synthetic-counts", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Run synthetic function entry count generation " "pass"))
A utility pass template to force an analysis result to be available.
static cl::opt< bool > EnableGVNHoist("enable-npm-gvn-hoist", cl::init(false), cl::Hidden, cl::desc("Enable the GVN hoisting pass for the new PM (default = off)"))
Reassociate commutative expressions.
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
StringSwitch & Case(StringLiteral S, T Value)
cl::opt< bool > EnableHotColdSplit
Run instruction simplification across each instruction in the function.
Pass to forward loads in a loop around the backedge to subsequent iterations.
SimplifyCFGOptions & forwardSwitchCondToPhi(bool B)
cl::opt< bool > EnableLoopInterleaving
A pass that transforms external global definitions into declarations.
This pass handles simple speculating of instructions around PHIs when doing so is profitable for a pa...
A simple and fast domtree-based GVN pass to hoist common expressions from sibling branches...
This is the interface for a SCEV-based alias analysis.
ModulePassManager buildModuleSimplificationPipeline(OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging=false)
Construct the core LLVM module canonicalization and simplification pipeline.
A pass to do RPO deduction and propagation of function attributes.
Optional< int > HintThreshold
Threshold to use for callees with inline hint.
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
Instrumentation based profiling lowering pass.
bool registerPass(PassBuilderT &&PassBuilder)
Register an analysis pass with the manager.
LLVM_NODISCARD R Default(T Value)
static cl::opt< bool > EnableGVNSink("enable-npm-gvn-sink", cl::init(false), cl::Hidden, cl::desc("Enable the GVN hoisting pass for the new PM (default = off)"))
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
Hoist/decompose integer division and remainder instructions to enable CFG improvements and better cod...
Tagged union holding either a T or a Error.
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
void registerLoopAnalyses(LoopAnalysisManager &LAM)
Registers all available loop analysis passes.
The instrumentation (profile-instr-gen) pass for IR based PGO.
A very specialized mode that will optimize for code size at any and all costs.
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
The sample profiler data loader pass.
This file provides the interface for IR based instrumentation passes ( (profile-gen, and profile-use).
bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr, std::string *Error=nullptr) const
matches - Match the regex against a given String.
int64_t getSExtValue() const
Get sign extended value.
static bool isModulePassName(StringRef Name, CallbacksT &Callbacks)
falkor hwpf fix Falkor HW Prefetch Fix Late Phase
This file provides the interface for a simple, fast CSE pass.
This file provides the interface for the GCOV style profiler pass.
Performs Loop Invariant Code Motion Pass.
The core GVN pass object.
void crossRegisterProxies(LoopAnalysisManager &LAM, FunctionAnalysisManager &FAM, CGSCCAnalysisManager &CGAM, ModuleAnalysisManager &MAM)
Cross register the analysis managers through their proxies.
Pass to remove unused function declarations.
A lazily constructed view of the call graph of a module.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
A pass that does profile-guided sinking of instructions into loops.
void registerFunctionAnalysis()
Register a specific AA result.
cl::opt< bool > EnableOrderFileInstrumentation
This class implements a trivial dead store elimination.
SimplifyCFGOptions & convertSwitchToLookupTable(bool B)
Class to hold module path string table and global value map, and encapsulate methods for operating on...
OuterAnalysisManagerProxy< ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph & > ModuleAnalysisManagerCGSCCProxy
A proxy from a ModuleAnalysisManager to an SCC.
LoopUnrollOptions & setPartial(bool Partial)
Enables or disables partial unrolling.
Pass to perform interprocedural constant propagation.
A pass which infers function attributes from the names and signatures of function declarations in a m...
cl::opt< bool > FlattenedProfileUsed
LoopVectorizeOptions & setInterleaveOnlyWhenForced(bool Value)
static cl::opt< unsigned > MaxDevirtIterations("pm-max-devirt-iterations", cl::ReallyHidden, cl::init(4))
cl::opt< bool > RunSLPVectorization
A switch()-like statement whose cases are string literals.
This is the interface for LLVM's unification-based alias analysis implemented with CFL graph reachabi...
initializer< Ty > init(const Ty &Val)
static bool isOptimizingForSize(PassBuilder::OptimizationLevel Level)
static bool checkParametrizedPassName(StringRef Name, StringRef PassName)
A set of analyses that are preserved following a run of a transformation pass.
This is the interface for a metadata-based TBAA.
ModuleToFunctionPassAdaptor< FunctionPassT > createModuleToFunctionPassAdaptor(FunctionPassT Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
void addPGOInstrPassesForO0(ModulePassManager &MPM, bool DebugLogging, bool RunProfileGen, bool IsCS, std::string ProfileFile, std::string ProfileRemappingFile)
Add PGOInstrumenation passes for O0 only.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Disable as many optimizations as possible.
FunctionPassManager buildFunctionSimplificationPipeline(OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging=false)
Construct the core LLVM function canonicalization and simplification pipeline.
A manager for alias analyses.
ModulePassManager buildLTOPreLinkDefaultPipeline(OptimizationLevel Level, bool DebugLogging=false)
Build a pre-link, LTO-targeting default optimization pipeline to a pass manager.
A CRTP mix-in that provides informational APIs needed for analysis passes.
static bool isFunctionPassName(StringRef Name, CallbacksT &Callbacks)
bool ForgetAllSCEVInLoopUnroll
Tuning option to forget all SCEV loops in LoopUnroll.
The inliner pass for the new pass manager.
cl::opt< unsigned > SetLicmMssaOptCap
void registerFunctionAnalyses(FunctionAnalysisManager &FAM)
Registers all available function analysis passes.
Analysis pass providing a never-invalidated alias analysis result.
This file provides the interface for LLVM's Global Value Numbering pass.
ThinLTOPhase
ThinLTO phase.
Optimize for fast execution as much as possible.
static cl::opt< bool > EnableCHR("enable-chr-npm", cl::init(true), cl::Hidden, cl::desc("Enable control height reduction optimization (CHR)"))
DevirtSCCRepeatedPass< PassT > createDevirtSCCRepeatedPass(PassT Pass, int MaxIterations)
A function to deduce a function pass type and wrap it in the templated adaptor.
A simple loop rotation transformation.
LoopUnrollOptions & setProfileBasedPeeling(int O)
static bool callbacksAcceptPassName(StringRef Name, CallbacksT &Callbacks)
Tests whether registered callbacks will accept a given pass name.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
std::string InstrProfileOutput
ModulePassManager buildThinLTODefaultPipeline(OptimizationLevel Level, bool DebugLogging, const ModuleSummaryIndex *ImportSummary)
Build an ThinLTO default optimization pipeline to a pass manager.
static cl::opt< bool > EnableUnrollAndJam("enable-npm-unroll-and-jam", cl::init(false), cl::Hidden, cl::desc("Enable the Unroll and Jam pass for the new PM (default = off)"))
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
This file provides the interface for LLVM's Loop Data Prefetching Pass.
Provides passes to inlining "always_inline" functions.
LoopUnrollOptions & setOptLevel(int O)
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
This header defines the LoopLoadEliminationPass object.
static ErrorSuccess success()
Create a success value.
bool LoopInterleaving
Tuning option to set loop interleaving on/off.
LoopVectorizeOptions & setVectorizeOnlyWhenForced(bool Value)
InlineParams getInlineParams()
Generate the parameters to tune the inline cost analysis based only on the commandline options...
static Optional< int > parseDevirtPassName(StringRef Name)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Optimize for fast execution as much as possible without triggering significant incremental compile ti...
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
This pass performs 'jump threading', which looks at blocks that have multiple predecessors and multip...
A pass to simplify and canonicalize the CFG of a function.
static const Regex DefaultAliasRegex("^(default|thinlto-pre-link|thinlto|lto-pre-link|lto)<(O[0123sz])>$")
SimplifyCFGOptions & needCanonicalLoops(bool B)
Error parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText, bool VerifyEachPass=true, bool DebugLogging=false)
Parse a textual pass pipeline description into a ModulePassManager.
static InlineParams getInlineParamsFromOptLevel(PassBuilder::OptimizationLevel Level)
PipelineTuningOptions()
Constructor sets pipeline tuning defaults based on cl::opts.
The instrumentation (profile-instr-gen) pass for IR based PGO.
This pass converts vector operations into scalar operations, in order to expose optimization opportun...
Class for arbitrary precision integers.
FunctionToLoopPassAdaptor< LoopPassT > createFunctionToLoopPassAdaptor(LoopPassT Pass, bool UseMemorySSA=false, bool DebugLogging=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
unsigned LicmMssaOptCap
Tuning option to cap the number of calls to retrive clobbering accesses in MemorySSA, in LICM.
A pass that merges duplicate global constants into a single constant.
Analysis pass providing a never-invalidated alias analysis result.
bool LoopUnrolling
Tuning option to enable/disable loop unrolling. Its default value is true.
Options for the frontend instrumentation based profiling pass.
This pass performs merges of loads and stores on both sides of a.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
Analysis pass providing a never-invalidated alias analysis result.
LoopUnrollOptions & setRuntime(bool Runtime)
Enables or disables unrolling of loops with runtime trip count.
cl::opt< unsigned > SetLicmMssaNoAccForPromotionCap
Manages a sequence of passes over a particular unit of IR.
cl::opt< bool > EnableMSSALoopDependency
Enables memory ssa as a dependency for loop passes.
Represents a single loop in the control flow graph.
unsigned LicmMssaNoAccForPromotionCap
Tuning option to disable promotion to scalars in LICM with MemorySSA, if the number of access is too ...
Pass which forces specific function attributes into the IR, primarily as a debugging tool...
LLVM_NODISCARD size_t find_first_of(char C, size_t From=0) const
Find the first character in the string that is C, or npos if not found.
The header file for the LowerExpectIntrinsic pass as used by the new pass manager.
Pass to outline cold regions.
Provides passes for computing function attributes based on interprocedural analyses.
This file defines the interface for the loop cache analysis.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
bool consume_back(StringRef Suffix)
Returns true if this StringRef has the given suffix and removes that suffix.
This header provides classes for managing passes over SCCs of the call graph.
This file defines passes to print out IR in various granularities.
void registerCGSCCAnalyses(CGSCCAnalysisManager &CGAM)
Registers all available CGSCC analysis passes.
cl::opt< bool > EnableLoopVectorization
ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level, bool DebugLogging, ModuleSummaryIndex *ExportSummary)
Build an LTO default optimization pipeline to a pass manager.
static bool startsWithDefaultPipelineAliasPrefix(StringRef Name)
Tests whether a pass name starts with a valid prefix for a default pipeline alias.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file provides the interface for LLVM's Call Graph Profile pass.
Optimize quickly without destroying debuggability.
The profile size based optimization pass for memory intrinsics.
See the comments on JumpThreadingPass.
An SCC of the call graph.
Performs Loop Inst Simplify Pass.
Lightweight error class with error context and mandatory checking.
static bool isCGSCCPassName(StringRef Name, CallbacksT &Callbacks)
An optimization pass providing Scalar Replacement of Aggregates.
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
StringRef - Represent a constant reference to a string, i.e.
This is the interface for LLVM's primary stateless and local alias analysis.
A container for analyses that lazily runs them and caches their results.
static cl::opt< bool > RunPartialInlining("enable-npm-partial-inlining", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Run Partial inlinining pass"))
A set of parameters used to control the transforms in the SimplifyCFG pass.
This pass performs function-level constant propagation and merging.
This header defines various interfaces for pass management in LLVM.
LoopUnrollOptions & setPeeling(bool Peeling)
Enables or disables loop peeling.
static cl::opt< bool > RunNewGVN("enable-npm-newgvn", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Run NewGVN instead of GVN"))
A special type used by analysis passes to provide an address that identifies that particular analysis...
The header file for the LowerConstantIntrinsics pass as used by the new pass manager.
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization.
This file provides the interface for the sampled PGO loader pass.
Optional< int > HotCallSiteThreshold
Threshold to use when the callsite is considered hot.
int DefaultThreshold
The default threshold to start with for a callee.
Optimize globals that never have their address taken.
bool empty() const
empty - Check if the array is empty.
Performs Loop Idiom Recognize Pass.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks)