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)
commita603c4076cae935b49d736819cacefd7c04c80c6
tree4d5251817eed945c27274af94dfbcfd8e2cb1739
parentd21b00bd7cc9088772660a46f9e5c81594fa9aaf
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.

llvm-svn: 238680
12 files changed:
llvm/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/lib/Target/ARM/ARMAsmPrinter.h
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
llvm/lib/Target/ARM/ARMInstrInfo.td
llvm/lib/Target/ARM/ARMInstrThumb.td
llvm/lib/Target/ARM/ARMInstrThumb2.td
llvm/test/CodeGen/ARM/jump-table-islands-split.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/jump-table-islands.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/jumptable-label.ll
llvm/test/CodeGen/Thumb2/constant-islands-jump-table.ll
llvm/test/CodeGen/Thumb2/thumb2-tbh.ll