[all-commits] [llvm/llvm-project] 1351d1: [InstrFDO][TypeProf] Implement binary instrumentat...

Mingming Liu via All-commits all-commits at lists.llvm.org
Mon Apr 1 08:52:57 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1351d17826e1efa3da3b29b6e345d44cb0ce3bc9
      https://github.com/llvm/llvm-project/commit/1351d17826e1efa3da3b29b6e345d44cb0ce3bc9
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2024-04-01 (Mon, 01 Apr 2024)

  Changed paths:
    A compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp
    M llvm/include/llvm/Analysis/IndirectCallVisitor.h
    M llvm/include/llvm/ProfileData/InstrProf.h
    M llvm/include/llvm/ProfileData/InstrProfReader.h
    M llvm/include/llvm/ProfileData/InstrProfWriter.h
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/ProfileData/InstrProfReader.cpp
    M llvm/lib/ProfileData/InstrProfWriter.cpp
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    M llvm/lib/Transforms/Instrumentation/ValueProfilePlugins.inc
    A llvm/test/Transforms/PGOProfile/vtable_prof_unsupported.ll
    A llvm/test/Transforms/PGOProfile/vtable_profile.ll
    A llvm/test/tools/llvm-profdata/Inputs/vtable-value-prof.proftext
    A llvm/test/tools/llvm-profdata/vtable-value-prof.test
    M llvm/tools/llvm-profdata/llvm-profdata.cpp
    M llvm/unittests/ProfileData/InstrProfTest.cpp

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list