[all-commits] [llvm/llvm-project] 340cb1: [MemProf] Expand optimization scope to internal li...

lifengxiang1025 via All-commits all-commits at lists.llvm.org
Thu Nov 30 22:20:37 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 340cb19e153bb68981b7eb9562c74a0b2c4db214
      https://github.com/llvm/llvm-project/commit/340cb19e153bb68981b7eb9562c74a0b2c4db214
  Author: lifengxiang1025 <125553151+lifengxiang1025 at users.noreply.github.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
    A llvm/test/Transforms/PGOProfile/Inputs/memprof_internal_linkage.exe
    A llvm/test/Transforms/PGOProfile/Inputs/memprof_internal_linkage.memprofraw
    M llvm/test/Transforms/PGOProfile/Inputs/update_memprof_inputs.sh
    A llvm/test/Transforms/PGOProfile/memprof_internal_linkage.ll

  Log Message:
  -----------
  [MemProf] Expand optimization scope to internal linkage function (#73236)

Now MemProf can't do IR annotation right in the local linkage function
and global initial function __cxx_global_var_init. In llvm-profdata
which convert raw memory profile to memory profile, it uses function
name in dwarf to create GUID. But when llvm consumes memory profile, it
use `getIRPGOFuncName` or `getPGOFuncName` which returns local linkage
function as `FileName;FunctionName` or `FileName:FunctionName` to get
function name and create GUID. So profile creator's GUID is not same as
profile consumer.
So I think MemProf should be used with `unique-internal-linkage-names`
and don't use PGOFuncName.
__cxx_global_var_init is created later than where
UniqueInternalLinkageNames works. So I add uniq suffix to
__cxx_global_var_init additionally.

Co-authored-by: lifengxiang <lifengxiang.1025 at bytedance.com>




More information about the All-commits mailing list