diff options
author | Tim Northover <tnorthover@apple.com> | 2015-05-31 19:22:07 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2015-05-31 19:22:07 +0000 |
commit | a603c4076cae935b49d736819cacefd7c04c80c6 (patch) | |
tree | 4d5251817eed945c27274af94dfbcfd8e2cb1739 /llvm/test/CodeGen/Thumb2/thumb2-tbh.ll | |
parent | d21b00bd7cc9088772660a46f9e5c81594fa9aaf (diff) | |
download | bcm5719-llvm-a603c4076cae935b49d736819cacefd7c04c80c6.tar.gz bcm5719-llvm-a603c4076cae935b49d736819cacefd7c04c80c6.zip |
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
Diffstat (limited to 'llvm/test/CodeGen/Thumb2/thumb2-tbh.ll')
-rw-r--r-- | llvm/test/CodeGen/Thumb2/thumb2-tbh.ll | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/Thumb2/thumb2-tbh.ll b/llvm/test/CodeGen/Thumb2/thumb2-tbh.ll index a5a5ed0c8da..0761ed589a2 100644 --- a/llvm/test/CodeGen/Thumb2/thumb2-tbh.ll +++ b/llvm/test/CodeGen/Thumb2/thumb2-tbh.ll @@ -14,9 +14,19 @@ declare void @Z_fatal(i8*) noreturn nounwind declare noalias i8* @calloc(i32, i32) nounwind +; Jump tables are not anchored next to the TBB/TBH any more. Make sure the +; correct address is still calculated (i.e. via a PC-relative symbol *at* the +; TBB/TBH). define i32 @main(i32 %argc, i8** nocapture %argv) nounwind { ; CHECK-LABEL: main: -; CHECK: tbb +; CHECK-NOT: adr {{r[0-9]+}}, LJTI +; CHECK: [[PCREL_ANCHOR:LCPI[0-9]+_[0-9]+]]: +; CHECK-NEXT: tbb [pc, {{r[0-9]+}}] + +; CHECK: LJTI0_0: +; CHECK-NEXT: .data_region jt8 +; CHECK-NEXT: .byte (LBB{{[0-9]+_[0-9]+}}-([[PCREL_ANCHOR]]+4))/2 + entry: br label %bb42.i |