llvm-project/compiler-rt/lib/profile
Ellis Hoag 11d3074267 [InstrProf] Add single byte coverage mode
Use the llvm flag `-pgo-function-entry-coverage` to create single byte "counters" to track functions coverage. This mode has significantly less size overhead in both code and data because
  * We mark a function as "covered" with a store instead of an increment which generally requires fewer assembly instructions
  * We use a single byte per function rather than 8 bytes per block

The trade off of course is that this mode only tells you if a function has been covered. This is useful, for example, to detect dead code.

When combined with debug info correlation [0] we are able to create an instrumented Clang binary that is only 150M (the vanilla Clang binary is 143M). That is an overhead of 7M (4.9%) compared to the default instrumentation (without value profiling) which has an overhead of 31M (21.7%).

[0] https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116180
2022-01-27 17:38:55 -08:00
..
CMakeLists.txt [compiler-rt] Silence warnings when building with MSVC 2022-01-11 10:36:57 -05:00
GCDAProfiling.c [gcov] Silence warning: comparison of integers of different signs 2021-05-25 18:46:37 -04:00
InstrProfiling.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
InstrProfiling.h [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingBuffer.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
InstrProfilingFile.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingInternal.c Revert "[profile] Add binary id into profiles" 2021-07-21 19:15:18 +00:00
InstrProfilingInternal.h [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingMerge.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
InstrProfilingMergeFile.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingNameVar.c
InstrProfilingPlatformDarwin.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingPlatformFuchsia.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingPlatformLinux.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingPlatformOther.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingPlatformWindows.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
InstrProfilingPort.h [profile] Add __attribute__((used)) to zero size dummy sections 2021-02-17 19:22:25 -08:00
InstrProfilingRuntime.cpp [profile] Make atexit hook a no-op on Fuchsia 2020-03-24 18:47:38 -07:00
InstrProfilingUtil.c [VE] Disable incompatible compiler-rt tests 2021-11-12 08:40:03 +01:00
InstrProfilingUtil.h [Profile][NFC] Clean up initializeProfileForContinuousMode 2021-08-06 14:00:36 -07:00
InstrProfilingValue.c [compiler-rt] NFC: Fix trivial typo 2021-09-04 14:12:58 +05:30
InstrProfilingVersionVar.c [compiler-rt/profile] Reland mark __llvm_profile_raw_version as hidden 2021-11-16 11:37:00 -08:00
InstrProfilingWriter.c [InstrProf] Restore InstrProfData.inc to fix Fuchsia builds 2022-01-19 10:10:58 -08:00
WindowsMMap.c [profile] Decommit memory after counter relocation 2021-07-15 22:49:21 -07:00
WindowsMMap.h [profile] Decommit memory after counter relocation 2021-07-15 22:49:21 -07:00