15 #ifndef LLVM_LTO_THINLTOCODEGENERATOR_H 16 #define LLVM_LTO_THINLTOCODEGENERATOR_H 44 std::unique_ptr<TargetMachine>
create()
const;
71 void crossReferenceSymbol(
StringRef Name);
89 return ProducedBinaries;
98 return ProducedBinaryFiles;
133 void setCacheDir(std::string Path) { CacheOptions.Path = std::move(Path); }
140 CacheOptions.Policy.Interval.reset();
142 CacheOptions.Policy.Interval = std::chrono::seconds(Interval);
149 CacheOptions.Policy.Expiration = std::chrono::seconds(Expiration);
167 CacheOptions.Policy.MaxSizePercentageOfAvailableSpace = Percentage;
175 CacheOptions.Policy.MaxSizeBytes = MaxSizeBytes;
182 CacheOptions.Policy.MaxSizeFiles = MaxSizeFiles;
196 SavedObjectsDirectoryPath = std::move(Path);
200 void setCpu(std::string Cpu) { TMBuilder.MCpu = std::move(Cpu); }
203 void setAttr(std::string
MAttr) { TMBuilder.MAttr = std::move(MAttr); }
207 TMBuilder.Options = std::move(Options);
216 TMBuilder.RelocModel =
Model;
226 OptLevel = (NewOptLevel > 3) ? 3 : NewOptLevel;
247 std::unique_ptr<ModuleSummaryIndex> linkCombinedIndex();
260 void emitImports(Module &Module,
StringRef OutputName,
276 std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex,
288 void optimize(Module &Module);
295 std::string writeGeneratedObject(
int count,
StringRef CacheEntryPath,
305 std::vector<std::unique_ptr<MemoryBuffer>> ProducedBinaries;
308 std::vector<std::string> ProducedBinaryFiles;
312 std::vector<std::unique_ptr<lto::InputFile>> Modules;
325 std::string SaveTempsDir;
328 std::string SavedObjectsDirectoryPath;
332 bool DisableCodeGen =
false;
336 bool CodeGenOnly =
false;
340 bool Freestanding =
false;
343 unsigned OptLevel = 3;
void setCacheDir(std::string Path)
Provide a path to a directory where to store the cached files for incremental build.
void setCodePICModel(Optional< Reloc::Model > Model)
CodeModel.
This class represents lattice values for constants.
CodeGenOpt::Level CGOptLevel
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Interval Class - An Interval is a set of nodes defined such that every node in the interval has all o...
void setGeneratedObjectsDirectory(std::string Path)
Set the path to a directory where to save generated object files.
void setCpu(std::string Cpu)
CPU to use to initialize the TargetMachine.
void setCodeGenOnly(bool CGOnly)
Perform CodeGen only: disable all other stages.
void setCodeGenOptLevel(CodeGenOpt::Level CGOptLevel)
CodeGen optimization level.
void setCacheMaxSizeFiles(unsigned MaxSizeFiles)
Cache policy: the maximum number of files in the cache directory.
This class define an interface similar to the LTOCodeGenerator, but adapted for ThinLTO processing...
void setSaveTempsDir(std::string Path)
Set the path to a directory where to save temporaries at various stages of the processing.
void disableCodeGen(bool Disable)
Disable CodeGen, only run the stages till codegen and stop.
void setTargetOptions(TargetOptions Options)
TargetMachine options.
Class to hold module path string table and global value map, and encapsulate methods for operating on...
void setAttr(std::string MAttr)
Subtarget attributes.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
void gatherImportedSummariesForModule(StringRef ModulePath, const StringMap< GVSummaryMapTy > &ModuleToDefinedGVSummaries, const FunctionImporter::ImportMapTy &ImportList, std::map< std::string, GVSummaryMapTy > &ModuleToSummariesForIndex)
Compute the set of summaries needed for a ThinLTO backend compilation of ModulePath.
Instrumentation for Order File
Helper to gather options relevant to the target machine creation.
void setCachePruningInterval(int Interval)
Cache policy: interval (seconds) between two prunes of the cache.
std::vector< std::unique_ptr< MemoryBuffer > > & getProducedBinaries()
Return the "in memory" binaries produced by the code generator.
void setFreestanding(bool Enabled)
Enable the Freestanding mode: indicate that the optimizer should not assume builtins are present on t...
void setOptLevel(unsigned NewOptLevel)
IR optimization level: from 0 to 3.
void setCacheMaxSizeBytes(uint64_t MaxSizeBytes)
Cache policy: the maximum size for the cache directory in bytes.
Triple - Helper class for working with autoconf configuration names.
This interface provides simple read-only access to a block of memory, and provides simple methods for...
Policy for the pruneCache() function.
void setMaxCacheSizeRelativeToAvailableSpace(unsigned Percentage)
Sets the maximum cache size that can be persistent across build, in terms of percentage of the availa...
std::unique_ptr< TargetMachine > create() const
std::vector< std::string > & getProducedBinaryFiles()
Return the "on-disk" binaries produced by the code generator.
Optional< Reloc::Model > RelocModel
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
void setCacheEntryExpiration(unsigned Expiration)
Cache policy: expiration (in seconds) for an entry.
StringSet - A wrapper for StringMap that provides set-like functionality.
CachePruningPolicy Policy
StringRef - Represent a constant reference to a string, i.e.