1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/tools/llvm-cov
Vedant Kumar 1ce7fd2110 Reland: [Coverage] Revise format to reduce binary size
Try again with an up-to-date version of D69471 (99317124 was a stale
revision).

---

Revise the coverage mapping format to reduce binary size by:

1. Naming function records and marking them `linkonce_odr`, and
2. Compressing filenames.

This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB)
and speeds up end-to-end single-threaded report generation by 10%. For
reference the compressed name data in llc is 81MB (__llvm_prf_names).

Rationale for changes to the format:

- With the current format, most coverage function records are discarded.
  E.g., more than 97% of the records in llc are *duplicate* placeholders
  for functions visible-but-not-used in TUs. Placeholders *are* used to
  show under-covered functions, but duplicate placeholders waste space.

- We reached general consensus about giving (1) a try at the 2017 code
  coverage BoF [1]. The thinking was that using `linkonce_odr` to merge
  duplicates is simpler than alternatives like teaching build systems
  about a coverage-aware database/module/etc on the side.

- Revising the format is expensive due to the backwards compatibility
  requirement, so we might as well compress filenames while we're at it.
  This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB).

See CoverageMappingFormat.rst for the details on what exactly has
changed.

Fixes PR34533 [2], hopefully.

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html
[2] https://bugs.llvm.org/show_bug.cgi?id=34533

Differential Revision: https://reviews.llvm.org/D69471
2020-02-28 18:12:04 -08:00
..
Inputs Reland: [Coverage] Revise format to reduce binary size 2020-02-28 18:12:04 -08:00
binary-formats.c Reland: [Coverage] Revise format to reduce binary size 2020-02-28 18:12:04 -08:00
combine_expansions.cpp
copy_block_helper.m
cov-comdat.test
deferred-region.cpp
demangle.test
dir-with-filtering.test
double_dots.c
export_functions-lcov.test
export_functions.test
gcov47_compatibility.cpp
hideUnexecutedSubviews.test
ifdef.c
ignore-filename-regex.test
lit.local.cfg
llvm-cov.test
load-multiple-objects.test
multiple-files.test
multiple-objects-not-all-instrumented.test
multiple-objects.test
multithreaded-report.test
name_whitelist.test
native_separators.c
path_equivalence.c
prefer_used_to_unused.h
prevent_false_instantiations.h
range_based_for.cpp
report.cpp
scan-directory.test
showExpansions.cpp
showHighlightedRanges.cpp
showLineExecutionCounts-lcov.test
showLineExecutionCounts.cpp
showProjectSummary.cpp
showRegionMarkers.cpp
showTabsHTML.cpp
showTemplateInstantiations.cpp
sources-specified.test
style.test
threads.c
universal_bin_wrapping_archives.test
universal-binary.c
warnings.h
zeroFunctionFile.c