[all-commits] [llvm/llvm-project] 0174f5: [MemProf] Basic metadata support and verification

Teresa Johnson via All-commits all-commits at lists.llvm.org
Wed Jul 20 15:31:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0174f5553e9ceba19828b097161c02771cd2d8da
      https://github.com/llvm/llvm-project/commit/0174f5553e9ceba19828b097161c02771cd2d8da
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2022-07-20 (Wed, 20 Jul 2022)

  Changed paths:
    M llvm/include/llvm/IR/FixedMetadataKinds.def
    M llvm/lib/IR/Verifier.cpp
    A llvm/test/Verifier/memprof-metadata-bad.ll
    A llvm/test/Verifier/memprof-metadata-good.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list