[all-commits] [llvm/llvm-project] c8ac29: Descriptive symbol names for machine basic block s...

Snehasish Kumar via All-commits all-commits at lists.llvm.org
Mon May 4 12:12:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c8ac29ab1d798f16999541cd9f08d58ebaa1b4c1
      https://github.com/llvm/llvm-project/commit/c8ac29ab1d798f16999541cd9f08d58ebaa1b4c1
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2020-05-04 (Mon, 04 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/MachineBasicBlock.cpp
    M llvm/test/CodeGen/X86/basicblock-sections-clusters-branches.ll
    M llvm/test/CodeGen/X86/basicblock-sections-clusters-eh.ll
    M llvm/test/CodeGen/X86/basicblock-sections-clusters.ll
    M llvm/test/CodeGen/X86/basicblock-sections-cold.ll
    M llvm/test/CodeGen/X86/basicblock-sections-directjumps.ll
    M llvm/test/CodeGen/X86/basicblock-sections-eh.ll
    M llvm/test/CodeGen/X86/basicblock-sections-list.ll
    M llvm/test/CodeGen/X86/basicblock-sections-listbb.ll
    M llvm/test/CodeGen/X86/basicblock-sections-mir-parse.mir
    M llvm/test/CodeGen/X86/basicblock-sections.ll

  Log Message:
  -----------
  Descriptive symbol names for machine basic block sections.

Today symbol names generated for machine basic block sections use a
unary encoding to reduce bloat. This is essential when every basic block
in the binary is assigned a symbol however with basic block clusters
(rG05192e585ce175b55f2a26b83b4ed7882785c8e6) when we only need to
generate a few non-temporary symbols we can assign more descriptive
names making them more user friendly. With this change -

Cold cluster section for function foo is named "foo.cold"
Exception cluster section for function foo is named "foo.eh"
Other cluster sections identified by their ids are named "foo.ID"
Using this format works well with existing tools. It will demangle as
expected and works with existing symbolizers, profilers and debuggers
out of the box.

$ c++filt _Z3foov.cold
foo() [clone .cold]

$ c++filt _Z3foov.eh
foo() [clone .eh]

$c++filt _Z3foov.1234
foo() [clone 1234]

Tests for basicblock-sections are updated with some cleanup where
appropriate.

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




More information about the All-commits mailing list