Files
clang-p2996/llvm/test/tools/llvm-profdata/Inputs/vtable-value-prof.proftext
Mingming Liu 1351d17826 [InstrFDO][TypeProf] Implement binary instrumentation and profile read/write (#66825)
(The profile format change is split into a standalone change into https://github.com/llvm/llvm-project/pull/81691)

* For InstrFDO value profiling, implement instrumentation and lowering for virtual table address.
* This is controlled by `-enable-vtable-value-profiling` and off by default.
* When the option is on, raw profiles will carry serialized `VTableProfData` structs and compressed vtables as payloads.
 
* Implement profile reader and writer support 
  * Raw profile reader is used by `llvm-profdata` but not compiler. Raw profile reader will construct InstrProfSymtab with symbol names, and map profiled runtime address to vtable symbols.
  * Indexed profile reader is used by `llvm-profdata` and compiler. When initialized, the reader stores a pointer to the beginning of in-memory compressed vtable names and the length of string. When used in `llvm-profdata`, reader decompress the string to show symbols of a profiled site. When used in compiler, string decompression doesn't
happen since IR is used to construct InstrProfSymtab.
  * Indexed profile writer collects the list of vtable names, and stores that to index profiles.
  * Text profile reader and writer support are added but mostly follow the implementation for indirect-call value type.
* `llvm-profdata show -show-vtables <args> <profile>` is implemented.

rfc in
https://discourse.llvm.org/t/rfc-dynamic-type-profiling-and-optimizations-in-llvm/74600#pick-instrumentation-points-and-instrument-runtime-types-7
2024-04-01 08:52:35 -07:00

75 lines
1.1 KiB
Plaintext

# IR level Instrumentation Flag
:ir
_Z10createTypei
# Func Hash:
146835647075900052
# Num Counters:
2
# Counter Values:
750
250
_ZN8Derived15func1Eii
# Func Hash:
742261418966908927
# Num Counters:
1
# Counter Values:
250
_ZN8Derived15func2Eii
# Func Hash:
742261418966908927
# Num Counters:
1
# Counter Values:
250
main
# Func Hash:
1124236338992350536
# Num Counters:
2
# Counter Values:
1000
1
# Num Value Kinds:
2
# ValueKind = IPVK_IndirectCallTarget:
0
# NumValueSites:
2
2
vtable_prof.cc;_ZN12_GLOBAL__N_18Derived25func1Eii:750
_ZN8Derived15func1Eii:250
2
vtable_prof.cc;_ZN12_GLOBAL__N_18Derived25func2Eii:750
_ZN8Derived15func2Eii:250
# ValueKind = IPVK_VTableTarget:
2
# NumValueSites:
2
2
vtable_prof.cc;_ZTVN12_GLOBAL__N_18Derived2E:750
_ZTV8Derived1:250
2
vtable_prof.cc;_ZTVN12_GLOBAL__N_18Derived2E:750
_ZTV8Derived1:250
vtable_prof.cc;_ZN12_GLOBAL__N_18Derived25func1Eii
# Func Hash:
742261418966908927
# Num Counters:
1
# Counter Values:
750
vtable_prof.cc;_ZN12_GLOBAL__N_18Derived25func2Eii
# Func Hash:
742261418966908927
# Num Counters:
1
# Counter Values:
750