ARM: allow jump tables to be placed as constant islands.
authorTim Northover <tnorthover@apple.com>
Mon, 18 May 2015 17:10:40 +0000 (17:10 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 18 May 2015 17:10:40 +0000 (17:10 +0000)
commit9962fd0e2ead64250858951596e932c715093a96
tree21a985165f3b2e406f89b8f4d48d8aadfcf6e79a
parent2703007b7b35f4a19260094efd04d81d1b21ed38
ARM: allow jump tables to be placed as constant islands.

Previously, they were forced to immediately follow the actual branch
instruction. This was usually OK (the LEAs actually accessing them got emitted
nearby, and weren't usually separated much afterwards). Unfortunately, a
sufficiently nasty phi elimination dumps many instructions right before the
basic block terminator, and this can increase the range too much.

This patch frees them up to be placed as usual by the constant islands pass,
and consequently has to slightly modify the form of TBB/TBH tables to refer to
a PC-relative label at the final jump. The other jump table formats were
already position-independent.

rdar://20813304

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237590 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMAsmPrinter.h
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMInstrThumb.td
lib/Target/ARM/ARMInstrThumb2.td
test/CodeGen/ARM/jump-table-islands.ll [new file with mode: 0644]
test/CodeGen/ARM/jumptable-label.ll
test/CodeGen/Thumb2/constant-islands-jump-table.ll
test/CodeGen/Thumb2/thumb2-tbh.ll