[PATCH] D34409: Use 64bit jump table with large code model on 64bit

Yichao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 08:12:14 PDT 2017


yuyichao added a comment.

I see the non-arch specific property as the good part since currently everything other than PPC claims to support large model with PIC and just generate wrong code. If a fallback that's always implementable and correct is defined, the only arch-specific changes needed will be for efficiency and not for correctness.

> Note that GCC is quite different as it often will not create a separate jump table section.

AFAICT it is using rodata as the section. Same as LLVM here.

> The only reason why it isn't implemented for AArch64 and X86_64 yet is the necessary function-specific base address.

Looking at the assembly, I think AArch64 should always has a function base address to use (accessing the jump table in PIC way already requires `adrp`) but that does not seem to be the case for x86_64 where the function local address isn't stored in any register and it seems that doing that will in general require one more instructions.


https://reviews.llvm.org/D34409





More information about the llvm-commits mailing list