brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · deba21b Raw
53 lines · plain
1; RUN: llc -mtriple=thumbv7s-apple-ios8.0 -o - %s | FileCheck %s2 3declare void @foo(double)4declare i32 @llvm.arm.space(i32, i32)5 6; The constpool entry used to call @foo should be directly between where we want7; the tbb and its table. Fortunately, the flow is simple enough that we can8; eliminate the entry calculation (ADD) and use the ADR as the base.9;10; I'm hoping this won't be fragile, but if it does break the most likely fix is11; adjusting the @llvm.arm.space call slightly. If this happens too many times12; the test should probably be removed.13define i32 @test_jumptable_not_adjacent(i1 %tst, i32 %sw, i32 %l) {14; CHECK-LABEL: test_jumptable_not_adjacent:15; CHECK:     vldr {{d[0-9]+}}, [[DBL_CONST:LCPI[0-9]+_[0-9]+]]16; [...]17; CHECK:     adr.w r[[BASE:[0-9]+]], [[JUMP_TABLE:LJTI[0-9]+_[0-9]+]]18; CHECK-NOT: r[[BASE]]19 20; CHECK: [[TBB_KEY:LCPI[0-9]+_[0-9]+]]:21; CHECK-NEXT:     tbb [r[[BASE]], {{r[0-9]+}}]22 23; CHECK: [[DBL_CONST]]:24; CHECK:     .long25; CHECK:     .long26; CHECK: [[JUMP_TABLE]]:27; CHECK:     .byte (LBB{{[0-9]+}}_{{[0-9]+}}-([[TBB_KEY]]+4)28 29  br label %complex30 31complex:32  call void @foo(double 12345.0)33  call i32 @llvm.arm.space(i32 970, i32 undef)34  switch i32 %sw, label %second [ i32 0, label %other35                                  i32 1, label %third36                                  i32 2, label %end37                                  i32 3, label %other ]38 39second:40  ret i32 4341third:42  ret i32 043 44other:45  call void @bar()46  unreachable47 48end:49  ret i32 4250}51 52declare void @bar()53