[PATCH] D149526: [JITLink][RISCV] Implement linker relaxation

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 13:28:05 PDT 2023


MaskRay added a comment.

In D149526#4314992 <https://reviews.llvm.org/D149526#4314992>, @jobnoorman wrote:

> In D149526#4313436 <https://reviews.llvm.org/D149526#4313436>, @MaskRay wrote:
>
>>> @MaskRay: I've added you as a reviewer since you're the original author of the LLD algorithm. The algorithm in this patch is mostly the same as yours but I made some minor modifications. The main one is that I got rid of the valueDelta map you use in relax() to keep track of of the deltas of symbols in the previous iteration in order to correctly update symbol values. I believe this is unnecessary and the same can be accomplished by using the original symbol value stored in offset field in its anchor. When making the same change in LLD, all tests still pass.
>>
>> See 6b1d151fe3dc530195d8802f1ecc247c8235dd3a <https://reviews.llvm.org/rG6b1d151fe3dc530195d8802f1ecc247c8235dd3a> for `lld/ELF/Arch/RISCV.cpp:valueDelta`.
>> `lld/test/ELF/riscv-relax-call-intra-sec.s` (use `ninja check-lld-elf`) will fail if you reset a symbol value to the original value.
>
> I don't reset symbol values to their original but I use the original value to simply the calculation. I've opened D149735 <https://reviews.llvm.org/D149735> to try to explain this a bit better :)

Thanks. I think D149735 <https://reviews.llvm.org/D149735> is good.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149526/new/

https://reviews.llvm.org/D149526



More information about the llvm-commits mailing list