21 OS <<
"# MemProfSummary:\n";
22 OS <<
"# Total contexts: " << NumContexts <<
"\n";
23 OS <<
"# Total cold contexts: " << NumColdContexts <<
"\n";
24 OS <<
"# Total hot contexts: " << NumHotContexts <<
"\n";
25 OS <<
"# Maximum cold context total size: " << MaxColdTotalSize <<
"\n";
26 OS <<
"# Maximum warm context total size: " << MaxWarmTotalSize <<
"\n";
27 OS <<
"# Maximum hot context total size: " << MaxHotTotalSize <<
"\n";
28 if (HasDataAccessProfile) {
29 OS <<
"# Num hot symbols and string literals: "
30 << NumHotSymbolsAndStringLiterals <<
"\n";
31 OS <<
"# Num known cold symbols: " << NumKnownColdSymbols <<
"\n";
32 OS <<
"# Num known cold string literals: " << NumKnownColdStringLiterals
41 auto StartPos = OS.
tell();
43 OS.
write(NumContexts);
44 OS.
write(NumColdContexts);
45 OS.
write(NumHotContexts);
46 OS.
write(MaxColdTotalSize);
47 OS.
write(MaxWarmTotalSize);
48 OS.
write(MaxHotTotalSize);
53std::unique_ptr<MemProfSummary>
55 auto NumSummaryFields =
68 auto MemProfSum = std::make_unique<MemProfSummary>(
78 Ptr += NumSummaryFields *
sizeof(
uint64_t);
88 HasDataAccessProfile =
true;
89 NumHotSymbolsAndStringLiterals = DataAccessProfile.
getRecords().size();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
size_t size() const
size - Get the array size.
LLVM_ABI uint64_t tell() const
LLVM_ABI void write32(uint32_t V)
LLVM_ABI void write(uint64_t V)
Encapsulates the data access profile data and the methods to operate on it.
ArrayRef< MapVector< SymbolHandleRef, internal::DataAccessProfRecordRef >::value_type > getRecords() const
ArrayRef< StringRef > getKnownColdSymbols() const
ArrayRef< uint64_t > getKnownColdHashes() const
LLVM_ABI void printSummaryYaml(raw_ostream &OS) const
LLVM_ABI void buildDataAccessSummary(const DataAccessProfData &DataAccessProfile)
Build data access profile summary from DataAccessProfile.
LLVM_ABI void write(ProfOStream &OS) const
Write to indexed MemProf profile.
static LLVM_ABI std::unique_ptr< MemProfSummary > deserialize(const unsigned char *&)
Read from indexed MemProf profile.
static constexpr unsigned getNumSummaryFields()
This class implements an extremely fast bulk output stream that can only output to a stream.
value_type read(const void *memory, endianness endian)
Read a value of a particular endianness from memory.
value_type readNext(const CharT *&memory, endianness endian)
Read a value of a particular endianness from a buffer, and increment the buffer past that value.
This is an optimization pass for GlobalISel generic memory operations.