14#ifndef LLVM_PROFILEDATA_INSTRPROFWRITER_H
15#define LLVM_PROFILEDATA_INSTRPROFWRITER_H
35class InstrProfRecordWriterTrait;
50 uint64_t TemporalProfTraceReservoirSize;
52 uint64_t TemporalProfTraceStreamSize = 0;
61 std::vector<llvm::object::BuildID> BinaryIds;
76 bool WritePrevVersion =
false;
82 bool MemProfFullSchema;
85 bool MemprofGenerateRandomHotness;
87 std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData;
99 uint64_t TemporalProfTraceReservoirSize = 0,
100 uint64_t MaxTemporalProfTraceLength = 0,
101 bool WritePrevVersion =
false,
105 bool MemProfFullSchema =
false,
106 bool MemprofGenerateRandomHotness =
false,
107 unsigned MemprofGenerateRandomHotnessSeed = 0);
136 std::unique_ptr<memprof::DataAccessProfData> DataAccessProfile);
178 return (
static_cast<bool>(ProfileKind &
A) &&
179 static_cast<bool>(
Other &
B)) ||
180 (
static_cast<bool>(ProfileKind &
B) &&
181 static_cast<bool>(
Other &
A));
186 if (
static_cast<bool>(
195 return make_error<InstrProfError>(
197 "cannot merge FunctionEntryOnly profiles and BB profiles together");
201 ProfileKind |=
Other;
215 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)
LLVM_ABI Error write(raw_fd_ostream &OS)
Write the profile to OS.
LLVM_ABI void addTemporalProfileTraces(SmallVectorImpl< TemporalProfTraceTy > &SrcTraces, uint64_t SrcStreamSize)
Add SrcTraces using reservoir sampling where SrcStreamSize is the total number of temporal profiling ...
LLVM_ABI void overlapRecord(NamedInstrProfRecord &&Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, const OverlapFuncFilters &FuncFilter)
LLVM_ABI 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)
LLVM_ABI void addBinaryIds(ArrayRef< llvm::object::BuildID > BIs)
void setMemProfVersionRequested(memprof::IndexedVersion Version)
static LLVM_ABI void writeRecordInText(StringRef Name, uint64_t Hash, const InstrProfRecord &Counters, InstrProfSymtab &Symtab, raw_fd_ostream &OS)
Write Record in text format to OS.
LLVM_ABI void setValueProfDataEndianness(llvm::endianness Endianness)
LLVM_ABI void addRecord(NamedInstrProfRecord &&I, uint64_t Weight, function_ref< void(Error)> Warn)
Add function counts for the given function.
LLVM_ABI ~InstrProfWriter()
LLVM_ABI 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.
LLVM_ABI 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
LLVM_ABI std::unique_ptr< MemoryBuffer > writeBuffer()
Write the profile, returning the raw data. For testing.
LLVM_ABI void setOutputSparse(bool Sparse)
StringMap< ProfilingData > & getProfileData()
LLVM_ABI bool addMemProfData(memprof::IndexedMemProfData Incoming, function_ref< void(Error)> Warn)
Add the entire MemProfData Incoming to the writer context.
LLVM_ABI void addDataAccessProfData(std::unique_ptr< memprof::DataAccessProfData > DataAccessProfile)
void setMemProfFullSchema(bool Full)
LLVM_ABI 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.