[PATCH] D93082: Prepend "__bb" to all basic block section symbols.

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 19:01:40 PST 2020


tmsriram created this revision.
tmsriram added reviewers: mtrofin, shenhan, rahmanl.
Herald added subscribers: pengfei, steven_wu, hiraditya, emaste.
Herald added a reviewer: espindola.
tmsriram requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Every basic block section symbol created by -fbasic-block-sections will contain ".__bb." to know that this symbol corresponds to a basic block fragment of the function.

This patch solves two problems:

a) Like D89617 <https://reviews.llvm.org/D89617>, we want function symbols with suffixes to be properly qualified so that external tools like profile aggregators know exactly what this symbol corresponds to.
b) The current basic block naming just adds a ".N" to the symbol name where N is some integer.  This collides with how clang creates __cxx_global_var_init.N.  clang creates these symbol names to call constructor functions and basic block symbol naming should not use the same style.

I have fixed all the test cases and added an extra test for __cxx_global_var_init breakage.


https://reviews.llvm.org/D93082

Files:
  clang/test/CodeGen/basic-block-sections.c
  lld/test/ELF/lto/basic-block-sections.ll
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/test/CodeGen/X86/basic-block-sections-blockaddress-taken.ll
  llvm/test/CodeGen/X86/basic-block-sections-clusters-branches.ll
  llvm/test/CodeGen/X86/basic-block-sections-clusters-eh.ll
  llvm/test/CodeGen/X86/basic-block-sections-clusters.ll
  llvm/test/CodeGen/X86/basic-block-sections-directjumps.ll
  llvm/test/CodeGen/X86/basic-block-sections-eh.ll
  llvm/test/CodeGen/X86/basic-block-sections-list.ll
  llvm/test/CodeGen/X86/basic-block-sections-listbb.ll
  llvm/test/CodeGen/X86/basic-block-sections-mir-parse.mir
  llvm/test/CodeGen/X86/basic-block-sections-unreachable.ll
  llvm/test/CodeGen/X86/basic-block-sections.ll
  llvm/test/CodeGen/X86/basic-block-sections_2.ll
  llvm/test/CodeGen/X86/cfi-basic-block-sections-1.ll
  llvm/test/CodeGen/X86/cfi-inserter-basic-block-sections-callee-save-registers.ll
  llvm/test/CodeGen/X86/gcc_except_table_bb_sections.ll
  llvm/test/DebugInfo/X86/basic-block-sections_1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93082.311088.patch
Type: text/x-patch
Size: 23753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201211/8a504011/attachment.bin>


More information about the llvm-commits mailing list