[all-commits] [llvm/llvm-project] dcadd6: [profile] Fix profile merging with binary IDs

Petr Hosek via All-commits all-commits at lists.llvm.org
Fri Jul 30 17:39:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcadd64986b8a84dc244d4e7faa848fb4c18cea6
      https://github.com/llvm/llvm-project/commit/dcadd64986b8a84dc244d4e7faa848fb4c18cea6
  Author: Petr Hosek <phosek at google.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M compiler-rt/include/profile/InstrProfData.inc
    M compiler-rt/lib/profile/InstrProfilingBuffer.c
    M compiler-rt/lib/profile/InstrProfilingMerge.c
    M compiler-rt/test/profile/Linux/binary-id.c
    M llvm/include/llvm/ProfileData/InstrProf.h
    M llvm/include/llvm/ProfileData/InstrProfData.inc
    M llvm/lib/ProfileData/InstrProfReader.cpp
    M llvm/test/tools/llvm-profdata/Inputs/c-general.profraw
    M llvm/test/tools/llvm-profdata/malformed-ptr-to-counter-array.test
    M llvm/test/tools/llvm-profdata/raw-32-bits-be.test
    M llvm/test/tools/llvm-profdata/raw-32-bits-le.test
    M llvm/test/tools/llvm-profdata/raw-64-bits-be.test
    M llvm/test/tools/llvm-profdata/raw-64-bits-le.test
    M llvm/test/tools/llvm-profdata/raw-two-profiles.test

  Log Message:
  -----------
  [profile] Fix profile merging with binary IDs

This fixes support for merging profiles which broke as a consequence
of e50a38840dc3db5813f74b1cd2e10e6d984d0e67. The issue was missing
adjustment in merge logic to account for the binary IDs which are
now included in the raw profile just after header.

In addition, this change also:
* Includes the version in module signature that's used for merging
to avoid accidental attempts to merge incompatible profiles.
* Moves the binary IDs size field after version field in the header
as was suggested in the review.

Differential Revision: https://reviews.llvm.org/D107143




More information about the All-commits mailing list