diff options
| author | Wei Mi <wmi@google.com> | 2019-10-07 16:12:37 +0000 |
|---|---|---|
| committer | Wei Mi <wmi@google.com> | 2019-10-07 16:12:37 +0000 |
| commit | b523790ae1b30a1708d2fc7937f90e283330ef33 (patch) | |
| tree | 04040bba012c6667af39e7c94552238294519309 /llvm/test/tools/llvm-profdata | |
| parent | b743f18b1f4a140b370b865a681bbed5ceaeab11 (diff) | |
| download | bcm5719-llvm-b523790ae1b30a1708d2fc7937f90e283330ef33.tar.gz bcm5719-llvm-b523790ae1b30a1708d2fc7937f90e283330ef33.zip | |
[SampleFDO] Add compression support for any section in ExtBinary profile format
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.
Differential Revision: https://reviews.llvm.org/D68253
llvm-svn: 373914
Diffstat (limited to 'llvm/test/tools/llvm-profdata')
| -rw-r--r-- | llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test | 6 | ||||
| -rw-r--r-- | llvm/test/tools/llvm-profdata/roundtrip-compress.test | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test b/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test new file mode 100644 index 00000000000..66b0543d7a4 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/profile-symbol-list-compress.test @@ -0,0 +1,6 @@ +REQUIRES: zlib +; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections -prof-sym-list=%S/Inputs/profile-symbol-list-1.text %S/Inputs/sample-profile.proftext -o %t.1.output +; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections -prof-sym-list=%S/Inputs/profile-symbol-list-2.text %S/Inputs/sample-profile.proftext -o %t.2.output +; RUN: llvm-profdata merge -sample -extbinary -compress-all-sections %t.1.output %t.2.output -o %t.3.output +; RUN: llvm-profdata show -sample -show-prof-sym-list %t.3.output > %t.4.output +; RUN: diff %S/Inputs/profile-symbol-list.expected %t.4.output diff --git a/llvm/test/tools/llvm-profdata/roundtrip-compress.test b/llvm/test/tools/llvm-profdata/roundtrip-compress.test new file mode 100644 index 00000000000..7e495b6d951 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/roundtrip-compress.test @@ -0,0 +1,10 @@ +REQUIRES: zlib +# Round trip from text --> compressed extbinary --> text +RUN: llvm-profdata merge --sample --extbinary -compress-all-sections -output=%t.1.profdata %S/Inputs/sample-profile.proftext +RUN: llvm-profdata merge --sample --text -output=%t.1.proftext %t.1.profdata +RUN: diff %t.1.proftext %S/Inputs/sample-profile.proftext +# Round trip from text --> binary --> compressed extbinary --> text +RUN: llvm-profdata merge --sample --binary -output=%t.2.profdata %S/Inputs/sample-profile.proftext +RUN: llvm-profdata merge --sample --extbinary -compress-all-sections -output=%t.3.profdata %t.2.profdata +RUN: llvm-profdata merge --sample --text -output=%t.2.proftext %t.3.profdata +RUN: diff %t.2.proftext %S/Inputs/sample-profile.proftext |

