1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Instrumentation/InstrProfiling
Fangrui Song 76489f90a5 [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat
`__profd_*` variables are referenced by code only when value profiling is
enabled. If disabled (e.g. default -fprofile-instr-generate), the symbols just
waste space on ELF/Mach-O. We change the comdat symbol from `__profd_*` to
`__profc_*` because an internal symbol does not provide deduplication features
on COFF. The choice doesn't matter on ELF.

(In -DLLVM_BUILD_INSTRUMENTED_COVERAGE=on build, there is now no `__profd_*` symbols.)

On Windows this enables further optimization. We are no longer affected by the
link.exe limitation: an external symbol in IMAGE_COMDAT_SELECT_ASSOCIATIVE can
cause duplicate definition error.
https://lists.llvm.org/pipermail/llvm-dev/2021-May/150758.html
We can thus use llvm.compiler.used instead of llvm.used like ELF (D97585).
This avoids many `/INCLUDE:` directives in `.drectve`.

Here is rnk's measurement for Chrome:
```
This reduced object file size of base_unittests.exe, compiled with coverage, optimizations, and gmlt debug info by 10%:

#BEFORE

$ find . -iname '*.obj' | xargs du -b | awk '{ sum += $1 } END { print sum}'
1047758867

$ du -cksh base_unittests.exe
82M     base_unittests.exe
82M     total

# AFTER

$ find . -iname '*.obj' | xargs du -b | awk '{ sum += $1 } END { print sum}'
937886499

$ du -cksh base_unittests.exe
78M     base_unittests.exe
78M     total
```

The change is NFC for Mach-O.

Reviewed By: davidxl, rnk

Differential Revision: https://reviews.llvm.org/D103372
2021-06-04 13:27:56 -07:00
..
X86
always_inline.ll [InstrProfiling][test] Fix stale tests 2021-05-28 21:14:03 -07:00
atomic-updates.ll [InstrProfiling][test] Fix stale tests 2021-05-28 21:14:03 -07:00
comdat.ll [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat 2021-06-04 13:27:56 -07:00
early-exit.ll [InstrProfiling][test] Fix stale tests 2021-05-28 21:14:03 -07:00
icall.ll [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat 2021-06-04 13:27:56 -07:00
linkage.ll [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat 2021-06-04 13:27:56 -07:00
no-counters.ll
noruntime.ll [InstrProfiling][test] Fix stale tests 2021-05-28 21:14:03 -07:00
platform.ll [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat 2021-06-04 13:27:56 -07:00
profiling.ll [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat 2021-06-04 13:27:56 -07:00
runtime-counter-relocation.ll [InstrProfiling][test] Fix stale tests 2021-05-28 21:14:03 -07:00