[all-commits] [llvm/llvm-project] 029283: Encode address offsets of basic blocks relative to...

Rahman Lavaee via All-commits all-commits at lists.llvm.org
Tue Feb 22 15:47:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 029283c1c0d8d06fbf000f5682c56b8595a1101f
      https://github.com/llvm/llvm-project/commit/029283c1c0d8d06fbf000f5682c56b8595a1101f
  Author: Rahman Lavaee <rahmanl at google.com>
  Date:   2022-02-22 (Tue, 22 Feb 2022)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/CodeGen/BasicBlockSections.cpp
    M llvm/test/CodeGen/X86/basic-block-sections-labels.ll
    M llvm/test/tools/llvm-readobj/ELF/bb-addr-map.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  Encode address offsets of basic blocks relative to the end of the previous basic blocks.

Conceptually, the new encoding emits the offsets and sizes as label differences between each two consecutive basic block begin and end label. When decoding, the offsets must be aggregated along with basic block sizes to calculate the final relative-to-function offsets of basic blocks.

This encoding uses smaller values compared to the existing one (offsets relative to function symbol).
Smaller values tend to occupy fewer bytes in ULEB128 encoding. As a result, we get about 25% reduction
in the size of the bb-address-map section (reduction from about 9MB to 7MB).

Reviewed By: tmsriram, jhenderson

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




More information about the All-commits mailing list