14#ifndef LLVM_PROFILEDATA_INSTRPROFWRITER_H
15#define LLVM_PROFILEDATA_INSTRPROFWRITER_H
32class InstrProfRecordWriterTrait;
47 uint64_t TemporalProfTraceReservoirSize;
49 uint64_t TemporalProfTraceStreamSize = 0;
58 std::vector<llvm::object::BuildID> BinaryIds;
73 bool WritePrevVersion =
false;
79 bool MemProfFullSchema;
82 bool MemprofGenerateRandomHotness;
90 uint64_t TemporalProfTraceReservoirSize = 0,
91 uint64_t MaxTemporalProfTraceLength = 0,
92 bool WritePrevVersion =
false,
96 bool MemProfFullSchema =
false,
97 bool MemprofGenerateRandomHotness =
false,
98 unsigned MemprofGenerateRandomHotnessSeed = 0);
164 return (
static_cast<bool>(ProfileKind &
A) &&
165 static_cast<bool>(
Other &
B)) ||
166 (
static_cast<bool>(ProfileKind &
B) &&
167 static_cast<bool>(
Other &
A));
172 if (
static_cast<bool>(
181 return make_error<InstrProfError>(
183 "cannot merge FunctionEntryOnly profiles and BB profiles together");
187 ProfileKind |=
Other;
201 MemProfVersionRequested =
Version;
This file defines the StringMap class.
This file declares a library for handling Build IDs and using them to find debug info.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file defines the DenseMap class.
This file implements a map that provides insertion order iteration.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
A symbol table used for function [IR]PGO name look-up with keys (such as pointers,...
bool hasSingleByteCoverage() const
void addVTableName(StringRef VTableName)
Error write(raw_fd_ostream &OS)
Write the profile to OS.
void addTemporalProfileTraces(SmallVectorImpl< TemporalProfTraceTy > &SrcTraces, uint64_t SrcStreamSize)
Add SrcTraces using reservoir sampling where SrcStreamSize is the total number of temporal profiling ...
void overlapRecord(NamedInstrProfRecord &&Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, const OverlapFuncFilters &FuncFilter)
Error writeText(raw_fd_ostream &OS)
Write the profile in text format to OS.
InstrProfKind getProfileKind() const
void addRecord(NamedInstrProfRecord &&I, function_ref< void(Error)> Warn)
void addBinaryIds(ArrayRef< llvm::object::BuildID > BIs)
void setMemProfVersionRequested(memprof::IndexedVersion Version)
static void writeRecordInText(StringRef Name, uint64_t Hash, const InstrProfRecord &Counters, InstrProfSymtab &Symtab, raw_fd_ostream &OS)
Write Record in text format to OS.
void setValueProfDataEndianness(llvm::endianness Endianness)
void addRecord(NamedInstrProfRecord &&I, uint64_t Weight, function_ref< void(Error)> Warn)
Add function counts for the given function.
void mergeRecordsFromWriter(InstrProfWriter &&IPW, function_ref< void(Error)> Warn)
Merge existing function counts from the given writer.
Error mergeProfileKind(const InstrProfKind Other)
Update the attributes of the current profile from the attributes specified.
void writeTextTemporalProfTraceData(raw_fd_ostream &OS, InstrProfSymtab &Symtab)
Write temporal profile trace data to the header in text format to OS.
SmallDenseMap< uint64_t, InstrProfRecord > ProfilingData
std::unique_ptr< MemoryBuffer > writeBuffer()
Write the profile, returning the raw data. For testing.
void setOutputSparse(bool Sparse)
StringMap< ProfilingData > & getProfileData()
bool addMemProfData(memprof::IndexedMemProfData Incoming, function_ref< void(Error)> Warn)
Add the entire MemProfData Incoming to the writer context.
void setMemProfFullSchema(bool Full)
Error validateRecord(const InstrProfRecord &Func)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
StringSet - A wrapper for StringMap that provides set-like functionality.
std::pair< typename Base::iterator, bool > insert(StringRef key)
An efficient, type-erasing, non-owning reference to a callable.
A raw_ostream that writes to a file descriptor.
A raw_ostream that writes to an std::string.
constexpr uint64_t MinimumSupportedVersion
This is an optimization pass for GlobalISel generic memory operations.
InstrProfKind
An enum describing the attributes of an instrumented profile.
@ LoopEntriesInstrumentation
@ FunctionEntryInstrumentation
@ FrontendInstrumentation
Incoming for lane maks phi as machine instruction, incoming register Reg and incoming block Block are...
Profiling information for a single function.
An ordered list of functions identified by their NameRef found in INSTR_PROF_DATA.