14#ifndef LLVM_LTO_CONFIG_H
15#define LLVM_LTO_CONFIG_H
18#include "llvm/Config/llvm-config.h"
34class ModuleSummaryIndex;
35class raw_pwrite_stream;
276 bool UseInputModulePath =
false,
283 :
Fn(DiagHandlerFn) {}
300 std::make_unique<LTOLLVMDiagnosticHandler>(&
DiagHandler),
true);
This file defines the DenseSet and SmallDenseSet classes.
Machine Check Debug Module
Implements a dense probed hash-table based set.
This is the base abstract class for diagnostic reporting in the backend.
Lightweight error class with error context and mandatory checking.
This is an important class for using LLVM in a threaded context.
void enableDebugTypeODRUniquing()
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
Tunable parameters for passes in the default pipelines.
PassManager manages ModulePassManagers.
Interfaces for registering analysis passes, producing common pass manager configurations,...
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
CodeGenOptLevel
Code generation optimization level.
std::function< void(const DiagnosticInfo &)> DiagnosticHandlerFunction
This is the base class for diagnostic handling in LLVM.
DiagnosticHandlerFunction DiagHandler
bool HasWholeProgramVisibility
Asserts whether we can assume whole program visibility during the LTO link.
bool ValidateAllVtablesHaveTypeInfos
We're validating that all native vtables have corresponding type infos.
std::function< bool(unsigned Task, const Module &)> ModuleHookFn
The following callbacks deal with tasks, which normally represent the entire optimization and code ge...
bool DebugPassManager
Whether to emit the pass manager debuggging informations.
bool AddFSDiscriminator
Add FSAFDO discriminators.
std::optional< uint64_t > RemarksHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
Error addSaveTemps(std::string OutputFileName, bool UseInputModulePath=false, const DenseSet< StringRef > &SaveTempsArgs={})
This is a convenience function that configures this Config object to write temporary files named afte...
std::string StatsFile
Statistics output file path.
ModuleHookFn PreOptModuleHook
This module hook is called after linking (regular LTO) or loading (ThinLTO) the module,...
CombinedIndexHookFn CombinedIndexHook
std::optional< CodeModel::Model > CodeModel
std::function< void(legacy::PassManager &)> PreCodeGenPassesHook
For adding passes that run right before codegen.
bool CodeGenOnly
Disable entirely the optimizer, including importing for ThinLTO.
std::function< bool(const ModuleSummaryIndex &Index, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols)> CombinedIndexHookFn
A combined index hook is called after all per-module indexes have been combined (ThinLTO-specific).
std::vector< std::string > MAttrs
std::vector< std::string > MllvmArgs
std::vector< std::string > ThinLTOModulesToCompile
Specific thinLTO modules to compile.
CodeGenOptLevel CGOptLevel
PipelineTuningOptions PTO
Tunable parameters for passes in the default pipelines.
std::unique_ptr< raw_ostream > ResolutionFile
If this field is set, LTO will write input file paths and symbol resolutions here in llvm-lto2 comman...
std::string DefaultTriple
Setting this field will replace unspecified target triples in input files with this triple.
bool AlwaysEmitRegularLTOObj
Always emit a Regular LTO object even when it is empty because no Regular LTO modules were linked.
std::string DwoDir
The directory to store .dwo files.
std::string RemarksFilename
Optimization remarks file path.
VisScheme VisibilityScheme
Allows non-imported definitions to get the potentially more constraining visibility from the prevaili...
ModuleHookFn PostPromoteModuleHook
This hook is called after promoting any internal functions (ThinLTO-specific).
std::string OverrideTriple
Setting this field will replace target triples in input files with this triple.
std::string ProfileRemapping
Name remapping file for profile data.
bool AllVtablesHaveTypeInfos
If all native vtables have corresponding type infos, allow usage of RTTI to block devirtualization on...
std::string SplitDwarfFile
The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU...
std::string SplitDwarfOutput
The path to write a .dwo file to.
bool TimeTraceEnabled
Time trace enabled.
ModuleHookFn PostOptModuleHook
This module hook is called after optimization is complete.
std::string RemarksPasses
Optimization remarks pass filter.
std::string OptPipeline
If this field is set, the set of passes run in the middle-end optimizer will be the one specified by ...
bool RunCSIRInstr
Run PGO context sensitive IR instrumentation.
ModuleHookFn PostInternalizeModuleHook
This hook is called after internalizing the module.
unsigned TimeTraceGranularity
Time trace granularity.
ModuleHookFn PostImportModuleHook
This hook is called after importing from other modules (ThinLTO-specific).
bool RemarksWithHotness
Whether to emit optimization remarks with hotness informations.
std::vector< std::string > PassPlugins
std::string CSIRProfile
Context Sensitive PGO profile path.
ModuleHookFn PreCodeGenModuleHook
This module hook is called before code generation.
std::optional< Reloc::Model > RelocModel
bool ShouldDiscardValueNames
bool PGOWarnMismatch
Turn on/off the warning about a hash mismatch in the PGO profile data.
CodeGenFileType CGFileType
bool Freestanding
Flag to indicate that the optimizer should not assume builtins are present on the target.
std::string SampleProfile
Sample PGO profile path.
std::string RemarksFormat
The format used for serializing remarks (default: YAML).
A derived class of LLVMContext that initializes itself according to a given Config object.
DiagnosticHandlerFunction DiagHandler
LTOLLVMContext(const Config &C)
LTOLLVMDiagnosticHandler(DiagnosticHandlerFunction *DiagHandlerFn)
DiagnosticHandlerFunction * Fn
bool handleDiagnostics(const DiagnosticInfo &DI) override
Override handleDiagnostics to provide custom implementation.