This is an archive of the discontinued LLVM Phabricator instance.

AArch64: use "LBB-_func" entries in 32-bit jump tables for MachO
AbandonedPublic

Authored by t.p.northover on Jul 22 2020, 5:24 AM.

Details

Reviewers
None
Summary

MachO has only 24-bits for relocation addends, which is too small to span a semi-reasonable sized function. This means jump table lowering has to be careful about two things:

  • Any pc-relative address should be to a linker-visible symbol so the addend is 0. This was fixed previously by making the actual jump table symbol linker-private.
  • The entries, "LBB-x", must be resolved at compile-time.

This implements the second point by making the base the function address itself on MachO targets. However, it only applies to MachO because it is a less efficient system overall (requiring the function address base to be materialized separately).

Diff Detail

Event Timeline

t.p.northover created this revision.Jul 22 2020, 5:24 AM
t.p.northover abandoned this revision.Aug 3 2020, 4:09 AM

Actually, I've discovered 32-bit addends are allowed in a constant-pool setting like that so it won't overflow on a reasonable function. Siince this makes CodeGen strictly worse there's no point.