[PATCH] D87286: AArch64: make sure jump table entries can reach entire image

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 02:02:37 PDT 2020


t.p.northover added a comment.

> Instead of trying to make the table relative to the jump/adr, can we use the approach we use for compressed jump tables (using the address of the first destination as the base) unconditionally? Seems less complicated overall.

As you point out, `adr` may not have enough range in that case so it would have to be an `adrp` system. Further, because of MachO limitations on relocation addends (have I said how much I hate that format in the last week? Time to do it again), it can't be anything inside the function, leaving only the function symbol itself.

All in all, I was actually quite happy with this patch on the complexity front. It unifies the three `JumpTableDest` paths, squeaking in at removing code on average (+50/-62 excluding tests). I don't think the same would be true for a split `adrp`/`adr` solution, even if we don't try to optimize and produce `adr` when possible.


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

https://reviews.llvm.org/D87286



More information about the llvm-commits mailing list