Unverified Commit edf733bc authored by Kazu Hirata's avatar Kazu Hirata Committed by GitHub
Browse files

[memprof] Take Schema into account in PortableMemInfoBlock::serializedSize (#89824)

PortableMemInfoBlock::{serialize,deserialize} take Schema into
account, allowing us to serialize/deserialize a subset of the fields.
However, PortableMemInfoBlock::serializedSize does not.  That is, it
assumes that all fields are always serialized and deserialized.  In
other words, if we choose to serialize/deserialize a subset of the
fields, serializedSize would claim more storage than we actually need.

This patch fixes the problem by teaching serializedSize to take Schema
into account.  For now, this patch has no effect on the actual indexed
MemProf profile because we serialize/deserialize all fields, but that
might change in the future.

Aside from check-llvm, I tested this patch by verifying that
llvm-profdata generates bit-wise identical files for each version for
a large raw MemProf file I have.
parent 4e9decf2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment