[memprof] Align each rawprofile section to 8b.
authorSnehasish Kumar <snehasishk@google.com>
Tue, 30 Nov 2021 23:56:17 +0000 (15:56 -0800)
committerSnehasish Kumar <snehasishk@google.com>
Wed, 1 Dec 2021 04:12:43 +0000 (20:12 -0800)
commit3a4d373ec2ba676dc91fba06631a776785f8a6eb
tree2a5fa74ca00f351ef2d776ed8ccabb6e37b8594b
parent92a8dc0735cfb3f296f0c487b20d8fa8474e3e40
[memprof] Align each rawprofile section to 8b.

The first 8b of each raw profile section need to be aligned to 8b since
the first item in each section is a u64 count of the number of items in
the section.
Summary of changes:
* Assert alignment when reading counts.
* Update test to check alignment, relax some size checks to allow padding.
* Update raw binary inputs for llvm-profdata tests.

Differential Revision: https://reviews.llvm.org/D114826
compiler-rt/lib/memprof/memprof_rawprofile.cpp
compiler-rt/lib/memprof/tests/rawprofile.cpp
llvm/lib/ProfileData/RawMemProfReader.cpp
llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw
llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw
llvm/test/tools/llvm-profdata/memprof-basic.test