[PATCH] D147544: [BOLT] Move from RuntimeDyld to JITLink

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 06:44:28 PDT 2023


treapster added a comment.

In D147544#4477299 <https://reviews.llvm.org/D147544#4477299>, @jobnoorman wrote:

> I'm not familiar with `LongJmpPass` but I did notice the following comment:
>
>> We pull this pass inside BOLT because here we can do a better job at stub inserting by manipulating the CFG, something linkers can't do.
>
> So wouldn't you lose something if this was moved to JITLink?

You're right, losing CFG will make branches impossible to relax. We'll need MC layer to emit relocs for every branch which is apparently default behavior for RISC-V but not AArch64. 
AFAIK currently JITLink doesn't relax branches for RISC-V, but if you intend to implement it, we can see how it works out and consider doing it for AArch64(starting with some MC option to emit R_AARCH64_JUMP26 and R_AARCH64_CONDBR19). As for updating the output values, it seems you mostly solved it in D154604 <https://reviews.llvm.org/D154604>.
@rafauler, do you think it's feasible to move LongJMP to JITLink if we force MC to generate branch relocs, and are there some other reasons to manipulate the actual CFG?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147544



More information about the llvm-commits mailing list