[PATCH] D73674: Propeller: LLVM support for basic block sections (Base Patch - Part 2)

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 16:59:09 PST 2020


tmsriram created this revision.
tmsriram added reviewers: mehdi_amini, davidxl.
Herald added subscribers: tschuett, hiraditya.
Herald added a project: LLVM.
tmsriram added a parent revision: D68063: Propeller: LLVM support for basic block sections.

This is part 2 of the base patch for LLVM Support of basic block sections.  Part 1 is here: https://reviews.llvm.org/D68063

- This patch supports creating sections for all basic blocks or a subset of basic blocks.  The subset of basic blocks via a clang option -fbasicblock-sections=<list_file>  which contains a list of functions and the basic block ids for which sections are desired.

Please see https://github.com/google/llvm-propeller/blob/plo-dev/Propeller_RFC.pdf for a detailed discussion on basic block sections.

Labeling Basic Blocks :

Every basic block is labelled with a unique symbol as this allows easy mapping of virtual addresses from PMU profiles back to the corresponding basic blocks. Since the number of basic blocks is large, the labeling bloats the symbol table sizes and the string table sizes significantly. While the binary size does increase this does not affect performance as the symbol table is not loaded in memory during run-timea, the string table size bloat is kept very minimal using a unary naming scheme that uses string suffix compression. The basic blocks for function foo are named "a.bb.foo", "aa.bb.foo", . . . This turns out to be very good for string table sizes and the bloat in the string table size for a very large binary is only 8 %.


https://reviews.llvm.org/D73674

Files:
  llvm/include/llvm/CodeGen/MachineBasicBlock.h
  llvm/include/llvm/CodeGen/MachineFunction.h
  llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
  llvm/include/llvm/Target/TargetLoweringObjectFile.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/lib/CodeGen/MachineFunction.cpp
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/Target/TargetLoweringObjectFile.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73674.241323.patch
Type: text/x-patch
Size: 30793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200130/fb551d96/attachment.bin>


More information about the llvm-commits mailing list