struct Config

Declaration

struct Config { /* full declaration omitted */ };

Description

LTO configuration. A linker can configure LTO by setting fields in this data structure and passing it to the lto::LTO constructor.

Declared at: llvm/include/llvm/LTO/Config.h:38

Member Variables

public std::string CPU
public llvm::TargetOptions Options
public std::vector<std::string> MAttrs
public Optional<Reloc::Model> RelocModel = Reloc::PIC_
public Optional<CodeModel::Model> CodeModel = None
public CodeGenOpt::Level CGOptLevel = CodeGenOpt::Default
public llvm::CodeGenFileType CGFileType = CGFT_ObjectFile
public unsigned int OptLevel = 2
public bool DisableVerify = false
public bool UseNewPM = false
Use the new pass manager
public bool Freestanding = false
Flag to indicate that the optimizer should not assume builtins are present on the target.
public bool CodeGenOnly = false
Disable entirely the optimizer, including importing for ThinLTO
public bool RunCSIRInstr = false
Run PGO context sensitive IR instrumentation.
public std::string OptPipeline
If this field is set, the set of passes run in the middle-end optimizer will be the one specified by the string. Only works with the new pass manager as the old one doesn't have this ability.
public std::string AAPipeline
public std::string OverrideTriple
Setting this field will replace target triples in input files with this triple.
public std::string DefaultTriple
Setting this field will replace unspecified target triples in input files with this triple.
public std::string CSIRProfile
Context Sensitive PGO profile path.
public std::string SampleProfile
Sample PGO profile path.
public std::string ProfileRemapping
Name remapping file for profile data.
public std::string DwoDir
The directory to store .dwo files.
public std::string SplitDwarfFile
The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU. This should generally only be used when running an individual backend directly via thinBackend(), as otherwise all objects would use the same .dwo file. Not used as output path.
public std::string SplitDwarfOutput
The path to write a .dwo file to. This should generally only be used when running an individual backend directly via thinBackend(), as otherwise all .dwo files will be written to the same path. Not used in skeleton CU.
public std::string RemarksFilename = ""
Optimization remarks file path.
public std::string RemarksPasses = ""
Optimization remarks pass filter.
public bool RemarksWithHotness = false
Whether to emit optimization remarks with hotness informations.
public std::string RemarksFormat = ""
The format used for serializing remarks (default: YAML).
public bool DebugPassManager = false
Whether to emit the pass manager debuggging informations.
public std::string StatsFile
Statistics output file path.
public bool ShouldDiscardValueNames = true
public llvm::DiagnosticHandlerFunction DiagHandler
public std::unique_ptr<raw_ostream> ResolutionFile
If this field is set, LTO will write input file paths and symbol resolutions here in llvm-lto2 command line flag format. This can be used for testing and for running the LTO pipeline outside of the linker with llvm-lto2.
public llvm::PipelineTuningOptions PTO
Tunable parameters for passes in the default pipelines.
public llvm::lto::Config::ModuleHookFn PreOptModuleHook
This module hook is called after linking (regular LTO) or loading (ThinLTO) the module, before modifying it.
public llvm::lto::Config::ModuleHookFn PostPromoteModuleHook
This hook is called after promoting any internal functions (ThinLTO-specific).
public llvm::lto::Config::ModuleHookFn PostInternalizeModuleHook
This hook is called after internalizing the module.
public llvm::lto::Config::ModuleHookFn PostImportModuleHook
This hook is called after importing from other modules (ThinLTO-specific).
public llvm::lto::Config::ModuleHookFn PostOptModuleHook
This module hook is called after optimization is complete.
public llvm::lto::Config::ModuleHookFn PreCodeGenModuleHook
This module hook is called before code generation. It is similar to the PostOptModuleHook, but for parallel code generation it is called after splitting the module.
public llvm::lto::Config::CombinedIndexHookFn CombinedIndexHook

Method Overview

  • public llvm::Error addSaveTemps(std::string OutputFileName, bool UseInputModulePath = false)

Methods

ΒΆllvm::Error addSaveTemps(
    std::string OutputFileName,
    bool UseInputModulePath = false)

Description

This is a convenience function that configures this Config object to write temporary files named after the given OutputFileName for each of the LTO phases to disk. A client can use this function to implement -save-temps. FIXME: Temporary files derived from ThinLTO backends are currently named after the input file name, rather than the output file name, when UseInputModulePath is set to true. Specifically, it (1) sets each of the above module hooks and the combined index hook to a function that calls the hook function (if any) that was present in the appropriate field when the addSaveTemps function was called, and writes the module to a bitcode file with a name prefixed by the given output file name, and (2) creates a resolution file whose name is prefixed by the given output file name and sets ResolutionFile to its file handle.

Declared at: llvm/include/llvm/LTO/Config.h:212

Parameters

std::string OutputFileName
bool UseInputModulePath = false