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] Add __gcov_dump/__gcov_reset and delete __gcov_flush 2020-07-18 15:07:46 -07:00
gcov-basic.c [llvm-cov gcov] Improve accuracy when some edges are not measured 2020-09-12 22:33:41 -07:00
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 [gcov] Add spanning tree optimization 2020-09-13 00:07:31 -07:00
infinite_loop.c
instrprof-basic.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
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 Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
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 Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
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 Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-override-filename-with-env.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-override-filename.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-path.c
instrprof-reset-counters.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
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 Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-set-filename.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-tmpdir.c [profile] Add %t LLVM_PROFILE_FILE option to substitute $TMPDIR 2020-09-25 09:39:40 -07:00
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 [profile] Enabled test on windows 2020-07-17 00:05:46 -07:00
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 Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-write-file-only.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-write-file.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
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