13 using namespace support;
20 for (
const FrameId &Id :
N.CallStack)
22 N.Info.serialize(Schema,
OS);
29 for (
const FrameId &Id : Frames)
36 const unsigned char *
Ptr) {
37 using namespace support;
42 const uint64_t NumNodes = endian::readNext<uint64_t, little, unaligned>(
Ptr);
46 endian::readNext<uint64_t, little, unaligned>(
Ptr);
47 for (
uint64_t J = 0; J < NumFrames; J++) {
48 const FrameId Id = endian::readNext<FrameId, little, unaligned>(
Ptr);
49 Node.CallStack.push_back(Id);
51 Node.Info.deserialize(Schema,
Ptr);
57 const uint64_t NumCtxs = endian::readNext<uint64_t, little, unaligned>(
Ptr);
58 for (
uint64_t J = 0; J < NumCtxs; J++) {
60 endian::readNext<uint64_t, little, unaligned>(
Ptr);
63 for (
uint64_t K = 0; K < NumFrames; K++) {
64 const FrameId Id = endian::readNext<FrameId, little, unaligned>(
Ptr);
67 Record.CallSites.push_back(Frames);
74 const auto Pos = FunctionName.
find(
".llvm.");
85 using namespace support;
87 const unsigned char *
Ptr = Buffer;
89 endian::readNext<uint64_t, little, unaligned>(
Ptr);
92 "memprof schema invalid");
96 for (
size_t I = 0;
I < NumSchemaIds;
I++) {
97 const uint64_t Tag = endian::readNext<uint64_t, little, unaligned>(
Ptr);
100 "memprof schema invalid");
102 Result.push_back(
static_cast<Meta>(
Tag));
This file defines the SmallVector class.
Tagged union holding either a T or a Error.
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
void reserve(size_type N)
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
This class implements an extremely fast bulk output stream that can only output to a stream.
Expected< MemProfSchema > readMemProfSchema(const unsigned char *&Buffer)
This is an optimization pass for GlobalISel generic memory operations.
llvm::SmallVector< IndexedAllocationInfo > AllocSites
void serialize(const MemProfSchema &Schema, raw_ostream &OS)
llvm::SmallVector< llvm::SmallVector< FrameId > > CallSites
static GlobalValue::GUID getGUID(const StringRef FunctionName)
static IndexedMemProfRecord deserialize(const MemProfSchema &Schema, const unsigned char *Buffer)
static constexpr size_t serializedSize()
Adapter to write values to a stream in a particular byte order.