[PATCH] D129677: Disable machine function splitting for functions with inline asm br

Adrian Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 14:52:13 PDT 2022


adriantong1024 added a comment.

In D129677#3653328 <https://reviews.llvm.org/D129677#3653328>, @efriedma wrote:

> AArch64 "b" has a range of +-128MB.  Which isn't enough for arbitrary programs.  So in general, you need a sequence like the following (assuming small code model):
>
>   adrp x0, dest
>   add x0, x0, :lo12:dest
>   blr x0
>
> That is, unless you're okay with the restriction that your binary is at most 128MB.  Which might be reasonable for the Linux kernel, I guess.  But again, something you'd want to document...
>
> ------
>
> That said, I'm surprised machine function splitting on aarch64 works without any other changes; currently, branch relaxation isn't aware of section markings at all.  Or do you have some other out-of-tree patches?

I think in case 128MB is not enough, the linker will help here. https://reviews.llvm.org/D39744

MFS does not work on AArch64, I am trying to make it work. I extended branch relaxation to handle cross-section branches. I plan to send out a RFC before sending up the out-of-tree patches I have.

Thanks !


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129677



More information about the llvm-commits mailing list