61 std::pair<offset_type, offset_type>
71 for (
const auto &ProfileData : *V) {
73 M +=
sizeof(uint64_t);
74 M +=
sizeof(uint64_t);
75 M += ProfRecord.
Counts.size() *
sizeof(uint64_t);
76 M +=
sizeof(uint64_t);
79 M += ProfRecord.
BitmapBytes.size() *
sizeof(uint64_t);
84 M +=
sizeof(uint64_t);
89 M += ValueProfData::getSize(ProfileData.second);
93 return std::make_pair(
N, M);
105 for (
const auto &ProfileData : *V) {
112 LE.write<uint64_t>(ProfileData.first);
113 LE.write<uint64_t>(ProfRecord.
Counts.size());
114 for (uint64_t
I : ProfRecord.
Counts)
115 LE.write<uint64_t>(
I);
121 LE.write<uint64_t>(
I);
141 std::unique_ptr<ValueProfData> VDataPtr =
142 ValueProfData::serializeFrom(ProfileData.second);
145 Out.
write((
const char *)VDataPtr.get(), S);
153 bool Sparse, uint64_t TemporalProfTraceReservoirSize,
154 uint64_t MaxTemporalProfTraceLength,
bool WritePrevVersion,
156 bool MemprofGenerateRandomHotness,
unsigned RandomSeed)
157 : Sparse(Sparse), MaxTemporalProfTraceLength(MaxTemporalProfTraceLength),
158 TemporalProfTraceReservoirSize(TemporalProfTraceReservoirSize),
160 WritePrevVersion(WritePrevVersion),
161 MemProfVersionRequested(MemProfVersionRequested),
162 MemProfFullSchema(MemProfFullSchema),
163 MemprofGenerateRandomHotness(MemprofGenerateRandomHotness) {
165 RNG.seed(RandomSeed);
172 InfoObj->ValueProfDataEndianness = Endianness;
181 addRecord(Name, Hash, std::move(
I), Weight, Warn);
188 auto Name =
Other.Name;
189 auto Hash =
Other.Hash;
190 Other.accumulateCounts(FuncLevelOverlap.
Test);
191 auto It = FunctionData.find(Name);
192 if (It == FunctionData.end()) {
200 auto &ProfileDataMap = It->second;
201 auto [Where, NewFunc] = ProfileDataMap.try_emplace(Hash);
212 Dest.
overlap(
Other, Overlap, FuncLevelOverlap, ValueCutoff);
218 I.computeBlockUniformity();
220 auto &ProfileDataMap = FunctionData[Name];
222 auto [Where, NewFunc] = ProfileDataMap.try_emplace(Hash);
233 Dest.
scale(Weight, 1, MapWarn);
236 Dest.
merge(
I, Weight, MapWarn);
242void InstrProfWriter::addMemProfRecord(
248 if (MemprofGenerateRandomHotness) {
249 for (
auto &
Alloc : NewRecord.AllocSites) {
252 uint64_t NewTLAD = std::numeric_limits<uint64_t>::max();
254 std::bernoulli_distribution IsCold;
259 NewTL = std::numeric_limits<uint64_t>::max();
261 Alloc.Info.setTotalLifetimeAccessDensity(NewTLAD);
262 Alloc.Info.setTotalLifetime(NewTL);
265 MemProfSumBuilder.addRecord(NewRecord);
266 auto [Iter,
Inserted] = MemProfData.Records.insert({
Id, NewRecord});
271 memprof::IndexedMemProfRecord &Existing = Iter->second;
272 Existing.
merge(NewRecord);
278 auto [Iter,
Inserted] = MemProfData.Frames.insert({
Id, Frame});
283 if (!Inserted && Iter->second != Frame) {
285 "frame to id mapping mismatch"));
291bool InstrProfWriter::addMemProfCallStack(
295 auto [Iter,
Inserted] = MemProfData.CallStacks.insert({CSId, CallStack});
300 if (!Inserted && Iter->second != CallStack) {
302 "call stack to id mapping mismatch"));
319 if (MemProfData.Frames.empty())
320 MemProfData.Frames = std::move(Incoming.
Frames);
322 for (
const auto &[Id,
F] : Incoming.
Frames)
323 if (addMemProfFrame(Id,
F, Warn))
326 if (MemProfData.CallStacks.empty())
327 MemProfData.CallStacks = std::move(Incoming.
CallStacks);
329 for (
const auto &[CSId, CS] : Incoming.
CallStacks)
330 if (addMemProfCallStack(CSId, CS, Warn))
334 if (MemProfData.Records.empty() && !MemprofGenerateRandomHotness) {
338 MemProfSumBuilder.addRecord(
Record);
339 MemProfData.Records = std::move(Incoming.
Records);
342 addMemProfRecord(GUID,
Record);
353 std::unique_ptr<memprof::DataAccessProfData> DataAccessProfDataIn) {
354 DataAccessProfileData = std::move(DataAccessProfDataIn);
359 if (TemporalProfTraces.size() > TemporalProfTraceReservoirSize)
360 TemporalProfTraces.truncate(TemporalProfTraceReservoirSize);
361 for (
auto &
Trace : SrcTraces)
362 if (
Trace.FunctionNameRefs.
size() > MaxTemporalProfTraceLength)
363 Trace.FunctionNameRefs.resize(MaxTemporalProfTraceLength);
364 llvm::erase_if(SrcTraces, [](
auto &
T) {
return T.FunctionNameRefs.empty(); });
368 if (SrcTraces.
empty())
371 auto SrcTraceIt = SrcTraces.
begin();
372 while (TemporalProfTraces.size() < TemporalProfTraceReservoirSize &&
373 SrcTraceIt < SrcTraces.
end())
374 TemporalProfTraces.push_back(*SrcTraceIt++);
377 for (uint64_t
I = TemporalProfTraces.size();
378 I < SrcStreamSize && SrcTraceIt < SrcTraces.
end();
I++) {
379 std::uniform_int_distribution<uint64_t> Distribution(0,
I);
380 uint64_t RandomIndex = Distribution(RNG);
381 if (RandomIndex < TemporalProfTraces.size())
382 TemporalProfTraces[RandomIndex] = *SrcTraceIt++;
384 TemporalProfTraceStreamSize += SrcStreamSize;
389 for (
auto &
I : IPW.FunctionData)
390 for (
auto &Func :
I.getValue())
391 addRecord(
I.getKey(), Func.first, std::move(Func.second), 1, Warn);
393 BinaryIds.reserve(BinaryIds.size() + IPW.BinaryIds.size());
394 for (
auto &
I : IPW.BinaryIds)
398 IPW.TemporalProfTraceStreamSize);
400 MemProfData.Frames.reserve(IPW.MemProfData.Frames.size());
401 for (
auto &[FrameId, Frame] : IPW.MemProfData.Frames) {
404 if (!addMemProfFrame(FrameId, Frame, Warn))
408 MemProfData.CallStacks.reserve(IPW.MemProfData.CallStacks.size());
409 for (
auto &[CSId, CallStack] : IPW.MemProfData.CallStacks) {
410 if (!addMemProfCallStack(CSId, CallStack, Warn))
414 MemProfData.Records.reserve(IPW.MemProfData.Records.size());
415 for (
auto &[GUID,
Record] : IPW.MemProfData.Records) {
416 addMemProfRecord(GUID,
Record);
420bool InstrProfWriter::shouldEncodeData(
const ProfilingData &PD) {
423 for (
const auto &Func : PD) {
446 for (
unsigned I = 0;
I < Res.size();
I++)
451 const bool WritePrevVersion,
454 for (
int I = 0;
I < 4;
I++)
458 auto BackPatchStartOffset = OS.
tell();
465 if (!WritePrevVersion)
468 return BackPatchStartOffset;
483 BinaryIds.erase(
llvm::unique(BinaryIds), BinaryIds.end());
485 for (
const auto &BI : BinaryIds) {
487 BinaryIdsSectionSize +=
sizeof(
uint64_t);
492 OS.
write(BinaryIdsSectionSize);
494 for (
const auto &BI : BinaryIds) {
499 for (
unsigned K = 0;
K < BILen;
K++)
503 for (
unsigned K = 0;
K < PaddingSize;
K++)
511 std::vector<std::string> VTableNameStrs;
512 for (StringRef VTableName : VTableNames.keys())
513 VTableNameStrs.push_back(VTableName.str());
515 std::string CompressedVTableNames;
516 if (!VTableNameStrs.empty())
519 CompressedVTableNames))
522 const uint64_t CompressedStringLen = CompressedVTableNames.length();
525 OS.
write(CompressedStringLen);
528 for (
auto &c : CompressedVTableNames)
535 for (
uint64_t K = CompressedStringLen;
K < PaddedLength;
K++)
542 using namespace IndexedInstrProf;
543 using namespace support;
545 OnDiskChainedHashTableGenerator<InstrProfRecordWriterTrait> Generator;
548 InfoObj->SummaryBuilder = &ISB;
550 InfoObj->CSSummaryBuilder = &CSISB;
551 InfoObj->WritePrevVersion = WritePrevVersion;
555 for (
const auto &
I : FunctionData)
556 if (shouldEncodeData(
I.getValue()))
559 for (
const auto &
I : OrderedData)
560 Generator.insert(
I.first,
I.second);
563 IndexedInstrProf::Header Header;
564 Header.Version = WritePrevVersion
575 if (
static_cast<bool>(ProfileKind &
578 if (
static_cast<bool>(ProfileKind &
590 const uint64_t BackPatchStartOffset =
591 writeHeader(Header, WritePrevVersion, OS);
595 uint32_t SummarySize = Summary::getSize(Summary::NumKinds, NumEntries);
598 for (
unsigned I = 0;
I < SummarySize /
sizeof(
uint64_t);
I++)
603 CSSummaryOffset = OS.
tell();
604 CSSummarySize = SummarySize /
sizeof(
uint64_t);
605 for (
unsigned I = 0;
I < CSSummarySize;
I++)
615 MemProfSectionStart = OS.
tell();
618 OS, MemProfData, MemProfVersionRequested, MemProfFullSchema,
619 std::move(DataAccessProfileData), MemProfSumBuilder.getSummary()))
624 if (
auto E = writeBinaryIds(OS))
629 if (!WritePrevVersion)
630 if (
Error E = writeVTableNames(OS))
633 uint64_t TemporalProfTracesSectionStart = 0;
635 TemporalProfTracesSectionStart = OS.
tell();
636 OS.
write(TemporalProfTraces.size());
637 OS.
write(TemporalProfTraceStreamSize);
638 for (
auto &Trace : TemporalProfTraces) {
639 OS.
write(Trace.Weight);
640 OS.
write(Trace.FunctionNameRefs.size());
641 for (
auto &NameRef : Trace.FunctionNameRefs)
647 std::unique_ptr<IndexedInstrProf::Summary> TheSummary =
651 std::unique_ptr<ProfileSummary> PS = ISB.getSummary();
653 InfoObj->SummaryBuilder =
nullptr;
656 std::unique_ptr<IndexedInstrProf::Summary> TheCSSummary =
nullptr;
659 std::unique_ptr<ProfileSummary> CSPS = CSISB.getSummary();
662 InfoObj->CSSummaryBuilder =
nullptr;
664 SmallVector<uint64_t, 8> HeaderOffsets = {HashTableStart, MemProfSectionStart,
665 BinaryIdSectionStart,
666 TemporalProfTracesSectionStart};
667 if (!WritePrevVersion)
668 HeaderOffsets.
push_back(VTableNamesSectionStart);
670 PatchItem PatchItems[] = {
672 {BackPatchStartOffset, HeaderOffsets},
675 ArrayRef<uint64_t>(
reinterpret_cast<uint64_t *
>(TheSummary.get()),
678 ArrayRef<uint64_t>(
reinterpret_cast<uint64_t *
>(TheCSSummary.get()),
681 OS.
patch(PatchItems);
683 for (
const auto &
I : FunctionData)
684 for (
const auto &
F :
I.getValue())
694 return writeImpl(POS);
699 return writeImpl(POS);
713#define VALUE_PROF_KIND(Enumerator, Value, Descr) #Enumerator,
718 for (
uint32_t VK = 0; VK <= IPVK_Last; VK++) {
719 if (VK == IPVK_IndirectCallTarget || VK == IPVK_VTableTarget)
721 uint32_t NS = Func.getNumValueSites(VK);
724 for (
const auto &V : Func.getValueArrayForSite(VK, S))
725 if (!SeenValues.
insert(V.Value).second)
738 OS <<
"# Func Hash:\n" << Hash <<
"\n";
739 OS <<
"# Num Counters:\n" << Func.Counts.size() <<
"\n";
740 OS <<
"# Counter Values:\n";
741 for (uint64_t
Count : Func.Counts)
744 if (Func.BitmapBytes.size() > 0) {
745 OS <<
"# Num Bitmap Bytes:\n$" << Func.BitmapBytes.size() <<
"\n";
746 OS <<
"# Bitmap Byte Values:\n";
747 for (
uint8_t Byte : Func.BitmapBytes) {
755 uint32_t NumValueKinds = Func.getNumValueKinds();
756 if (!NumValueKinds) {
761 OS <<
"# Num Value Kinds:\n" << Func.getNumValueKinds() <<
"\n";
762 for (
uint32_t VK = 0; VK < IPVK_Last + 1; VK++) {
763 uint32_t NS = Func.getNumValueSites(VK);
767 OS <<
"# NumValueSites:\n" << NS <<
"\n";
769 auto VD = Func.getValueArrayForSite(VK, S);
770 OS << VD.size() <<
"\n";
771 for (
const auto &V : VD) {
772 if (VK == IPVK_IndirectCallTarget || VK == IPVK_VTableTarget)
776 OS << V.Value <<
":" << V.Count <<
"\n";
787 OS <<
"# CSIR level Instrumentation Flag\n:csir\n";
789 OS <<
"# IR level Instrumentation Flag\n:ir\n";
791 if (
static_cast<bool>(ProfileKind &
793 OS <<
"# Always instrument the function entry block\n:entry_first\n";
794 if (
static_cast<bool>(ProfileKind &
796 OS <<
"# Always instrument the loop entry "
797 "blocks\n:instrument_loop_entries\n";
799 OS <<
"# Instrument block coverage\n:single_byte_coverage\n";
803 using RecordType = std::pair<StringRef, FuncPair>;
806 for (
const auto &
I : FunctionData) {
807 if (shouldEncodeData(
I.getValue())) {
810 for (
const auto &Func :
I.getValue())
811 OrderedFuncData.
push_back(std::make_pair(
I.getKey(), Func));
815 for (
const auto &VTableName : VTableNames)
823 return std::tie(
A.first,
A.second.first) <
824 std::tie(
B.first,
B.second.first);
827 for (
const auto &record : OrderedFuncData) {
829 const FuncPair &Func = record.second;
833 for (
const auto &record : OrderedFuncData) {
834 const FuncPair &Func = record.second;
844 OS <<
":temporal_prof_traces\n";
845 OS <<
"# Num Temporal Profile Traces:\n" << TemporalProfTraces.size() <<
"\n";
846 OS <<
"# Temporal Profile Trace Stream Size:\n"
847 << TemporalProfTraceStreamSize <<
"\n";
848 for (
auto &
Trace : TemporalProfTraces) {
849 OS <<
"# Weight:\n" <<
Trace.Weight <<
"\n";
850 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 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)
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 RandomSeed=0)
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.
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.