[all-commits] [llvm/llvm-project] b1a45c: [llvm-profgen] Ignore branch count against outline...

ictwanglei via All-commits all-commits at lists.llvm.org
Thu Oct 7 14:04:12 PDT 2021


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

  Changed paths:
    A llvm/test/tools/llvm-profgen/Inputs/coroutine.perfbin
    A llvm/test/tools/llvm-profgen/Inputs/coroutine.perfscript
    A llvm/test/tools/llvm-profgen/Inputs/func-split.perfbin
    A llvm/test/tools/llvm-profgen/Inputs/func-split.perfscript
    A llvm/test/tools/llvm-profgen/coroutine.test
    A llvm/test/tools/llvm-profgen/func-split.test
    M llvm/tools/llvm-profgen/ProfileGenerator.cpp
    M llvm/tools/llvm-profgen/ProfileGenerator.h

  Log Message:
  -----------
  [llvm-profgen] Ignore branch count against outline function

For some transformations like hot-cold split or coro split, it can outline its part of function ranges. Since sample loader is the early stage of backend and no split happens at that time, compiler can't recognize those function, so in llvm-profgen we should attribute the sample to the original function. This is already done for the body range samples since we use the symbols from dwarf which is created before the split.

But for branch samples, the call from master function to its outlined function is actually not a call to the original function, we shouldn't add head/callsie samples for it. So instead of dwarf symbol, we use the symbols from symbol table and ignore those functions with special suffixes(like `.cold` ,`.resume`) for accumulating the callsite/head samples.

Reviewed By: hoy, wenlei

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




More information about the All-commits mailing list