This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profdata] Deprecate Compact Binary Sample Profile Format
ClosedPublic

Authored by huangjd on Apr 27 2023, 7:27 PM.

Details

Summary

Remove support for compact binary sample profile format

Diff Detail

Event Timeline

huangjd created this revision.Apr 27 2023, 7:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 7:27 PM
huangjd requested review of this revision.Apr 27 2023, 7:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 7:27 PM
wenlei accepted this revision.Apr 27 2023, 7:31 PM

lgtm, thanks for the cleanup.

This revision is now accepted and ready to land.Apr 27 2023, 7:31 PM
wlei added inline comments.Apr 27 2023, 8:14 PM
llvm/unittests/ProfileData/SampleProfTest.cpp
291–292

Nit: remove the Compact

davidxl added inline comments.Apr 28 2023, 1:26 PM
llvm/include/llvm/ProfileData/SampleProf.h
93

Keep the symbolic value with deprecation comment.

llvm/tools/llvm-profdata/llvm-profdata.cpp
57

The enum should be kept and synced with the definition in SampleProf.h. Just add a deprecation comment.

411–412

For PF_Compact_Binary format, produce a different error message.

huangjd added subscribers: Restricted Project, Restricted Project.Apr 28 2023, 3:05 PM
huangjd updated this revision to Diff 518099.Apr 28 2023, 5:31 PM
  • Added back deprecated enum with comment
davidxl accepted this revision.Apr 28 2023, 9:10 PM

lgtm (perhaps keep one of the compact format file and use it as test case for error message)

This revision was landed with ongoing or failed builds.May 1 2023, 10:10 AM
This revision was automatically updated to reflect the committed changes.

We have been using compbinary format in ChromeOS. Now it fails with the the following error:

llvm-profdata merge: Did you mean '--binary'?

Can you please suggest the fix? The current usages are:

  1. https://source.chromium.org/chromium/chromiumos/overlays/chromiumos-overlay/+/main:eclass/cros-kernel2.eclass;l=2397
  2. https://source.chromium.org/chromium/chromiumos/chromite/+/main:lib/toolchain_util.py;l=1038

The reason for using compbinary is that it uses lower memory.

# Compressed binary profiles are lazily loaded, so they save a
		# meaningful amount of CPU and memory per clang invocation.

We have been using compbinary format in ChromeOS. Now it fails with the the following error:

llvm-profdata merge: Did you mean '--binary'?

Can you please suggest the fix? The current usages are:

  1. https://source.chromium.org/chromium/chromiumos/overlays/chromiumos-overlay/+/main:eclass/cros-kernel2.eclass;l=2397
  2. https://source.chromium.org/chromium/chromiumos/chromite/+/main:lib/toolchain_util.py;l=1038

The reason for using compbinary is that it uses lower memory.

# Compressed binary profiles are lazily loaded, so they save a
		# meaningful amount of CPU and memory per clang invocation.

I suggest switching to extended binary format for now. williamjhuang@'s follow up improvement patches will greatly improve memory and CPU usage for extbinary format (should be better than compact format).

Ideally, the changes to llvm-profdata and use inside clang should have been separate and delayed. Now, we have a case where the older profiles are erroring out when building with ToT clang.

Builders are full or errors like:

Could not open profile: Unrecognized sample profile encoding format

1 error generated.

So, now we are in a scramble to somehow create new profiles :(.

llvm/test/Transforms/SampleProfile/indirect-call.ll