llvm-project/compiler-rt/test/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
..
ContinuousSyncMode Revert "[compiler-rt][Profile] Disable test on Arm/AArch64 Linux" 2021-09-06 08:45:06 +00:00
Darwin [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
Inputs [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
Linux [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
Posix [compiler-rt][profile][AIX] pass extra link opts for test 2022-01-27 15:25:19 -06:00
Windows [InstrProfiling] Delete linkage/visibility toggling for Windows 2021-06-02 16:49:54 -07:00
CMakeLists.txt [CMake][profile] Don't use `TARGET lld` to avoid ordering issues 2021-02-22 23:33:21 -08:00
coverage-inline.cpp
coverage_comments.cpp [test] Fix compiler-rt/test/profile/coverage_emptylines.cpp if the build directory is under /tmp 2020-12-10 16:57:10 -08:00
coverage_emptylines.cpp [test] Fix compiler-rt/test/profile/coverage_emptylines.cpp if the build directory is under /tmp 2020-12-10 16:57:10 -08:00
gcc-flag-compatibility.test
gcov-__gcov_flush-terminate.c
gcov-basic.c
gcov-complex-line.c [llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count cycles 2020-12-10 15:22:29 -08:00
gcov-dump-and-remove.c
infinite_loop.c
instrprof-basic.c
instrprof-bufferio.c
instrprof-coverage.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
instrprof-darwin-dead-strip.c [profile] Specify "-V" to otool to get expected test output 2021-08-31 10:49:51 -07:00
instrprof-darwin-exports.c
instrprof-dump.c
instrprof-error.c
instrprof-gc-sections.c [profile][test] Delete profraw directory so that tests are immune to format version upgrade 2021-06-18 16:44:03 -07:00
instrprof-gcov-exceptions.test
instrprof-gcov-multiple-bbs-single-line.test
instrprof-gcov-multithread_fork.test
instrprof-gcov-one-line-function.test
instrprof-gcov-switch.test
instrprof-gcov-two-objects.test
instrprof-get-filename.c
instrprof-hostname.c
instrprof-icall-promo.test
instrprof-lto-pgogen.c [profile][test] Delete profraw directory so that tests are immune to format version upgrade 2021-06-18 16:44:03 -07:00
instrprof-merge-entry-cover.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
instrprof-merge-match.test
instrprof-merge.c [Profile] Handle invalid profile data 2021-06-10 16:10:13 -07:00
instrprof-merging.cpp
instrprof-order-file.test
instrprof-override-filename-then-reset-default.c
instrprof-override-filename-with-env.c
instrprof-override-filename.c
instrprof-path.c
instrprof-reset-counters.c
instrprof-set-dir-mode.c [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
instrprof-set-file-object-merging.c [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
instrprof-set-file-object.c [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
instrprof-set-filename-then-reset-default.c
instrprof-set-filename.c
instrprof-tmpdir.c
instrprof-value-prof-2.c [PGO] Don't reference functions unless value profiling is enabled 2021-05-20 11:09:24 -07:00
instrprof-value-prof-evict.test
instrprof-value-prof-reset.c
instrprof-value-prof.c [PGO] Don't reference functions unless value profiling is enabled 2021-05-20 11:09:24 -07:00
instrprof-value-prof.test
instrprof-version-mismatch.c
instrprof-without-libc.c [Profile] Handle invalid profile data 2021-06-10 16:10:13 -07:00
instrprof-write-buffer-internal.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
instrprof-write-file-atexit-explicitly.c
instrprof-write-file-only.c
instrprof-write-file.c
lit.cfg.py [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
lit.site.cfg.py.in
profile_test.h
runtime_infinite.c