[all-commits] [llvm/llvm-project] c7f91e: [InstrProfiling] No runtime hook for unused funcs

gulfemsavrun via All-commits all-commits at lists.llvm.org
Fri Mar 25 10:03:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7f91e227a799dfee05962bb108274dbfe809fee
      https://github.com/llvm/llvm-project/commit/c7f91e227a799dfee05962bb108274dbfe809fee
  Author: Gulfem Savrun Yeniceri <gulfem at google.com>
  Date:   2022-03-25 (Fri, 25 Mar 2022)

  Changed paths:
    A clang/test/CoverageMapping/unused_function_no_runtime_hook.cpp
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp

  Log Message:
  -----------
  [InstrProfiling] No runtime hook for unused funcs

CoverageMappingModuleGen generates a coverage mapping record
even for unused functions with internal linkage, e.g.
static int foo() { return 100; }
Clang frontend eliminates such functions, but InstrProfiling pass
still pulls in profile runtime since there is a coverage record.
Fuchsia uses runtime counter relocation, and pulling in profile
runtime for unused functions causes a linker error:
undefined hidden symbol: __llvm_profile_counter_bias.
Since 389dc94d4be7, we do not hook profile runtime for the binaries
that none of its translation units have been instrumented in Fuchsia.
This patch extends that for the instrumented binaries that
consist of only unused functions.

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




More information about the All-commits mailing list