|
LLVM 23.0.0git
|
Prepares inputs for Distributed ThinLTO so that backend compilations can use individual bitcode paths and consistent module IDs. More...
#include "llvm/DTLTO/DTLTO.h"
Classes | |
| struct | DistributionDriverParams |
| struct | Job |
Public Member Functions | |
| LLVM_ABI | DTLTO (Config Conf, unsigned ParallelCodeGenParallelismLevel, LTOKind LTOMode, IndexWriteCallback OnWrite, bool EmitIndexFiles, bool EmitImportsFiles, StringRef LinkerOutputFile, StringRef Distributor, ArrayRef< StringRef > DistributorArgs, StringRef RemoteCompiler, ArrayRef< StringRef > RemoteCompilerPrependArgs, ArrayRef< StringRef > RemoteCompilerArgs, AddBufferFn AddBufferArg, bool SaveTempsArg) |
| LLVM_ABI Expected< std::shared_ptr< InputFile > > | addInput (std::unique_ptr< InputFile > InputPtr) override |
| Add an input file and prepare it for distribution. | |
| virtual LLVM_ABI Error | run (AddStreamFn AddStream, FileCache Cache={}) override |
| Runs the DTLTO pipeline. | |
| Config & | getConfig () |
| const Config & | getConfig () const |
| Public Member Functions inherited from llvm::lto::LTO | |
| LLVM_ABI | LTO (Config Conf, ThinBackend Backend={}, unsigned ParallelCodeGenParallelismLevel=1, LTOKind LTOMode=LTOK_Default) |
| Create an LTO object. | |
| virtual LLVM_ABI | ~LTO () |
| LLVM_ABI Error | add (std::unique_ptr< InputFile > Obj, ArrayRef< SymbolResolution > Res) |
| Add an input file to the LTO link, using the provided symbol resolutions. | |
| LLVM_ABI void | setBitcodeLibFuncs (ArrayRef< StringRef > BitcodeLibFuncs) |
| Set the list of functions implemented in bitcode that were not extracted from an archive. | |
| LLVM_ABI unsigned | getMaxTasks () const |
| Returns an upper bound on the number of tasks that the client may expect. | |
| void | emitRemark (OptimizationRemark &Remark) |
| Helper to emit an optimization remark during the LTO link when outside of the standard optimization pass pipeline. | |
| virtual Expected< std::shared_ptr< lto::InputFile > > | addInput (std::unique_ptr< lto::InputFile > InputPtr) |
Static Public Member Functions | |
| static lto::ThinBackend | writeIndexesBackendInstance () |
| Static Public Member Functions inherited from llvm::lto::LTO | |
| static LLVM_ABI SmallVector< const char * > | getRuntimeLibcallSymbols (const Triple &TT) |
| Static method that returns a list of libcall symbols that can be generated by LTO but might not be visible from bitcode symbol table. | |
| static LLVM_ABI SmallVector< StringRef > | getLibFuncSymbols (const Triple &TT, llvm::StringSaver &Saver) |
| Static method that returns a list of library function symbols that can be generated by LTO but might not be visible from bitcode symbol table. | |
Additional Inherited Members | |
| Public Types inherited from llvm::lto::LTO | |
| enum | LTOKind { LTOK_Default , LTOK_UnifiedRegular , LTOK_UnifiedThin } |
| Unified LTO modes. More... | |
| Protected Types inherited from llvm::lto::LTO | |
| using | ModuleMapType = MapVector<StringRef, BitcodeModule> |
| Protected Attributes inherited from llvm::lto::LTO | |
| Config | Conf |
| struct llvm::lto::LTO::RegularLTOState | RegularLTO |
| struct llvm::lto::LTO::ThinLTOState | ThinLTO |
| LTOKind | LTOMode |
Prepares inputs for Distributed ThinLTO so that backend compilations can use individual bitcode paths and consistent module IDs.
Each input must exist as an individual bitcode file on disk and be loadable via its ModuleID. Archive members and FatLTO objects do not satisfy that by default; this class writes bitcode out when needed and updates ModuleID. On Windows, module IDs are normalized to remove short 8.3 path components that are machine-local and break distribution; other normalization is left to DTLTO distributors.
Input files are kept until the pipeline has determined per-module ThinLTO participation. addInput() performs: (1) register the input; (2) on Windows, normalize module ID for standalone bitcode; (3) for thin archive members, set module ID to the on-disk member path; (4) for other archives and FatLTO, set module ID to a unique path and serialize content in serializeLTOInputs().
|
inline |
Definition at line 50 of file DTLTO.h.
References assert(), llvm::lto::LTO::Conf, llvm::EmitImportsFiles(), llvm::StringRef::empty(), LLVM_ABI, llvm::lto::LTO::LTOK_UnifiedThin, llvm::lto::LTO::LTOMode, llvm::move(), and writeIndexesBackendInstance().
|
override |
Add an input file and prepare it for distribution.
This function performs the following tasks:
Definition at line 134 of file DTLTOInputFiles.cpp.
References llvm::sys::path::append(), llvm::StringRef::empty(), llvm::sys::path::filename(), llvm::sys::Process::getProcessId(), N, llvm::sys::path::parent_path(), llvm::BitcodeModule::setModuleIdentifier(), llvm::Error::success(), llvm::Expected< T >::takeError(), and llvm::utohexstr().
|
inline |
Definition at line 119 of file DTLTO.h.
References llvm::lto::LTO::Conf.
Definition at line 120 of file DTLTO.h.
References llvm::lto::LTO::Conf.
|
overridevirtual |
Runs the DTLTO pipeline.
This function calls the supplied AddStream function to add native object files to the link.
The Cache parameter is optional. If supplied, it will be used to cache native object files and add them to the link.
The client will receive at most one callback (via either AddStream or Cache) for each task identifier.
Reimplemented from llvm::lto::LTO.
Definition at line 77 of file DTLTO.cpp.
References cleanup(), llvm::lto::LTO::Conf, llvm::sys::Process::getProcessId(), llvm::itostr(), LLVM_ABI, llvm::lto::LTO::RegularLTO, and llvm::Error::success().
|
inlinestatic |
Definition at line 71 of file DTLTO.h.
References llvm::lto::createWriteIndexesThinBackend(), and llvm::hardware_concurrency().
Referenced by DTLTO().