[PATCH] D104556: [InstrProfiling] Make CountersPtr in __profd_ relative

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 14:43:19 PDT 2021


MaskRay added a comment.

In D104556#2837136 <https://reviews.llvm.org/D104556#2837136>, @mstorsjo wrote:

> In D104556#2837104 <https://reviews.llvm.org/D104556#2837104>, @rnk wrote:
>
>> Swift wanted the same thing, so I think the answer is yes, we should ask.
>
> What would the benefit of that be, as the difference itself can only ever be 32 bit? Is it only for consistency with other binary formats? I guess getting the value sign extended to a 64 bit value is a bit useful too.

Yes, consistency among binary formats. A 64-bit label difference `.quad A-B` is directly expressable on Mach-O and RISC-V (`R_RISCV_SUB*`) and can be converted to PC-relative on ELF.

For example, mips64 supports 64-bit PC-relative since D80390 <https://reviews.llvm.org/D80390> (GNU as still doesn't allow it) => this allowed an XRay clean-up D87977 <https://reviews.llvm.org/D87977>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104556



More information about the llvm-commits mailing list