LLVM 20.0.0git
Classes | Namespaces | Typedefs | Functions
LTO.h File Reference
#include <memory>
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/LTO/Config.h"
#include "llvm/Object/IRSymtab.h"
#include "llvm/Support/Caching.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/thread.h"
#include "llvm/Transforms/IPO/FunctionAttrs.h"
#include "llvm/Transforms/IPO/FunctionImport.h"

Go to the source code of this file.

Classes

class  llvm::lto::InputFile
 An input file. More...
 
struct  llvm::lto::InputFile::Symbol
 The purpose of this struct is to only expose the symbol information that an LTO client should need in order to do symbol resolution. More...
 
class  llvm::lto::ThinBackendProc
 This class defines the interface to the ThinLTO backend. More...
 
struct  llvm::lto::ThinBackend
 This type defines the behavior following the thin-link phase during ThinLTO. More...
 
class  llvm::lto::LTO
 This class implements a resolution-based interface to LLVM's LTO functionality. More...
 
struct  llvm::lto::LTO::RegularLTOState::CommonResolution
 
struct  llvm::lto::LTO::RegularLTOState::AddedModule
 
struct  llvm::lto::SymbolResolution
 The resolution for a symbol. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::lto
 

Typedefs

using llvm::lto::IndexWriteCallback = std::function< void(const std::string &)>
 
using llvm::lto::ThinBackendFunction = std::function< std::unique_ptr< ThinBackendProc >(const Config &C, ModuleSummaryIndex &CombinedIndex, const DenseMap< StringRef, GVSummaryMapTy > &ModuleToDefinedGVSummaries, AddStreamFn AddStream, FileCache Cache)>
 This callable defines the behavior of a ThinLTO backend after the thin-link phase.
 

Functions

void llvm::thinLTOResolvePrevailingInIndex (const lto::Config &C, ModuleSummaryIndex &Index, function_ref< bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing, function_ref< void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)> recordNewLinkage, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols)
 Resolve linkage for prevailing symbols in the Index.
 
void llvm::thinLTOInternalizeAndPromoteInIndex (ModuleSummaryIndex &Index, function_ref< bool(StringRef, ValueInfo)> isExported, function_ref< bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing)
 Update the linkages in the given Index to mark exported values as external and non-exported values as internal.
 
std::string llvm::computeLTOCacheKey (const lto::Config &Conf, const ModuleSummaryIndex &Index, StringRef ModuleID, const FunctionImporter::ImportMapTy &ImportList, const FunctionImporter::ExportSetTy &ExportList, const std::map< GlobalValue::GUID, GlobalValue::LinkageTypes > &ResolvedODR, const GVSummaryMapTy &DefinedGlobals, const DenseSet< GlobalValue::GUID > &CfiFunctionDefs={}, const DenseSet< GlobalValue::GUID > &CfiFunctionDecls={})
 Computes a unique hash for the Module considering the current list of export/import and other global analysis results.
 
std::string llvm::recomputeLTOCacheKey (const std::string &Key, StringRef ExtraID)
 Recomputes the LTO cache key for a given key with an extra identifier.
 
StringLiteral llvm::lto::getThinLTODefaultCPU (const Triple &TheTriple)
 
std::string llvm::lto::getThinLTOOutputFile (StringRef Path, StringRef OldPrefix, StringRef NewPrefix)
 Given the original Path to an output file, replace any path prefix matching OldPrefix with NewPrefix.
 
Expected< std::unique_ptr< ToolOutputFile > > llvm::lto::setupLLVMOptimizationRemarks (LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional< uint64_t > RemarksHotnessThreshold=0, int Count=-1)
 Setup optimization remarks.
 
Expected< std::unique_ptr< ToolOutputFile > > llvm::lto::setupStatsFile (StringRef StatsFilename)
 Setups the output file for saving statistics.
 
std::vector< int > llvm::lto::generateModulesOrdering (ArrayRef< BitcodeModule * > R)
 Produces a container ordering for optimal multi-threaded processing.
 
void llvm::lto::updateMemProfAttributes (Module &Mod, const ModuleSummaryIndex &Index)
 Updates MemProf attributes (and metadata) based on whether the index has recorded that we are linking with allocation libraries containing the necessary APIs for downstream transformations.
 
ThinBackend llvm::lto::createInProcessThinBackend (ThreadPoolStrategy Parallelism, IndexWriteCallback OnWrite=nullptr, bool ShouldEmitIndexFiles=false, bool ShouldEmitImportsFiles=false)
 This ThinBackend runs the individual backend jobs in-process.
 
ThinBackend llvm::lto::createWriteIndexesThinBackend (ThreadPoolStrategy Parallelism, std::string OldPrefix, std::string NewPrefix, std::string NativeObjectPrefix, bool ShouldEmitImportsFiles, raw_fd_ostream *LinkedObjectsFile, IndexWriteCallback OnWrite)
 This ThinBackend writes individual module indexes to files, instead of running the individual backend jobs.