[all-commits] [llvm/llvm-project] 8244ff: [BOLT] Fix incorrect basic block output addresses ...

maksfb via All-commits all-commits at lists.llvm.org
Tue Oct 24 12:22:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8244ff6739a09cb75e6e7fd1c24b85e2b1397266
      https://github.com/llvm/llvm-project/commit/8244ff6739a09cb75e6e7fd1c24b85e2b1397266
  Author: maksfb <maks at fb.com>
  Date:   2023-10-24 (Tue, 24 Oct 2023)

  Changed paths:
    M bolt/include/bolt/Core/AddressMap.h
    M bolt/lib/Core/AddressMap.cpp
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Rewrite/RewriteInstance.cpp
    M bolt/test/X86/jump-table-icp.test

  Log Message:
  -----------
  [BOLT] Fix incorrect basic block output addresses (#70000)

Some optimization passes may duplicate basic blocks and assign the same
input offset to a number of different blocks in a function. This is done
e.g. to correctly map debugging ranges for duplicated code.

However, duplicate input offsets present a problem when we use
AddressMap to generate new addresses for basic blocks. The output
address is calculated based on the input offset and will be the same for
blocks with identical offsets. The result is potentially incorrect debug
info and BAT records.

To address the issue, we have to eliminate the dependency on input
offsets while generating output addresses for a basic block. Each block
has a unique label, hence we extend AddressMap to include address lookup
based on MCSymbol and use the new functionality to update block
addresses.




More information about the All-commits mailing list