diff options
author | maksfb <maks@fb.com> | 2023-10-24 12:22:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 12:22:43 -0700 |
commit | 8244ff6739a09cb75e6e7fd1c24b85e2b1397266 (patch) | |
tree | e3f19486ebcbd34aed1a45e1e63312a76f629e4f /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 888f07031bb6d64fd099516e187ed0bd818c59c3 (diff) | |
download | llvm-8244ff6739a09cb75e6e7fd1c24b85e2b1397266.zip llvm-8244ff6739a09cb75e6e7fd1c24b85e2b1397266.tar.gz llvm-8244ff6739a09cb75e6e7fd1c24b85e2b1397266.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions