[all-commits] [llvm/llvm-project] 18ffb5: [InstrProf] Prevent duplicate functions in correla...

Ellis Hoag via All-commits all-commits at lists.llvm.org
Tue Dec 28 14:21:12 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 18ffb5dc2503c81df53274d6a2e1945ac08c56d2
      https://github.com/llvm/llvm-project/commit/18ffb5dc2503c81df53274d6a2e1945ac08c56d2
  Author: Ellis Hoag <ellis.sparky.hoag at gmail.com>
  Date:   2021-12-28 (Tue, 28 Dec 2021)

  Changed paths:
    M compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c
    A compiler-rt/test/profile/Inputs/instrprof-debug-info-correlate-bar.h
    A compiler-rt/test/profile/Inputs/instrprof-debug-info-correlate-foo.cpp
    A compiler-rt/test/profile/Inputs/instrprof-debug-info-correlate-main.cpp
    M compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c
    M llvm/include/llvm/ProfileData/InstrProfCorrelator.h
    M llvm/lib/ProfileData/InstrProfCorrelator.cpp

  Log Message:
  -----------
  [InstrProf] Prevent duplicate functions in correlated data

When using debug info for profile correlation, avoid adding duplicate
functions in the synthetic Data section.

Before this patch, n duplicate function entries in the Data section would
cause counter values to be a factor of n larger. I built instrumented
clang with and without debug info correlation and got these summaries.

```
# With Debug Info Correlate
$ llvm-profdata show default.profdata
Instrumentation level: IR  entry_first = 0
Total functions: 182530
Maximum function count: 52034
Maximum internal block count: 5763

# Without
$ llvm-profdata show default.profdata
Instrumentation level: IR  entry_first = 0
Total functions: 183212
Maximum function count: 52034
Maximum internal block count: 5766
```

The slight difference in counts seem to be mostly from FileSystem and
Map functions and the difference in the number of instrumented functions
seems to come from missing debug info like destructors without source.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116051




More information about the All-commits mailing list