LLVM: lib/ProfileData/MemProfSummary.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
14
15using namespace llvm;
17
19
20 OS << "---\n";
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}
29
31
32
34 auto StartPos = OS.tell();
35 (void)StartPos;
36 OS.write(NumContexts);
37 OS.write(NumColdContexts);
38 OS.write(NumHotContexts);
39 OS.write(MaxColdTotalSize);
40 OS.write(MaxWarmTotalSize);
41 OS.write(MaxHotTotalSize);
42
44}
45
46std::unique_ptr
48 auto NumSummaryFields =
50
51
52
53
54
55
56
57
58
60
61 auto MemProfSum = std::make_unique(
68
69
70
71 Ptr += NumSummaryFields * sizeof(uint64_t);
72
73 return MemProfSum;
74}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
LLVM_ABI uint64_t tell() const
LLVM_ABI void write32(uint32_t V)
LLVM_ABI void write(uint64_t V)
LLVM_ABI void printSummaryYaml(raw_ostream &OS) const
Definition MemProfSummary.cpp:18
LLVM_ABI void write(ProfOStream &OS) const
Write to indexed MemProf profile.
Definition MemProfSummary.cpp:30
static LLVM_ABI std::unique_ptr< MemProfSummary > deserialize(const unsigned char *&)
Read from indexed MemProf profile.
Definition MemProfSummary.cpp:47
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.