ARM: recommit r237590: allow jump tables to be placed as constant islands.
authorTim Northover <tnorthover@apple.com>
Sun, 31 May 2015 19:22:07 +0000 (19:22 +0000)
committerTim Northover <tnorthover@apple.com>
Sun, 31 May 2015 19:22:07 +0000 (19:22 +0000)
commit876dd978b86dccecc215e953ef4ecf58864b00f4
treec2bab9d140261932e92ec35e85189cbb8aef5b8e
parentd79915c6fe9a9b31ba7882dd1b6311cbb9627395
ARM: recommit r237590: allow jump tables to be placed as constant islands.

The original version didn't properly account for the base register
being modified before the final jump, so caused miscompilations in
Chromium and LLVM. I've fixed this and tested with an LLVM self-host
(I don't have the means to build & test Chromium).

The general idea remains the same: in pathological cases jump tables
can be too far away from the instructions referencing them (like other
constants) so they need to be movable.

Should fix PR23627.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238680 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
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-split.ll [new file with mode: 0644]
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