[all-commits] [llvm/llvm-project] ad1b9d: Prepend "__uniq" to symbol names hash with -funiqu...

Sriraman Tallam via All-commits all-commits at lists.llvm.org
Mon Oct 26 14:24:49 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ad1b9daa4bf40c1907794fd5de7807aad1f0553c
      https://github.com/llvm/llvm-project/commit/ad1b9daa4bf40c1907794fd5de7807aad1f0553c
  Author: Sriraman Tallam <tmsriram at google.com>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M clang/test/CodeGen/unique-internal-linkage-names.cpp
    M llvm/lib/Transforms/Utils/UniqueInternalLinkageNames.cpp
    M llvm/test/Transforms/UniqueInternalLinkageNames/unique_symbol_names.ll

  Log Message:
  -----------
  Prepend "__uniq" to symbol names hash with -funique-internal-linkage-names.

Prepend the module name hash with a fixed string ".__uniq." which helps tools
that consume sampled profiles and attribute it to functions to understand
that this symbol belongs to a unique internal linkage type symbol.

Symbols with suffixes can result from various optimizations in the compiler.
Function Multiversioning, function splitting, parameter constant propogation,
unique internal linkage names.

External tools like sampled profile aggregators combine profiles from multiple
runs of a binary. They use various heuristics with symbols that have suffixes
to try and attribute the profile to the right function instance. For instance
multi-versioned symbols like foo.avx, foo.sse4.2, etc even though different
should be attributed to the same source function if a single function is
versioned, using attribute target_clones (supported in GCC but yet to land in
LLVM). Similarly, functions that are split (split part having a .cold suffix)
could have profiles for both the original and split symbols but would be
aggregated and attributed to the original function that was split.

Unique internal linkage functions however have different source instances and
the aggregator must not put them together but attribute it to the appropriate
function instance. To be sure that we are dealing with a symbol of a unique
internal linkage function, we would like to prepend the hash with a known
string ".__uniq." which these tools can check to understand the suffix type.

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




More information about the All-commits mailing list