1 # RUN: llc -mtriple=aarch64-linux-gnu %s -run-pass=aarch64-jump-tables -o - | FileCheck %s
3 define i32 @test_jumptable(i32 %in) {
11 exposesReturnsTwice: false
13 regBankSelected: false
15 tracksRegLiveness: true
19 isFrameAddressTaken: false
20 isReturnAddressTaken: false
29 hasOpaqueSPAdjustment: false
31 hasMustTailInVarArgFunc: false
36 blocks: [ '%bb.2', '%bb.3' ]
38 blocks: [ '%bb.4', '%bb.5' ]
53 ; CHECK: JumpTableDest8
55 early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.0
59 ; Last destination is 4 * 255 = 1020 bytes after first. Byte is OK.
60 dead $xzr = SPACE 1020, undef $xzr
64 ; CHECK: JumpTableDest16
65 early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.1
69 ; Last destination is 4 * 256 = 1024 bytes after first. Half needed.
70 dead $xzr = SPACE 1024, undef $xzr
74 ; CHECK: JumpTableDest8
75 early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.2
79 ; First destination is (2^20 - 4) after reference. Just reachable by ADR so can use compressed table.
80 dead $xzr = SPACE 1048556, undef $xzr
84 ; CHECK: JumpTableDest32
85 early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.3
89 ; First destination is 2^20 after reference. Compressed table cannot reach it.
90 dead $xzr = SPACE 1048560, undef $xzr
93 ; First destination is 2^20 before reference. Just within reach of ADR.
94 dead $xzr = SPACE 1048576, undef $xzr
98 ; CHECK: JumpTableDest8
99 early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.4
103 ; First destination is 2^20 before reference. Just within reach of ADR.
104 dead $xzr = SPACE 1048580, undef $xzr
108 ; CHECK: JumpTableDest32
109 early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.5