[CodeGen][AArch64] Don't split jump table basic blocks
commitef1c25eb50502692f343e9ac0b83b52086aa584e
authorDaniel Hoekwater <hoekwater@google.com>
Fri, 4 Aug 2023 01:16:07 +0000 (4 01:16 +0000)
committerDaniel Hoekwater <hoekwater@google.com>
Mon, 28 Aug 2023 21:47:57 +0000 (28 21:47 +0000)
tree08788429105ad394c001d4f150c9961971e2decf
parent47aca7562abe8de378fdb88160ece9e3fcac24f4
[CodeGen][AArch64] Don't split jump table basic blocks

Jump tables on AArch64 are label-relative rather than table-relative, so
having jump table destinations that are in different sections causes
problems with relocation. Jump table lookups have a max range of 1MB, so
all destinations must be in the same section as the lookup code. Both of
these restrictions can be mitigated with some careful and complex logic,
but doing so doesn't gain a huge performance benefit.

Efficiently ensuring jump tables are correct and can be compressed on
AArch64 is a TODO item. In the meantime, don't split blocks that can
cause problems.

Differential Revision: https://reviews.llvm.org/D157124
llvm/include/llvm/CodeGen/TargetInstrInfo.h
llvm/lib/CodeGen/MachineFunctionSplitter.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h
llvm/test/CodeGen/Generic/machine-function-splitter.ll