[all-commits] [llvm/llvm-project] b9f547: [llvm][profile] Add padding after binary IDs

PiJoules via All-commits all-commits at lists.llvm.org
Tue Sep 28 11:51:11 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b9f547e8e51182d32f1912f97a3e53f4899ea6be
      https://github.com/llvm/llvm-project/commit/b9f547e8e51182d32f1912f97a3e53f4899ea6be
  Author: Leonard Chan <leonardchan at google.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
    A compiler-rt/test/profile/Linux/binary-id-padding.c
    M llvm/lib/ProfileData/InstrProfReader.cpp
    A llvm/test/tools/llvm-profdata/binary-ids-padding.test
    A llvm/test/tools/llvm-profdata/insufficient-binary-ids-size.test
    A llvm/test/tools/llvm-profdata/large-binary-id-size.test
    A llvm/test/tools/llvm-profdata/misaligned-binary-ids-size.test

  Log Message:
  -----------
  [llvm][profile] Add padding after binary IDs

Some tests with binary IDs would fail with error: no profile can be merged.
This is because raw profiles could have unaligned headers when emitting binary
IDs. This means padding should be emitted after binary IDs are emitted to
ensure everything else is aligned. This patch adds padding after each binary ID
to ensure the next binary ID size is 8-byte aligned. This also adds extra
checks to ensure we aren't reading corrupted data when printing binary IDs.

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




More information about the All-commits mailing list