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

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 14:08:12 PDT 2017


joerg added a comment.

In https://reviews.llvm.org/D34409#785891, @t.p.northover wrote:

> > The entirely sensible assumption of the PPC backend is that a single function is no longer than 2GB/4GB.
>
> What's being produced is an offset from the basic blocks (.text) to the Jump table (.rodata). That's not necessarily 32-bits, and I think there are entirely legitimate reasons for putting jump tables in .rodata.


That's not what PPC64 creates. It puts offsets between the BB and a picbase into the jumptable.

> I expect something better could be done for PPC, but this is entirely in line with the existing 32-bit code and correctness comes before performance. I pretty strongly object to characterising the patch as "wrong".

Please read what I said. The PPC change is wrong: the code works correctly for the large code model. For X86_64, two option exists: non-PIC should work fine when using absolute pointers. That's the primary use case of large code model right now, i.e. for JIT. The better approach is to follow what PPC does and this is not done by this patch.


https://reviews.llvm.org/D34409





More information about the llvm-commits mailing list