[all-commits] [llvm/llvm-project] 467652: [llvm-profgen] Fix inconsistent loading address is...

ictwanglei via All-commits all-commits at lists.llvm.org
Thu Oct 13 23:25:12 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 467652486f24b9f33eca7b4aaa6cb1e8ec6d18a7
  Author: wlei <wlei at fb.com>
  Date:   2022-10-13 (Thu, 13 Oct 2022)

  Changed paths:
    M llvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.perfscript
    M llvm/test/tools/llvm-profgen/inline-noprobe2.test
    M llvm/test/tools/llvm-profgen/invalid-range.test
    M llvm/test/tools/llvm-profgen/pseudoprobe-decoding.test
    M llvm/tools/llvm-profgen/PerfReader.cpp
    M llvm/tools/llvm-profgen/ProfileGenerator.cpp
    M llvm/tools/llvm-profgen/ProfileGenerator.h
    M llvm/tools/llvm-profgen/ProfiledBinary.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.h

  Log Message:
  [llvm-profgen] Fix inconsistent loading address issues

This is to fix two issues related with loading address:

1) When multiple MMAPs occur and their loading address are different, before it only used the first MMap as base address, all perf address after it used the wrong base address.

2) For pseudo probe profile, the address is always based on preferred loading address. If the base address is not equal to the preferred loading address, the pseudo probe address query will be wrong.

Solution: Instead of converting the address to offset lazily, right now all the address after parsing are converted on the fly based on preferred loading address in the parsing time. There is no "offset" used in profile generator any more.

Reviewed By: hoy, wenlei

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

More information about the All-commits mailing list