158 using namespace llvm;
165 cl::desc(
"Run Partial inlinining pass"));
170 cl::desc(
"Run NewGVN instead of GVN"));
174 cl::desc(
"Enable the EarlyCSE w/ MemorySSA pass for the new PM (default = on)"));
178 cl::desc(
"Enable the GVN hoisting pass for the new PM (default = off)"));
182 cl::desc(
"Enable the GVN hoisting pass for the new PM (default = off)"));
186 cl::desc(
"Enable the Unroll and Jam pass for the new PM (default = off)"));
190 cl::desc(
"Run synthetic function entry count generation " 194 "^(default|thinlto-pre-link|thinlto|lto-pre-link|lto)<(O[0123sz])>$");
214 struct NoOpModulePass {
233 struct NoOpCGSCCPass {
255 struct NoOpFunctionPass {
274 struct NoOpLoopPass {
302 void PassBuilder::invokePeepholeEPCallbacks(
304 for (
auto &
C : PeepholeEPCallbacks)
309 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ 310 MAM.registerPass([&] { return CREATE_PASS; }); 311 #include "PassRegistry.def" 313 for (
auto &
C : ModuleAnalysisRegistrationCallbacks)
318 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ 319 CGAM.registerPass([&] { return CREATE_PASS; }); 320 #include "PassRegistry.def" 322 for (
auto &
C : CGSCCAnalysisRegistrationCallbacks)
327 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ 328 FAM.registerPass([&] { return CREATE_PASS; }); 329 #include "PassRegistry.def" 331 for (
auto &
C : FunctionAnalysisRegistrationCallbacks)
336 #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ 337 LAM.registerPass([&] { return CREATE_PASS; }); 338 #include "PassRegistry.def" 340 for (
auto &
C : LoopAnalysisRegistrationCallbacks)
348 assert(Level != O0 &&
"Must request optimizations!");
382 invokePeepholeEPCallbacks(FPM, Level);
386 if (PGOOpt && !PGOOpt->ProfileUseFile.empty() &&
422 for (
auto &
C : LateLoopOptimizationsEPCallbacks)
429 if (Phase != ThinLTOPhase::PreLink ||
430 !PGOOpt || PGOOpt->SampleProfileFile.empty())
433 for (
auto &
C : LoopOptimizerEndEPCallbacks)
470 invokePeepholeEPCallbacks(FPM, Level);
479 for (
auto &
C : ScalarOptimizerLateEPCallbacks)
487 invokePeepholeEPCallbacks(FPM, Level);
495 std::string ProfileGenFile,
496 std::string ProfileUseFile) {
521 invokePeepholeEPCallbacks(FPM, Level);
543 if (!ProfileGenFile.empty())
549 if (!ProfileUseFile.empty())
556 unsigned OptLevel = Level > O3 ? 2 :
Level;
557 unsigned SizeLevel = Level > O3 ? Level - O3 : 0;
587 if (PGOOpt && !PGOOpt->SampleProfileFile.empty() &&
588 Phase == ThinLTOPhase::PostLink)
592 if (PGOOpt && !PGOOpt->SampleProfileFile.empty()) {
596 Phase == ThinLTOPhase::PreLink));
599 if (Phase != ThinLTOPhase::PreLink)
636 invokePeepholeEPCallbacks(GlobalCleanupPM, Level);
642 if (PGOOpt && Phase != ThinLTOPhase::PostLink &&
643 (!PGOOpt->ProfileGenFile.empty() || !PGOOpt->ProfileUseFile.empty())) {
644 addPGOInstrPasses(MPM, DebugLogging, Level, PGOOpt->RunProfileGen,
645 PGOOpt->ProfileGenFile, PGOOpt->ProfileUseFile);
678 if (Phase == ThinLTOPhase::PreLink &&
679 PGOOpt && !PGOOpt->SampleProfileFile.empty())
694 buildFunctionSimplificationPipeline(Level, Phase, DebugLogging)));
696 for (
auto &
C : CGSCCOptimizerLateEPCallbacks)
697 C(MainCGPipeline, Level);
758 for (
auto &
C : VectorizerStartEPCallbacks)
759 C(OptimizePM, Level);
791 forwardSwitchCondToPhi(
true).
792 convertSwitchToLookupTable(
true).
793 needCanonicalLoops(
false).
794 sinkCommonInsts(
true)));
862 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
870 for (
auto &
C : PipelineStartEPCallbacks)
873 if (PGOOpt && PGOOpt->SamplePGOSupport)
881 MPM.
addPass(buildModuleOptimizationPipeline(Level, DebugLogging));
889 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
896 if (PGOOpt && PGOOpt->SamplePGOSupport)
900 for (
auto &
C : PipelineStartEPCallbacks)
906 MPM.
addPass(buildModuleSimplificationPipeline(Level, ThinLTOPhase::PreLink,
955 if (!PGOOpt || PGOOpt->SampleProfileFile.empty())
960 MPM.
addPass(buildModuleSimplificationPipeline(Level, ThinLTOPhase::PostLink,
964 MPM.
addPass(buildModuleOptimizationPipeline(Level, DebugLogging));
972 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
974 return buildPerModuleDefaultPipeline(Level, DebugLogging);
980 assert(Level != O0 &&
"Must request optimizations for the default pipeline!");
1004 true , PGOOpt && !PGOOpt->SampleProfileFile.empty()));
1060 invokePeepholeEPCallbacks(PeepholeFPM, Level);
1082 invokePeepholeEPCallbacks(FPM, Level);
1134 invokePeepholeEPCallbacks(MainFPM, Level);
1220 template <
typename PassManagerT,
typename CallbacksT>
1222 if (!Callbacks.empty()) {
1223 PassManagerT DummyPM;
1224 for (
auto &CB : Callbacks)
1225 if (CB(Name, DummyPM, {}))
1231 template <
typename CallbacksT>
1238 if (Name ==
"module")
1240 if (Name ==
"cgscc")
1242 if (Name ==
"function")
1249 #define MODULE_PASS(NAME, CREATE_PASS) \ 1252 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ 1253 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1255 #include "PassRegistry.def" 1257 return callbacksAcceptPassName<ModulePassManager>(
Name, Callbacks);
1260 template <
typename CallbacksT>
1263 if (Name ==
"cgscc")
1265 if (Name ==
"function")
1274 #define CGSCC_PASS(NAME, CREATE_PASS) \ 1277 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ 1278 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1280 #include "PassRegistry.def" 1282 return callbacksAcceptPassName<CGSCCPassManager>(
Name, Callbacks);
1285 template <
typename CallbacksT>
1288 if (Name ==
"function")
1297 #define FUNCTION_PASS(NAME, CREATE_PASS) \ 1300 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ 1301 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1303 #include "PassRegistry.def" 1305 return callbacksAcceptPassName<FunctionPassManager>(
Name, Callbacks);
1308 template <
typename CallbacksT>
1318 #define LOOP_PASS(NAME, CREATE_PASS) \ 1321 #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ 1322 if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ 1324 #include "PassRegistry.def" 1326 return callbacksAcceptPassName<LoopPassManager>(
Name, Callbacks);
1330 PassBuilder::parsePipelineText(
StringRef Text) {
1331 std::vector<PipelineElement> ResultPipeline;
1336 std::vector<PipelineElement> &Pipeline = *PipelineStack.
back();
1338 Pipeline.push_back({Text.
substr(0, Pos), {}});
1341 if (Pos == Text.
npos)
1344 char Sep = Text[Pos];
1345 Text = Text.
substr(Pos + 1);
1352 PipelineStack.
push_back(&Pipeline.back().InnerPipeline);
1356 assert(Sep ==
')' &&
"Bogus separator!");
1361 if (PipelineStack.
size() == 1)
1377 if (PipelineStack.
size() > 1)
1381 assert(PipelineStack.
back() == &ResultPipeline &&
1382 "Wrong pipeline at the bottom of the stack!");
1383 return {std::move(ResultPipeline)};
1387 const PipelineElement &
E,
bool VerifyEachPass,
1388 bool DebugLogging) {
1389 auto &
Name = E.Name;
1390 auto &InnerPipeline = E.InnerPipeline;
1393 if (!InnerPipeline.empty()) {
1394 if (
Name ==
"module") {
1396 if (!parseModulePassPipeline(NestedMPM, InnerPipeline, VerifyEachPass,
1399 MPM.
addPass(std::move(NestedMPM));
1402 if (
Name ==
"cgscc") {
1404 if (!parseCGSCCPassPipeline(CGPM, InnerPipeline, VerifyEachPass,
1410 if (
Name ==
"function") {
1412 if (!parseFunctionPassPipeline(FPM, InnerPipeline, VerifyEachPass,
1420 if (!parseModulePassPipeline(NestedMPM, InnerPipeline, VerifyEachPass,
1427 for (
auto &
C : ModulePipelineParsingCallbacks)
1428 if (
C(
Name, MPM, InnerPipeline))
1440 assert(Matches.
size() == 3 &&
"Must capture two matched strings!");
1453 if (Matches[1] ==
"default") {
1454 MPM.
addPass(buildPerModuleDefaultPipeline(L, DebugLogging));
1455 }
else if (Matches[1] ==
"thinlto-pre-link") {
1456 MPM.
addPass(buildThinLTOPreLinkDefaultPipeline(L, DebugLogging));
1457 }
else if (Matches[1] ==
"thinlto") {
1458 MPM.
addPass(buildThinLTODefaultPipeline(L, DebugLogging,
nullptr));
1459 }
else if (Matches[1] ==
"lto-pre-link") {
1460 MPM.
addPass(buildLTOPreLinkDefaultPipeline(L, DebugLogging));
1462 assert(Matches[1] ==
"lto" &&
"Not one of the matched options!");
1463 MPM.
addPass(buildLTODefaultPipeline(L, DebugLogging,
nullptr));
1469 #define MODULE_PASS(NAME, CREATE_PASS) \ 1470 if (Name == NAME) { \ 1471 MPM.addPass(CREATE_PASS); \ 1474 #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ 1475 if (Name == "require<" NAME ">") { \ 1477 RequireAnalysisPass< \ 1478 std::remove_reference<decltype(CREATE_PASS)>::type, Module>()); \ 1481 if (Name == "invalidate<" NAME ">") { \ 1482 MPM.addPass(InvalidateAnalysisPass< \ 1483 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 1486 #include "PassRegistry.def" 1488 for (
auto &
C : ModulePipelineParsingCallbacks)
1489 if (
C(
Name, MPM, InnerPipeline))
1495 const PipelineElement &E,
bool VerifyEachPass,
1496 bool DebugLogging) {
1497 auto &
Name = E.Name;
1498 auto &InnerPipeline = E.InnerPipeline;
1501 if (!InnerPipeline.empty()) {
1502 if (
Name ==
"cgscc") {
1504 if (!parseCGSCCPassPipeline(NestedCGPM, InnerPipeline, VerifyEachPass,
1508 CGPM.
addPass(std::move(NestedCGPM));
1511 if (
Name ==
"function") {
1513 if (!parseFunctionPassPipeline(FPM, InnerPipeline, VerifyEachPass,
1522 if (!parseCGSCCPassPipeline(NestedCGPM, InnerPipeline, VerifyEachPass,
1530 if (!parseCGSCCPassPipeline(NestedCGPM, InnerPipeline, VerifyEachPass,
1538 for (
auto &
C : CGSCCPipelineParsingCallbacks)
1539 if (
C(
Name, CGPM, InnerPipeline))
1547 #define CGSCC_PASS(NAME, CREATE_PASS) \ 1548 if (Name == NAME) { \ 1549 CGPM.addPass(CREATE_PASS); \ 1552 #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ 1553 if (Name == "require<" NAME ">") { \ 1554 CGPM.addPass(RequireAnalysisPass< \ 1555 std::remove_reference<decltype(CREATE_PASS)>::type, \ 1556 LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \ 1557 CGSCCUpdateResult &>()); \ 1560 if (Name == "invalidate<" NAME ">") { \ 1561 CGPM.addPass(InvalidateAnalysisPass< \ 1562 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 1565 #include "PassRegistry.def" 1567 for (
auto &
C : CGSCCPipelineParsingCallbacks)
1568 if (
C(
Name, CGPM, InnerPipeline))
1574 const PipelineElement &E,
1575 bool VerifyEachPass,
bool DebugLogging) {
1576 auto &
Name = E.Name;
1577 auto &InnerPipeline = E.InnerPipeline;
1580 if (!InnerPipeline.empty()) {
1581 if (
Name ==
"function") {
1583 if (!parseFunctionPassPipeline(NestedFPM, InnerPipeline, VerifyEachPass,
1587 FPM.
addPass(std::move(NestedFPM));
1590 if (
Name ==
"loop") {
1592 if (!parseLoopPassPipeline(LPM, InnerPipeline, VerifyEachPass,
1602 if (!parseFunctionPassPipeline(NestedFPM, InnerPipeline, VerifyEachPass,
1609 for (
auto &
C : FunctionPipelineParsingCallbacks)
1610 if (
C(
Name, FPM, InnerPipeline))
1618 #define FUNCTION_PASS(NAME, CREATE_PASS) \ 1619 if (Name == NAME) { \ 1620 FPM.addPass(CREATE_PASS); \ 1623 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ 1624 if (Name == "require<" NAME ">") { \ 1626 RequireAnalysisPass< \ 1627 std::remove_reference<decltype(CREATE_PASS)>::type, Function>()); \ 1630 if (Name == "invalidate<" NAME ">") { \ 1631 FPM.addPass(InvalidateAnalysisPass< \ 1632 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 1635 #include "PassRegistry.def" 1637 for (
auto &
C : FunctionPipelineParsingCallbacks)
1638 if (
C(
Name, FPM, InnerPipeline))
1643 bool PassBuilder::parseLoopPass(
LoopPassManager &LPM,
const PipelineElement &E,
1644 bool VerifyEachPass,
bool DebugLogging) {
1646 auto &InnerPipeline = E.InnerPipeline;
1649 if (!InnerPipeline.empty()) {
1650 if (Name ==
"loop") {
1652 if (!parseLoopPassPipeline(NestedLPM, InnerPipeline, VerifyEachPass,
1656 LPM.
addPass(std::move(NestedLPM));
1661 if (!parseLoopPassPipeline(NestedLPM, InnerPipeline, VerifyEachPass,
1668 for (
auto &
C : LoopPipelineParsingCallbacks)
1669 if (
C(Name, LPM, InnerPipeline))
1677 #define LOOP_PASS(NAME, CREATE_PASS) \ 1678 if (Name == NAME) { \ 1679 LPM.addPass(CREATE_PASS); \ 1682 #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ 1683 if (Name == "require<" NAME ">") { \ 1684 LPM.addPass(RequireAnalysisPass< \ 1685 std::remove_reference<decltype(CREATE_PASS)>::type, Loop, \ 1686 LoopAnalysisManager, LoopStandardAnalysisResults &, \ 1690 if (Name == "invalidate<" NAME ">") { \ 1691 LPM.addPass(InvalidateAnalysisPass< \ 1692 std::remove_reference<decltype(CREATE_PASS)>::type>()); \ 1695 #include "PassRegistry.def" 1697 for (
auto &
C : LoopPipelineParsingCallbacks)
1698 if (
C(Name, LPM, InnerPipeline))
1704 #define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ 1705 if (Name == NAME) { \ 1706 AA.registerModuleAnalysis< \ 1707 std::remove_reference<decltype(CREATE_PASS)>::type>(); \ 1710 #define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ 1711 if (Name == NAME) { \ 1712 AA.registerFunctionAnalysis< \ 1713 std::remove_reference<decltype(CREATE_PASS)>::type>(); \ 1716 #include "PassRegistry.def" 1718 for (
auto &
C : AAParsingCallbacks)
1726 bool VerifyEachPass,
1727 bool DebugLogging) {
1728 for (
const auto &Element : Pipeline) {
1729 if (!parseLoopPass(LPM, Element, VerifyEachPass, DebugLogging))
1738 bool VerifyEachPass,
1739 bool DebugLogging) {
1740 for (
const auto &Element : Pipeline) {
1741 if (!parseFunctionPass(FPM, Element, VerifyEachPass, DebugLogging))
1751 bool VerifyEachPass,
1752 bool DebugLogging) {
1753 for (
const auto &Element : Pipeline) {
1754 if (!parseCGSCCPass(CGPM, Element, VerifyEachPass, DebugLogging))
1776 bool VerifyEachPass,
1777 bool DebugLogging) {
1778 for (
const auto &Element : Pipeline) {
1779 if (!parseModulePass(MPM, Element, VerifyEachPass, DebugLogging))
1791 StringRef PipelineText,
bool VerifyEachPass,
1792 bool DebugLogging) {
1793 auto Pipeline = parsePipelineText(PipelineText);
1794 if (!Pipeline || Pipeline->
empty())
1803 Pipeline = {{
"cgscc", std::move(*Pipeline)}};
1805 FunctionPipelineParsingCallbacks)) {
1806 Pipeline = {{
"function", std::move(*Pipeline)}};
1807 }
else if (
isLoopPassName(FirstName, LoopPipelineParsingCallbacks)) {
1808 Pipeline = {{
"function", {{
"loop", std::move(*Pipeline)}}}};
1810 for (
auto &
C : TopLevelPipelineParsingCallbacks)
1811 if (
C(MPM, *Pipeline, VerifyEachPass, DebugLogging))
1819 return parseModulePassPipeline(MPM, *Pipeline, VerifyEachPass, DebugLogging);
1824 StringRef PipelineText,
bool VerifyEachPass,
1825 bool DebugLogging) {
1826 auto Pipeline = parsePipelineText(PipelineText);
1827 if (!Pipeline || Pipeline->
empty())
1834 return parseCGSCCPassPipeline(CGPM, *Pipeline, VerifyEachPass, DebugLogging);
1840 StringRef PipelineText,
bool VerifyEachPass,
1841 bool DebugLogging) {
1842 auto Pipeline = parsePipelineText(PipelineText);
1843 if (!Pipeline || Pipeline->
empty())
1850 return parseFunctionPassPipeline(FPM, *Pipeline, VerifyEachPass,
1856 StringRef PipelineText,
bool VerifyEachPass,
1857 bool DebugLogging) {
1858 auto Pipeline = parsePipelineText(PipelineText);
1859 if (!Pipeline || Pipeline->
empty())
1862 return parseLoopPassPipeline(CGPM, *Pipeline, VerifyEachPass, DebugLogging);
1868 if (PipelineText ==
"default") {
1869 AA = buildDefaultAAPipeline();
1873 while (!PipelineText.
empty()) {
1875 std::tie(Name, PipelineText) = PipelineText.
split(
',');
1876 if (!parseAAPassName(AA, Name))
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.
Computes function attributes in post-order over the call graph.
A simple loop rotation transformation.
A simple and fast domtree-based CSE pass.
void push_back(const T &Elt)
The profile annotation (profile-instr-use) pass for IR based PGO.
Thresholds to tune inline cost analysis.
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.
This is the interface for LLVM's inclusion-based alias analysis implemented with CFL graph reachabili...
Compute iterated dominance frontiers using a linear time algorithm.
static Optional< int > parseRepeatPassName(StringRef Name)
This header provides classes for managing a pipeline of passes over loops in LLVM IR...
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. ...
This is the interface to build a ModuleSummaryIndex for a module.
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.
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)
void registerModuleAnalyses(ModuleAnalysisManager &MAM)
Registers all available module analysis passes.
This is the interface for a metadata-based scoped no-alias analysis.
void registerModuleAnalysis()
Register a specific AA result.
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.
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.
static cl::opt< bool > EnableEarlyCSEMemSSA("enable-npm-earlycse-memssa", cl::init(true), cl::Hidden, cl::desc("Enable the EarlyCSE w/ MemorySSA pass for the new PM (default = on)"))
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...
Run instruction simplification across each instruction in the function.
Pass to forward loads in a loop around the backedge to subsequent iterations.
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.
bool parseAAPipeline(AAManager &AA, StringRef PipelineText)
Parse a textual alias analysis pipeline into the provided AA manager.
LLVM_ATTRIBUTE_ALWAYS_INLINE bool consume_back(StringRef Suffix)
Returns true if this StringRef has the given suffix and removes that suffix.
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.
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...
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
void registerLoopAnalyses(LoopAnalysisManager &LAM)
Registers all available loop analysis passes.
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
FunctionToLoopPassAdaptor< LoopPassT > createFunctionToLoopPassAdaptor(LoopPassT Pass, bool DebugLogging=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
This file provides the interface for IR based instrumentation passes ( (profile-gen, and profile-use).
LLVM_ATTRIBUTE_ALWAYS_INLINE bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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.
This class implements a trivial dead store elimination.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
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.
Pass to perform interprocedural constant propagation.
A pass which infers function attributes from the names and signatures of function declarations in a m...
static cl::opt< unsigned > MaxDevirtIterations("pm-max-devirt-iterations", cl::ReallyHidden, cl::init(4))
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)
A set of analyses that are preserved following a run of a transformation pass.
This is the interface for a metadata-based TBAA.
static Regex DefaultAliasRegex("^(default|thinlto-pre-link|thinlto|lto-pre-link|lto)<(O[0123sz])>$")
ModuleToFunctionPassAdaptor< FunctionPassT > createModuleToFunctionPassAdaptor(FunctionPassT Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
This file provides the primary interface to the aggressive instcombine pass.
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)
The inliner pass for the new pass manager.
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.
ModulePassManager buildModuleOptimizationPipeline(OptimizationLevel Level, bool DebugLogging=false)
Construct the core LLVM module optimization pipeline.
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.
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.
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
This header defines the LoopLoadEliminationPass object.
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...
bool parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText, bool VerifyEachPass=true, bool DebugLogging=false)
Parse a textual pass pipeline description into a ModulePassManager.
A pass to simplify and canonicalize the CFG of a function.
static InlineParams getInlineParamsFromOptLevel(PassBuilder::OptimizationLevel Level)
The instrumentation (profile-instr-gen) pass for IR based PGO.
A pass that merges duplicate global constants into a single constant.
Analysis pass providing a never-invalidated alias analysis result.
Options for the frontend instrumentation based profiling pass.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
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.
Represents a single loop in the control flow graph.
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.
Provides passes for computing function attributes based on interprocedural analyses.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
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.
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.
static bool isCGSCCPassName(StringRef Name, CallbacksT &Callbacks)
bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr)
matches - Match the regex against a given String.
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.
ModulePassManager buildPerModuleDefaultPipeline(OptimizationLevel Level, bool DebugLogging=false)
Build a per-module default optimization pipeline.
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.
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...
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.
static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks)