llvm-mirror/test/Instrumentation
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
..
AddressSanitizer [Local] Do not move around dbg.declares during replaceDbgDeclare 2020-02-13 14:35:02 -08:00
BoundsChecking Revert "[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS" 2019-07-07 22:12:01 +00:00
DataFlowSanitizer Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
HWAddressSanitizer hwasan: Move .note.hwasan.globals note to hwasan.module_ctor comdat. 2020-01-17 13:40:52 -08:00
InstrOrderFile Add a module pass for order file instrumentation 2019-02-28 20:13:38 +00:00
InstrProfiling Reland: [Coverage] Revise format to reduce binary size 2020-02-28 18:12:04 -08:00
MemorySanitizer Reapply [IRBuilder] Always respect inserter/folder 2020-02-19 20:51:38 +01:00
PoisonChecking [PoisonCheker] Support for out of bounds operands on shifts + insert/extractelement 2019-07-09 19:26:12 +00:00
SanitizerCoverage Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
ThreadSanitizer Insert module constructors in a module pass 2019-10-11 08:47:03 +00:00
cgprofile.ll [BFI] Use rounding while computing profile counts. 2018-08-16 00:26:59 +00:00