[MemProf] Add memprof metadata related analysis utilities
authorTeresa Johnson <tejohnson@google.com>
Wed, 29 Jun 2022 20:25:58 +0000 (13:25 -0700)
committerTeresa Johnson <tejohnson@google.com>
Thu, 21 Jul 2022 20:46:01 +0000 (13:46 -0700)
commit1dad6247d275c5787cbc3131174d9c4aa543e653
treecbaa365a682bc859af49f7c8e922042242087fb3
parent3132e9cd7c9fda63f7c0babf8bd5f6d755ce9027
[MemProf] Add memprof metadata related analysis utilities

Adds a number of utilities that are used to help create and update
memprof related metadata. These will be used during profile matching
and annotation, as well as by the inliner when updating the metadata.
Also adds unit tests for the utilities.

See also related RFCs:
RFC: Sanitizer-based Heap Profiler [1]
RFC: A binary serialization format for MemProf [2]
RFC: IR metadata format for MemProf [3]
(Note that the IR metadata format has changed from the RFC during
implementation, as described in the preceeding patch adding the basic
metadata and verification support.)

Depends on D128141.

Differential Revision: https://reviews.llvm.org/D128854
llvm/include/llvm/Analysis/MemoryProfileInfo.h [new file with mode: 0644]
llvm/lib/Analysis/CMakeLists.txt
llvm/lib/Analysis/MemoryProfileInfo.cpp [new file with mode: 0644]
llvm/unittests/Analysis/CMakeLists.txt
llvm/unittests/Analysis/MemoryProfileInfoTest.cpp [new file with mode: 0644]