[PATCH] D128141: [MemProf] Basic metadata support and verification

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 10:14:57 PDT 2022


tejohnson created this revision.
tejohnson added reviewers: snehasish, davidxl.
Herald added a subscriber: hiraditya.
Herald added a project: All.
tejohnson requested review of this revision.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128141

Files:
  llvm/include/llvm/IR/FixedMetadataKinds.def
  llvm/lib/IR/Verifier.cpp
  llvm/test/Verifier/memprof-metadata-bad.ll
  llvm/test/Verifier/memprof-metadata-good.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128141.438200.patch
Type: text/x-patch
Size: 6660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220619/a04c41f5/attachment.bin>


More information about the llvm-commits mailing list