[all-commits] [llvm/llvm-project] 40ca41: [llvm-profgen] Switch to DWARF-based symbol and ra...

ictwanglei via All-commits all-commits at lists.llvm.org
Fri Oct 29 10:00:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40ca4112515d03bbcf594bd2dfa6b4394d5b00d6
      https://github.com/llvm/llvm-project/commit/40ca4112515d03bbcf594bd2dfa6b4394d5b00d6
  Author: wlei <wlei at fb.com>
  Date:   2021-10-29 (Fri, 29 Oct 2021)

  Changed paths:
    M llvm/tools/llvm-profgen/CMakeLists.txt
    M llvm/tools/llvm-profgen/ProfileGenerator.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.h

  Log Message:
  -----------
  [llvm-profgen] Switch to DWARF-based symbol and ranges

It happened a bug that some callsite name in the profile is not a real function, it turned out that there're some non-function symbol from the ELF text section, e.g. the global accessible branch label and also recalled that we can have one function being split into multiple ranges. We shouldn't count samples for those are not the entry of the real function.

So this change tried to fix this issue by switching to use the name or ranges from DWARF-based debug info, the range of which assure it's the real function start. For the split functions, we assume that the real entry function's DWARF name should always match the symbol table name.

The switching is also consistent with the body samples' symbol which is from DWARF.

Reviewed By: hoy, wenlei

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


  Commit: 2f8196db9206d9a848ed706d5846196d3fc5db63
      https://github.com/llvm/llvm-project/commit/2f8196db9206d9a848ed706d5846196d3fc5db63
  Author: wlei <wlei at fb.com>
  Date:   2021-10-29 (Fri, 29 Oct 2021)

  Changed paths:
    M llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
    M llvm/test/tools/llvm-profgen/inline-noprobe2.test
    M llvm/tools/llvm-profgen/ProfileGenerator.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.h

  Log Message:
  -----------
  [llvm-profgen] Fix bug of populating profile symbol list

Previous implementation of populating profile symbol list is wrong, it only included the profiled symbols. Actually it should use all symbols, here this switches to use the symbols from debug info. Also turned the flag off by default.

Reviewed By: wenlei, hoy

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


Compare: https://github.com/llvm/llvm-project/compare/aefcd598959a...2f8196db9206


More information about the All-commits mailing list