[all-commits] [llvm/llvm-project] ec5b72: [memprof] Upgrade a unit test to MemProf Version 3...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Wed Nov 20 14:03:49 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec5b729e651c48dfff67487e6bb24c218c35cda9
      https://github.com/llvm/llvm-project/commit/ec5b729e651c48dfff67487e6bb24c218c35cda9
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-11-20 (Wed, 20 Nov 2024)

  Changed paths:
    M llvm/unittests/ProfileData/InstrProfTest.cpp

  Log Message:
  -----------
  [memprof] Upgrade a unit test to MemProf Version 3 (#117063)

This patch upgrades a unit test to MemProf Version 3 while removing
those bits that cannot be upgraded to Version 3.

The bits being removed expect instrprof_error::hash_mismatch from a
broken MemProf profile that references a frame that doesn't actually
exist.  Now, Version 3 no longer issues
instrprof_error::hash_mismatch.  Even if it still issued
instrprof_error::hash_mismatch, we would have a couple of hurdles:

- InstrProfWriter::addMemProfData will soon require all (or none) of
  the fields (frames, call stacks, and records) be populated.  That
  is, it won't accept an instance of IndexedMemProfData with frames
  missing.

- writeMemProfV3 asserts that every frame occurs at least once:

  assert(MemProfData.Frames.size() == FrameHistogram.size());

This patch gives up on instrprof_error::hash_mismatch and tries to
trigger instrprof_error::unknown_function with the empty profile.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list