This is an archive of the discontinued LLVM Phabricator instance.

[SampleFDO] Add compression support for any section in ExtBinary profile format
ClosedPublic

Authored by wmi on Sep 30 2019, 4:14 PM.

Details

Summary

Previously ExtBinary profile format only supports compression using zlib for profile symbol list. In this patch, we extend the compression support to any section. User can select some or all of the sections to compress. In an experiment, for a 45M profile in ExtBinary format, compressing name table reduced its size to 24M, and compressing all the sections reduced its size to 11M.

Diff Detail

Event Timeline

wmi created this revision.Sep 30 2019, 4:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2019, 4:14 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
davidxl added inline comments.Oct 3 2019, 11:11 AM
llvm/include/llvm/ProfileData/SampleProf.h
148

Flag->Flags?

155

may be name it 'addSecFlags' ? 'setSecFlags' implies Entry.Flag = Flags;

159

clearSecFlags or removeSecFlags?

llvm/include/llvm/ProfileData/SampleProfWriter.h
174

hold->held

178

held

llvm/tools/llvm-profdata/llvm-profdata.cpp
652

Should this imply compressProfSymlist when true? Or under what condition do we want to compressAllSections but not profsymList? If such case does not exist, we should remove compress symlist option.

wmi marked 6 inline comments as done.Oct 4 2019, 4:06 PM
wmi added inline comments.
llvm/include/llvm/ProfileData/SampleProf.h
148

Fixed.

155

Fixed.

159

Used removeSecFlags.

llvm/include/llvm/ProfileData/SampleProfWriter.h
174

Fixed.

178

Fixed.

llvm/tools/llvm-profdata/llvm-profdata.cpp
652

I removed compress symlist option.

wmi updated this revision to Diff 223334.Oct 4 2019, 4:08 PM

Address David's comment.

llvmprof command documentation also needs to be updated.

llvm/tools/llvm-profdata/llvm-profdata.cpp
456

'-compress-all-section is ignored. Specify -extbinary to enable it'

wmi marked an inline comment as done.Oct 4 2019, 5:14 PM
wmi added inline comments.
llvm/tools/llvm-profdata/llvm-profdata.cpp
456

Fixed.

wmi updated this revision to Diff 223343.Oct 4 2019, 5:16 PM

Address David's comment

davidxl accepted this revision.Oct 4 2019, 7:48 PM

lgtm

This revision is now accepted and ready to land.Oct 4 2019, 7:48 PM
This revision was automatically updated to reflect the committed changes.