[MemProf] Basic metadata support and verification
Add basic support for the MemProf metadata (!memprof and !callsite) which was initially described in "RFC: IR metadata format for MemProf" (https://discourse.llvm.org/t/rfc-ir-metadata-format-for-memprof/59165). The bulk of the patch is verification support, along with some tests. There are a couple of changes to the format described in the original RFC: Initial measurements suggested that a tree format for the stack ids in the contexts would be more efficient, but subsequent evaluation with large applications showed that in fact the cost of the additional metadata nodes required by this deduplication scheme overwhelmed the benefit from sharing stack id nodes. Therefore, the implementation here and in follow on patches utilizes a simpler scheme of lists of stack id integers in the memprof profile contexts and callsite metadata. The follow on matching patch employs context trimming optimizations to reduce the cost. Secondly, instead of verbosely listing all profiled fields in each profiled context (memory info block or MIB), and deferring the interpretation of the profile data, the profile data is evaluated and converted into string tags specifying the behavior (e.g. "cold") during profile matching. This reduces the verbosity of the profile metadata, and allows additional context trimming optimizations. As a result, the named metadata schema description is also no longer needed. Differential Revision: https://reviews.llvm.org/D128141
Loading
Please sign in to comment