62 std::pair<offset_type, offset_type>
72 for (
const auto &ProfileData : *V) {
90 M += ValueProfData::getSize(ProfileData.second);
94 return std::make_pair(
N, M);
106 for (
const auto &ProfileData : *V) {
113 LE.write<
uint64_t>(ProfileData.first);
142 std::unique_ptr<ValueProfData> VDataPtr =
143 ValueProfData::serializeFrom(ProfileData.second);
146 Out.
write((
const char *)VDataPtr.get(), S);
154 bool Sparse,
uint64_t TemporalProfTraceReservoirSize,
155 uint64_t MaxTemporalProfTraceLength,
bool WritePrevVersion,
157 bool MemprofGenerateRandomHotness,
158 unsigned MemprofGenerateRandomHotnessSeed)
159 : Sparse(Sparse), MaxTemporalProfTraceLength(MaxTemporalProfTraceLength),
160 TemporalProfTraceReservoirSize(TemporalProfTraceReservoirSize),
162 WritePrevVersion(WritePrevVersion),
163 MemProfVersionRequested(MemProfVersionRequested),
164 MemProfFullSchema(MemProfFullSchema),
165 MemprofGenerateRandomHotness(MemprofGenerateRandomHotness) {
167 if (MemprofGenerateRandomHotness) {
168 unsigned seed = MemprofGenerateRandomHotnessSeed
169 ? MemprofGenerateRandomHotnessSeed
170 : std::time(
nullptr);
171 errs() <<
"random hotness seed = " << seed <<
"\n";
180 InfoObj->ValueProfDataEndianness = Endianness;
189 addRecord(Name, Hash, std::move(
I), Weight, Warn);
196 auto Name =
Other.Name;
197 auto Hash =
Other.Hash;
198 Other.accumulateCounts(FuncLevelOverlap.
Test);
199 auto It = FunctionData.find(Name);
200 if (It == FunctionData.end()) {
208 auto &ProfileDataMap = It->second;
209 auto [Where, NewFunc] = ProfileDataMap.try_emplace(Hash);
220 Dest.
overlap(
Other, Overlap, FuncLevelOverlap, ValueCutoff);
226 I.computeBlockUniformity();
228 auto &ProfileDataMap = FunctionData[Name];
230 auto [Where, NewFunc] = ProfileDataMap.try_emplace(Hash);
241 Dest.
scale(Weight, 1, MapWarn);
244 Dest.
merge(
I, Weight, MapWarn);
250void InstrProfWriter::addMemProfRecord(
256 if (MemprofGenerateRandomHotness) {
257 for (
auto &
Alloc : NewRecord.AllocSites) {
260 uint64_t NewTLAD = std::numeric_limits<uint64_t>::max();
262 bool IsCold = std::rand() % 2;
267 NewTL = std::numeric_limits<uint64_t>::max();
269 Alloc.Info.setTotalLifetimeAccessDensity(NewTLAD);
270 Alloc.Info.setTotalLifetime(NewTL);
273 MemProfSumBuilder.addRecord(NewRecord);
274 auto [Iter,
Inserted] = MemProfData.Records.insert({
Id, NewRecord});
279 memprof::IndexedMemProfRecord &Existing = Iter->second;
280 Existing.
merge(NewRecord);
286 auto [Iter,
Inserted] = MemProfData.Frames.insert({
Id, Frame});
291 if (!Inserted && Iter->second != Frame) {
293 "frame to id mapping mismatch"));
299bool InstrProfWriter::addMemProfCallStack(
303 auto [Iter,
Inserted] = MemProfData.CallStacks.insert({CSId, CallStack});
308 if (!Inserted && Iter->second != CallStack) {
310 "call stack to id mapping mismatch"));
327 if (MemProfData.Frames.empty())
328 MemProfData.Frames = std::move(Incoming.
Frames);
330 for (
const auto &[Id,
F] : Incoming.
Frames)
331 if (addMemProfFrame(Id,
F, Warn))
334 if (MemProfData.CallStacks.empty())
335 MemProfData.CallStacks = std::move(Incoming.
CallStacks);
337 for (
const auto &[CSId, CS] : Incoming.
CallStacks)
338 if (addMemProfCallStack(CSId, CS, Warn))
342 if (MemProfData.Records.empty() && !MemprofGenerateRandomHotness) {
346 MemProfSumBuilder.addRecord(
Record);
347 MemProfData.Records = std::move(Incoming.
Records);
350 addMemProfRecord(GUID,
Record);
361 std::unique_ptr<memprof::DataAccessProfData> DataAccessProfDataIn) {
362 DataAccessProfileData = std::move(DataAccessProfDataIn);
367 if (TemporalProfTraces.size() > TemporalProfTraceReservoirSize)
368 TemporalProfTraces.truncate(TemporalProfTraceReservoirSize);
369 for (
auto &
Trace : SrcTraces)
370 if (
Trace.FunctionNameRefs.
size() > MaxTemporalProfTraceLength)
371 Trace.FunctionNameRefs.resize(MaxTemporalProfTraceLength);
372 llvm::erase_if(SrcTraces, [](
auto &
T) {
return T.FunctionNameRefs.empty(); });
376 if (SrcTraces.
empty())
379 auto SrcTraceIt = SrcTraces.
begin();
380 while (TemporalProfTraces.size() < TemporalProfTraceReservoirSize &&
381 SrcTraceIt < SrcTraces.
end())
382 TemporalProfTraces.push_back(*SrcTraceIt++);
385 for (
uint64_t I = TemporalProfTraces.size();
386 I < SrcStreamSize && SrcTraceIt < SrcTraces.
end();
I++) {
387 std::uniform_int_distribution<uint64_t> Distribution(0,
I);
388 uint64_t RandomIndex = Distribution(RNG);
389 if (RandomIndex < TemporalProfTraces.size())
390 TemporalProfTraces[RandomIndex] = *SrcTraceIt++;
392 TemporalProfTraceStreamSize += SrcStreamSize;
397 for (
auto &
I : IPW.FunctionData)
398 for (
auto &Func :
I.getValue())
399 addRecord(
I.getKey(), Func.first, std::move(Func.second), 1, Warn);
401 BinaryIds.reserve(BinaryIds.size() + IPW.BinaryIds.size());
402 for (
auto &
I : IPW.BinaryIds)
406 IPW.TemporalProfTraceStreamSize);
408 MemProfData.Frames.reserve(IPW.MemProfData.Frames.size());
409 for (
auto &[FrameId, Frame] : IPW.MemProfData.Frames) {
412 if (!addMemProfFrame(FrameId, Frame, Warn))
416 MemProfData.CallStacks.reserve(IPW.MemProfData.CallStacks.size());
417 for (
auto &[CSId, CallStack] : IPW.MemProfData.CallStacks) {
418 if (!addMemProfCallStack(CSId, CallStack, Warn))
422 MemProfData.Records.reserve(IPW.MemProfData.Records.size());
423 for (
auto &[GUID,
Record] : IPW.MemProfData.Records) {
424 addMemProfRecord(GUID,
Record);
428bool InstrProfWriter::shouldEncodeData(
const ProfilingData &PD) {
431 for (
const auto &Func : PD) {
454 for (
unsigned I = 0;
I < Res.size();
I++)
459 const bool WritePrevVersion,
462 for (
int I = 0;
I < 4;
I++)
463 OS.
write(
reinterpret_cast<const uint64_t *
>(&Header)[
I]);
466 auto BackPatchStartOffset = OS.
tell();
473 if (!WritePrevVersion)
476 return BackPatchStartOffset;
487 uint64_t BinaryIdsSectionSize = 0;
491 BinaryIds.erase(
llvm::unique(BinaryIds), BinaryIds.end());
493 for (
const auto &BI : BinaryIds) {
495 BinaryIdsSectionSize +=
sizeof(uint64_t);
500 OS.
write(BinaryIdsSectionSize);
502 for (
const auto &BI : BinaryIds) {
503 uint64_t BILen = BI.size();
507 for (
unsigned K = 0;
K < BILen;
K++)
510 uint64_t PaddingSize =
alignToPowerOf2(BILen,
sizeof(uint64_t)) - BILen;
511 for (
unsigned K = 0;
K < PaddingSize;
K++)
519 std::vector<std::string> VTableNameStrs;
520 for (StringRef VTableName : VTableNames.keys())
521 VTableNameStrs.push_back(VTableName.str());
523 std::string CompressedVTableNames;
524 if (!VTableNameStrs.empty())
527 CompressedVTableNames))
530 const uint64_t CompressedStringLen = CompressedVTableNames.length();
533 OS.
write(CompressedStringLen);
536 for (
auto &c : CompressedVTableNames)
541 const uint64_t PaddedLength =
alignTo(CompressedStringLen, 8);
543 for (uint64_t K = CompressedStringLen;
K < PaddedLength;
K++)
550 using namespace IndexedInstrProf;
551 using namespace support;
553 OnDiskChainedHashTableGenerator<InstrProfRecordWriterTrait> Generator;
556 InfoObj->SummaryBuilder = &ISB;
558 InfoObj->CSSummaryBuilder = &CSISB;
559 InfoObj->WritePrevVersion = WritePrevVersion;
563 for (
const auto &
I : FunctionData)
564 if (shouldEncodeData(
I.getValue()))
567 for (
const auto &
I : OrderedData)
568 Generator.insert(
I.first,
I.second);
571 IndexedInstrProf::Header Header;
572 Header.Version = WritePrevVersion
583 if (
static_cast<bool>(ProfileKind &
586 if (
static_cast<bool>(ProfileKind &
598 const uint64_t BackPatchStartOffset =
599 writeHeader(Header, WritePrevVersion, OS);
603 uint32_t SummarySize = Summary::getSize(Summary::NumKinds, NumEntries);
605 uint64_t SummaryOffset = OS.
tell();
606 for (
unsigned I = 0;
I < SummarySize /
sizeof(uint64_t);
I++)
608 uint64_t CSSummaryOffset = 0;
609 uint64_t CSSummarySize = 0;
611 CSSummaryOffset = OS.
tell();
612 CSSummarySize = SummarySize /
sizeof(uint64_t);
613 for (
unsigned I = 0;
I < CSSummarySize;
I++)
618 uint64_t HashTableStart = Generator.
Emit(OS.
OS, *InfoObj);
621 uint64_t MemProfSectionStart = 0;
623 MemProfSectionStart = OS.
tell();
626 OS, MemProfData, MemProfVersionRequested, MemProfFullSchema,
627 std::move(DataAccessProfileData), MemProfSumBuilder.getSummary()))
631 uint64_t BinaryIdSectionStart = OS.
tell();
632 if (
auto E = writeBinaryIds(OS))
635 uint64_t VTableNamesSectionStart = OS.
tell();
637 if (!WritePrevVersion)
638 if (
Error E = writeVTableNames(OS))
641 uint64_t TemporalProfTracesSectionStart = 0;
643 TemporalProfTracesSectionStart = OS.
tell();
644 OS.
write(TemporalProfTraces.size());
645 OS.
write(TemporalProfTraceStreamSize);
646 for (
auto &Trace : TemporalProfTraces) {
647 OS.
write(Trace.Weight);
648 OS.
write(Trace.FunctionNameRefs.size());
649 for (
auto &NameRef : Trace.FunctionNameRefs)
655 std::unique_ptr<IndexedInstrProf::Summary> TheSummary =
659 std::unique_ptr<ProfileSummary> PS = ISB.getSummary();
661 InfoObj->SummaryBuilder =
nullptr;
664 std::unique_ptr<IndexedInstrProf::Summary> TheCSSummary =
nullptr;
667 std::unique_ptr<ProfileSummary> CSPS = CSISB.getSummary();
670 InfoObj->CSSummaryBuilder =
nullptr;
672 SmallVector<uint64_t, 8> HeaderOffsets = {HashTableStart, MemProfSectionStart,
673 BinaryIdSectionStart,
674 TemporalProfTracesSectionStart};
675 if (!WritePrevVersion)
676 HeaderOffsets.
push_back(VTableNamesSectionStart);
678 PatchItem PatchItems[] = {
680 {BackPatchStartOffset, HeaderOffsets},
683 ArrayRef<uint64_t>(
reinterpret_cast<uint64_t *
>(TheSummary.get()),
684 SummarySize /
sizeof(uint64_t))},
686 ArrayRef<uint64_t>(
reinterpret_cast<uint64_t *
>(TheCSSummary.get()),
689 OS.
patch(PatchItems);
691 for (
const auto &
I : FunctionData)
692 for (
const auto &
F :
I.getValue())
702 return writeImpl(POS);
707 return writeImpl(POS);
721#define VALUE_PROF_KIND(Enumerator, Value, Descr) #Enumerator,
726 for (
uint32_t VK = 0; VK <= IPVK_Last; VK++) {
727 if (VK == IPVK_IndirectCallTarget || VK == IPVK_VTableTarget)
729 uint32_t NS = Func.getNumValueSites(VK);
732 for (
const auto &V : Func.getValueArrayForSite(VK, S))
733 if (!SeenValues.
insert(V.Value).second)
746 OS <<
"# Func Hash:\n" << Hash <<
"\n";
747 OS <<
"# Num Counters:\n" << Func.Counts.size() <<
"\n";
748 OS <<
"# Counter Values:\n";
752 if (Func.BitmapBytes.size() > 0) {
753 OS <<
"# Num Bitmap Bytes:\n$" << Func.BitmapBytes.size() <<
"\n";
754 OS <<
"# Bitmap Byte Values:\n";
755 for (
uint8_t Byte : Func.BitmapBytes) {
763 uint32_t NumValueKinds = Func.getNumValueKinds();
764 if (!NumValueKinds) {
769 OS <<
"# Num Value Kinds:\n" << Func.getNumValueKinds() <<
"\n";
770 for (
uint32_t VK = 0; VK < IPVK_Last + 1; VK++) {
771 uint32_t NS = Func.getNumValueSites(VK);
775 OS <<
"# NumValueSites:\n" << NS <<
"\n";
777 auto VD = Func.getValueArrayForSite(VK, S);
778 OS << VD.size() <<
"\n";
779 for (
const auto &V : VD) {
780 if (VK == IPVK_IndirectCallTarget || VK == IPVK_VTableTarget)
784 OS << V.Value <<
":" << V.Count <<
"\n";
795 OS <<
"# CSIR level Instrumentation Flag\n:csir\n";
797 OS <<
"# IR level Instrumentation Flag\n:ir\n";
799 if (
static_cast<bool>(ProfileKind &
801 OS <<
"# Always instrument the function entry block\n:entry_first\n";
802 if (
static_cast<bool>(ProfileKind &
804 OS <<
"# Always instrument the loop entry "
805 "blocks\n:instrument_loop_entries\n";
807 OS <<
"# Instrument block coverage\n:single_byte_coverage\n";
811 using RecordType = std::pair<StringRef, FuncPair>;
814 for (
const auto &
I : FunctionData) {
815 if (shouldEncodeData(
I.getValue())) {
818 for (
const auto &Func :
I.getValue())
819 OrderedFuncData.
push_back(std::make_pair(
I.getKey(), Func));
823 for (
const auto &VTableName : VTableNames)
831 return std::tie(
A.first,
A.second.first) <
832 std::tie(
B.first,
B.second.first);
835 for (
const auto &record : OrderedFuncData) {
837 const FuncPair &Func = record.second;
841 for (
const auto &record : OrderedFuncData) {
842 const FuncPair &Func = record.second;
852 OS <<
":temporal_prof_traces\n";
853 OS <<
"# Num Temporal Profile Traces:\n" << TemporalProfTraces.size() <<
"\n";
854 OS <<
"# Temporal Profile Trace Stream Size:\n"
855 << TemporalProfTraceStreamSize <<
"\n";
856 for (
auto &
Trace : TemporalProfTraces) {
857 OS <<
"# Weight:\n" <<
Trace.Weight <<
"\n";
858 for (
auto &NameRef :
Trace.FunctionNameRefs)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static void setSummary(IndexedInstrProf::Summary *TheSummary, ProfileSummary &PS)
static const char * ValueProfKindStr[]
#define VARIANT_MASK_CSIR_PROF
#define VARIANT_MASK_MEMPROF
#define VARIANT_MASK_TEMPORAL_PROF
#define VARIANT_MASK_IR_PROF
#define VARIANT_MASK_BYTE_COVERAGE
#define VARIANT_MASK_INSTR_ENTRY
#define VARIANT_MASK_FUNCTION_ENTRY_ONLY
#define VARIANT_MASK_INSTR_LOOP_ENTRIES
Defines facilities for reading and writing on-disk hash tables.
FunctionLoweringInfo::StatepointRelocationRecord RecordType
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
Implements a dense probed hash-table based set.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
const InstrProfWriter::ProfilingData *const data_type_ref
InstrProfSummaryBuilder * SummaryBuilder
llvm::endianness ValueProfDataEndianness
void EmitData(raw_ostream &Out, key_type_ref K, data_type_ref V, offset_type)
static hash_value_type ComputeHash(key_type_ref K)
InstrProfSummaryBuilder * CSSummaryBuilder
InstrProfRecordWriterTrait()=default
std::pair< offset_type, offset_type > EmitKeyDataLength(raw_ostream &Out, key_type_ref K, data_type_ref V)
void EmitKey(raw_ostream &Out, key_type_ref K, offset_type N)
const InstrProfWriter::ProfilingData *const data_type
A symbol table used for function [IR]PGO name look-up with keys (such as pointers,...
StringRef getFuncOrVarName(uint64_t ValMD5Hash) const
Return name of functions or global variables from the name's md5 hash value.
StringRef getFuncOrVarNameIfDefined(uint64_t ValMD5Hash) const
Just like getFuncOrVarName, except that it will return literal string 'External Symbol' if the functi...
Error addVTableName(StringRef VTableName)
Adds VTableName as a known symbol, and inserts it to a map that tracks all vtable names.
Error addFuncName(StringRef FuncName)
The method name is kept since there are many callers.
LLVM_ABI InstrProfWriter(bool Sparse=false, uint64_t TemporalProfTraceReservoirSize=0, uint64_t MaxTemporalProfTraceLength=0, bool WritePrevVersion=false, memprof::IndexedVersion MemProfVersionRequested=static_cast< memprof::IndexedVersion >(memprof::MinimumSupportedVersion), bool MemProfFullSchema=false, bool MemprofGenerateRandomHotness=false, unsigned MemprofGenerateRandomHotnessSeed=0)
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.
LLVM_ABI void addBinaryIds(ArrayRef< llvm::object::BuildID > BIs)
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.
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)
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)
LLVM_ABI Error validateRecord(const InstrProfRecord &Func)
static std::unique_ptr< MemoryBuffer > getMemBufferCopy(StringRef InputData, const Twine &BufferName="")
Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it.
offset_type Emit(raw_ostream &Out)
Emit the table to Out, which must not be at offset 0.
LLVM_ABI uint64_t tell() const
LLVM_ABI void writeByte(uint8_t V)
LLVM_ABI void patch(ArrayRef< PatchItem > P)
LLVM_ABI void write(uint64_t V)
static LLVM_ABI const ArrayRef< uint32_t > DefaultCutoffs
A vector of useful cutoff values for detailed summary.
uint64_t getTotalCount() const
uint64_t getMaxCount() const
const SummaryEntryVector & getDetailedSummary()
uint32_t getNumCounts() const
uint64_t getMaxInternalCount() const
uint64_t getMaxFunctionCount() const
uint32_t getNumFunctions() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
std::pair< iterator, bool > insert(const ValueT &V)
An efficient, type-erasing, non-owning reference to a callable.
A raw_ostream that writes to a file descriptor.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
raw_ostream & write(unsigned char C)
A raw_ostream that writes to an std::string.
std::unique_ptr< Summary > allocSummary(uint32_t TotalSize)
uint64_t ComputeHash(StringRef K)
LLVM_ABI bool isAvailable()
This is an optimization pass for GlobalISel generic memory operations.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
void shuffle(Iterator first, Iterator last, RNG &&g)
auto unique(Range &&R, Predicate P)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
void sort(IteratorTy Start, IteratorTy End)
constexpr T alignToPowerOf2(U Value, V Align)
Will overflow only if result is not representable in T.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
LLVM_ABI Error collectGlobalObjectNameStrings(ArrayRef< std::string > NameStrs, bool doCompression, std::string &Result)
Given a vector of strings (names of global objects like functions or, virtual tables) NameStrs,...
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
LLVM_ABI Error writeMemProf(ProfOStream &OS, memprof::IndexedMemProfData &MemProfData, memprof::IndexedVersion MemProfVersionRequested, bool MemProfFullSchema, std::unique_ptr< memprof::DataAccessProfData > DataAccessProfileData, std::unique_ptr< memprof::MemProfSummary > MemProfSum)
@ LoopEntriesInstrumentation
@ FunctionEntryInstrumentation
void set(SummaryFieldKind K, uint64_t V)
void setEntry(uint32_t I, const ProfileSummaryEntry &E)
uint64_t NumSummaryFields
uint64_t NumCutoffEntries
Profiling information for a single function.
std::vector< uint64_t > Counts
LLVM_ABI void merge(InstrProfRecord &Other, uint64_t Weight, function_ref< void(instrprof_error)> Warn)
Merge the counts in Other into this one.
std::vector< uint8_t > UniformityBits
For AMDGPU offload profiling: 1 bit per basic block indicating whether the block is usually entered w...
LLVM_ABI void overlap(InstrProfRecord &Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff)
Compute the overlap b/w this IntrprofRecord and Other.
void sortValueData()
Sort value profile data (per site) by count.
std::vector< uint8_t > BitmapBytes
LLVM_ABI void scale(uint64_t N, uint64_t D, function_ref< void(instrprof_error)> Warn)
Scale up profile counts (including value profile data) by a factor of (N / D).
static bool hasCSFlagInHash(uint64_t FuncHash)
const std::string NameFilter
LLVM_ABI void addOneMismatch(const CountSumOrPercent &MismatchFunc)
CountSumOrPercent Overlap
LLVM_ABI void addOneUnique(const CountSumOrPercent &UniqueFunc)
llvm::MapVector< CallStackId, llvm::SmallVector< FrameId > > CallStacks
llvm::MapVector< GlobalValue::GUID, IndexedMemProfRecord > Records
llvm::MapVector< FrameId, Frame > Frames
void merge(const IndexedMemProfRecord &Other)
Adapter to write values to a stream in a particular byte order.