Go to the documentation of this file.
14 #ifndef LLVM_PROFILEDATA_INSTRPROFWRITER_H
15 #define LLVM_PROFILEDATA_INSTRPROFWRITER_H
31 class InstrProfRecordWriterTrait;
114 return (
static_cast<bool>(ProfileKind & A) &&
115 static_cast<bool>(
Other &
B)) ||
116 (
static_cast<bool>(ProfileKind &
B) &&
117 static_cast<bool>(
Other & A));
122 if (
static_cast<bool>(
129 return make_error<InstrProfError>(
131 "cannot merge FunctionEntryOnly profiles and BB profiles together");
135 ProfileKind |=
Other;
160 #endif // LLVM_PROFILEDATA_INSTRPROFWRITER_H
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
Error writeText(raw_fd_ostream &OS)
Write the profile in text format to OS.
This is an optimization pass for GlobalISel generic memory operations.
constexpr support::endianness Endianness
The endianness of all multi-byte encoded values in MessagePack.
@ FunctionEntryInstrumentation
Error write(raw_fd_ostream &OS)
Write the profile to OS.
static ErrorSuccess success()
Create a success value.
Error mergeProfileKind(const InstrProfKind Other)
Update the attributes of the current profile from the attributes specified.
This class implements a map that also provides access to all stored values in a deterministic order.
Profiling information for a single function.
StringMap< ProfilingData > & getProfileData()
static void writeRecordInText(StringRef Name, uint64_t Hash, const InstrProfRecord &Counters, InstrProfSymtab &Symtab, raw_fd_ostream &OS)
Write Record in text format to OS.
InstrProfKind getProfileKind() const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
An efficient, type-erasing, non-owning reference to a callable.
void setValueProfDataEndianness(support::endianness Endianness)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
bool addMemProfFrame(const memprof::FrameId, const memprof::Frame &F, function_ref< void(Error)> Warn)
Add a memprof frame identified by the hash of the contents of the frame in FrameId.
void addMemProfRecord(const GlobalValue::GUID Id, const memprof::IndexedMemProfRecord &Record)
Add a memprof record for a function identified by its Id.
@ FrontendInstrumentation
InstrProfWriter(bool Sparse=false)
void addRecord(NamedInstrProfRecord &&I, uint64_t Weight, function_ref< void(Error)> Warn)
Add function counts for the given function.
StringRef - Represent a constant reference to a string, i.e.
A raw_ostream that writes to a file descriptor.
std::unique_ptr< MemoryBuffer > writeBuffer()
Write the profile, returning the raw data. For testing.
A symbol table used for function PGO name look-up with keys (such as pointers, md5hash values) to the...
Lightweight error class with error context and mandatory checking.
Error validateRecord(const InstrProfRecord &Func)
void addRecord(NamedInstrProfRecord &&I, function_ref< void(Error)> Warn)
SmallDenseMap< uint64_t, InstrProfRecord > ProfilingData
InstrProfKind
An enum describing the attributes of an instrumented profile.
void setOutputSparse(bool Sparse)
void mergeRecordsFromWriter(InstrProfWriter &&IPW, function_ref< void(Error)> Warn)
Merge existing function counts from the given writer.
Optional< std::vector< StOtherPiece > > Other
void overlapRecord(NamedInstrProfRecord &&Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, const OverlapFuncFilters &FuncFilter)