16 #ifndef LLVM_PASSES_PASSBUILDER_H 17 #define LLVM_PASSES_PASSBUILDER_H 31 class ModuleSummaryIndex;
183 : TM(TM), PGOOpt(PGOOpt), PIC(PIC) {}
242 bool DebugLogging =
false);
262 bool DebugLogging =
false);
278 bool DebugLogging =
false);
292 bool DebugLogging =
false);
308 bool DebugLogging =
false);
338 bool DebugLogging =
false);
389 bool VerifyEachPass =
true,
390 bool DebugLogging =
false);
400 bool VerifyEachPass =
true,
401 bool DebugLogging =
false);
403 bool VerifyEachPass =
true,
404 bool DebugLogging =
false);
406 bool VerifyEachPass =
true,
407 bool DebugLogging =
false);
435 PeepholeEPCallbacks.push_back(
C);
449 LateLoopOptimizationsEPCallbacks.push_back(
C);
459 LoopOptimizerEndEPCallbacks.push_back(
C);
469 ScalarOptimizerLateEPCallbacks.push_back(
C);
480 CGSCCOptimizerLateEPCallbacks.push_back(
C);
491 VectorizerStartEPCallbacks.push_back(
C);
501 PipelineStartEPCallbacks.push_back(
C);
513 OptimizerLastEPCallbacks.push_back(
C);
520 AAParsingCallbacks.push_back(
C);
528 CGSCCAnalysisRegistrationCallbacks.push_back(
C);
532 FunctionAnalysisRegistrationCallbacks.push_back(
C);
536 LoopAnalysisRegistrationCallbacks.push_back(
C);
540 ModuleAnalysisRegistrationCallbacks.push_back(
C);
551 CGSCCPipelineParsingCallbacks.push_back(
C);
556 FunctionPipelineParsingCallbacks.push_back(
C);
561 LoopPipelineParsingCallbacks.push_back(
C);
566 ModulePipelineParsingCallbacks.push_back(
C);
577 bool VerifyEachPass,
bool DebugLogging)> &
C) {
578 TopLevelPipelineParsingCallbacks.push_back(
C);
586 bool VerifyEachPass,
bool DebugLogging);
588 bool VerifyEachPass,
bool DebugLogging);
590 bool VerifyEachPass,
bool DebugLogging);
592 bool VerifyEachPass,
bool DebugLogging);
597 bool VerifyEachPass,
bool DebugLogging);
600 bool VerifyEachPass,
bool DebugLogging);
603 bool VerifyEachPass,
bool DebugLogging);
606 bool VerifyEachPass,
bool DebugLogging);
620 LateLoopOptimizationsEPCallbacks;
622 LoopOptimizerEndEPCallbacks;
624 ScalarOptimizerLateEPCallbacks;
626 CGSCCOptimizerLateEPCallbacks;
628 VectorizerStartEPCallbacks;
630 OptimizerLastEPCallbacks;
633 PipelineStartEPCallbacks;
635 ModuleAnalysisRegistrationCallbacks;
639 ModulePipelineParsingCallbacks;
641 bool VerifyEachPass,
bool DebugLogging)>,
643 TopLevelPipelineParsingCallbacks;
646 CGSCCAnalysisRegistrationCallbacks;
650 CGSCCPipelineParsingCallbacks;
653 FunctionAnalysisRegistrationCallbacks;
657 FunctionPipelineParsingCallbacks;
660 LoopAnalysisRegistrationCallbacks;
664 LoopPipelineParsingCallbacks;
684 template <
typename AnalysisT,
typename IRUnitT,
typename AnalysisManagerT,
685 typename... ExtraArgTs>
693 PipelineName = PipelineName.
substr(11, PipelineName.
size() - 12);
694 if (PipelineName != AnalysisName)
702 PipelineName = PipelineName.
substr(8, PipelineName.
size() - 9);
703 if (PipelineName != AnalysisName)
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &C)
{{@ Register pipeline parsing callbacks with this pass builder instance.
This class represents lattice values for constants.
This header provides classes for managing a pipeline of passes over loops in LLVM IR...
std::string ProfileUseFile
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
OptimizationLevel
LLVM-provided high-level optimization levels.
A utility pass template to force an analysis result to be available.
std::string SampleProfileFile
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...
This class provides access to building LLVM's passes.
std::string ProfileGenFile
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, ModulePassManager &, ArrayRef< PipelineElement >)> &C)
void registerLoopOptimizerEndEPCallback(const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void registerAnalysisRegistrationCallback(const std::function< void(ModuleAnalysisManager &)> &C)
falkor hwpf fix Falkor HW Prefetch Fix Late Phase
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
std::string ProfileRemappingFile
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...
void registerLateLoopOptimizationsEPCallback(const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, FunctionPassManager &, ArrayRef< PipelineElement >)> &C)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void registerPipelineStartEPCallback(const std::function< void(ModulePassManager &)> &C)
Register a callback for a default optimizer pipeline extension point.
Disable as many optimizations as possible.
A manager for alias analyses.
void registerVectorizerStartEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
ThinLTOPhase
ThinLTO phase.
Optimize for fast execution as much as possible.
void registerParseAACallback(const std::function< bool(StringRef Name, AAManager &AA)> &C)
Register a callback for parsing an AliasAnalysis Name to populate the given AAManager AA...
void registerAnalysisRegistrationCallback(const std::function< void(FunctionAnalysisManager &)> &C)
PassBuilder(TargetMachine *TM=nullptr, Optional< PGOOptions > PGOOpt=None, PassInstrumentationCallbacks *PIC=nullptr)
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
void registerOptimizerLastEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
bool parseAnalysisUtilityPasses(StringRef AnalysisName, StringRef PipelineName, PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs... > &PM)
This utility template takes care of adding require<> and invalidate<> passes for an analysis to a giv...
A struct to capture parsed pass pipeline names.
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...
std::vector< PipelineElement > InnerPipeline
void registerPeepholeEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Manages a sequence of passes over a particular unit of IR.
A struct capturing PGO tunables.
A no-op pass template which simply forces a specific analysis result to be invalidated.
This header provides classes for managing passes over SCCs of the call graph.
void registerParseTopLevelPipelineCallback(const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >, bool VerifyEachPass, bool DebugLogging)> &C)
Register a callback for a top-level pipeline entry.
void registerAnalysisRegistrationCallback(const std::function< void(CGSCCAnalysisManager &)> &C)
{{@ Register callbacks for analysis registration with this PassBuilder instance.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Optimize quickly without destroying debuggability.
PGOOptions(std::string ProfileGenFile="", std::string ProfileUseFile="", std::string SampleProfileFile="", std::string ProfileRemappingFile="", bool RunProfileGen=false, bool SamplePGOSupport=false)
Lightweight error class with error context and mandatory checking.
void registerCGSCCOptimizerLateEPCallback(const std::function< void(CGSCCPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Primary interface to the complete machine description for the target machine.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
print Print MemDeps of function
StringRef - Represent a constant reference to a string, i.e.
A container for analyses that lazily runs them and caches their results.
void registerAnalysisRegistrationCallback(const std::function< void(LoopAnalysisManager &)> &C)
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, LoopPassManager &, ArrayRef< PipelineElement >)> &C)
This header defines various interfaces for pass management in LLVM.
void registerScalarOptimizerLateEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.