This is an archive of the discontinued LLVM Phabricator instance.

Instrumentation PGO and coverage mapping size reduction
Needs ReviewPublic

Authored by davidxl on Sep 29 2015, 9:47 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

See upstream discussion about this topic:

This is the new solution I am proposing. It is basically an enhancement of Solution-1 with most of the weakness resolved. The difference with Solution-1 is

  1. Function name symbols are emitted into the symbol table as weak externs. They don't occupy any space at runtime and can be easily stripped.
  2. -fcoverage-mapping does not need special handling -- it automatically benefit from the same size saving.
  3. llvm-cov is changed to read symbol info from the symtab instead of reading them from the name section data
  4. llvm-profdata is enhanced to take a binary as input and dump profile with names attached. Function filtering is fully supported (option can also be introduced to force dumping names into binary and profile data, so that llvm-profdata use case is not changed at all).

Pros:

  1. All the pros from Solution-1
  2. Size savings for coverage-mapping case

Cons:

Format change is required for profile data and coverage mapping.

Diff Detail

Event Timeline

davidxl updated this revision to Diff 35985.Sep 29 2015, 9:47 AM
davidxl retitled this revision from to Instrumentation PGO and coverage mapping size reduction.
davidxl updated this object.
davidxl updated this revision to Diff 36120.Sep 30 2015, 9:35 AM

Merge in value profiler changes

davidxl updated this revision to Diff 36191.Sep 30 2015, 11:19 PM

Fix a bug in profile dumping.

lib/ProfileData/CoverageMappingReader.cpp