2018-10-25 04:19:09 +08:00
|
|
|
# RUN: llc -mtriple=aarch64-linux-gnu %s -run-pass=aarch64-jump-tables -o - | FileCheck %s
|
|
|
|
--- |
|
|
|
|
define i32 @test_jumptable(i32 %in) {
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_jumptable
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 4
|
2018-10-25 04:19:09 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
liveins:
|
|
|
|
- { reg: '$w0' }
|
|
|
|
frameInfo:
|
|
|
|
isFrameAddressTaken: false
|
|
|
|
isReturnAddressTaken: false
|
|
|
|
hasStackMap: false
|
|
|
|
hasPatchPoint: false
|
|
|
|
stackSize: 0
|
|
|
|
offsetAdjustment: 0
|
|
|
|
maxAlignment: 0
|
|
|
|
adjustsStack: false
|
|
|
|
hasCalls: false
|
|
|
|
maxCallFrameSize: 0
|
|
|
|
hasOpaqueSPAdjustment: false
|
|
|
|
hasVAStart: false
|
|
|
|
hasMustTailInVarArgFunc: false
|
|
|
|
jumpTable:
|
|
|
|
kind: block-address
|
|
|
|
entries:
|
|
|
|
- id: 0
|
|
|
|
blocks: [ '%bb.2', '%bb.3' ]
|
|
|
|
- id: 1
|
|
|
|
blocks: [ '%bb.4', '%bb.5' ]
|
|
|
|
- id: 2
|
|
|
|
blocks: [ '%bb.7' ]
|
|
|
|
- id: 3
|
|
|
|
blocks: [ '%bb.9' ]
|
|
|
|
- id: 4
|
|
|
|
blocks: [ '%bb.9' ]
|
|
|
|
- id: 5
|
|
|
|
blocks: [ '%bb.11' ]
|
|
|
|
body: |
|
|
|
|
bb.0 (%ir-block.0):
|
2020-04-21 09:27:07 +08:00
|
|
|
liveins: $x8
|
2018-10-25 04:19:09 +08:00
|
|
|
|
|
|
|
bb.1 (%ir-block.0):
|
|
|
|
; CHECK-LABEL: body:
|
|
|
|
; CHECK-LABEL: bb.1
|
|
|
|
; CHECK: JumpTableDest8
|
|
|
|
liveins: $x8
|
|
|
|
early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.0
|
|
|
|
BR killed $x10
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
; Last destination is 4 * 255 = 1020 bytes after first. Byte is OK.
|
|
|
|
dead $xzr = SPACE 1020, undef $xzr
|
|
|
|
|
|
|
|
bb.3:
|
|
|
|
; CHECK-LABEL: bb.3
|
|
|
|
; CHECK: JumpTableDest16
|
|
|
|
early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.1
|
|
|
|
BR killed $x10
|
|
|
|
|
|
|
|
bb.4:
|
|
|
|
; Last destination is 4 * 256 = 1024 bytes after first. Half needed.
|
|
|
|
dead $xzr = SPACE 1024, undef $xzr
|
|
|
|
|
|
|
|
bb.5:
|
|
|
|
; CHECK-LABEL: bb.5
|
|
|
|
; CHECK: JumpTableDest8
|
|
|
|
early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.2
|
|
|
|
BR killed $x10
|
|
|
|
|
|
|
|
bb.6:
|
|
|
|
; First destination is (2^20 - 4) after reference. Just reachable by ADR so can use compressed table.
|
|
|
|
dead $xzr = SPACE 1048556, undef $xzr
|
|
|
|
|
|
|
|
bb.7:
|
|
|
|
; CHECK-LABEL: bb.7
|
|
|
|
; CHECK: JumpTableDest32
|
|
|
|
early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.3
|
|
|
|
BR killed $x10
|
|
|
|
|
|
|
|
bb.8:
|
|
|
|
; First destination is 2^20 after reference. Compressed table cannot reach it.
|
|
|
|
dead $xzr = SPACE 1048560, undef $xzr
|
|
|
|
|
|
|
|
bb.9:
|
|
|
|
; First destination is 2^20 before reference. Just within reach of ADR.
|
|
|
|
dead $xzr = SPACE 1048576, undef $xzr
|
|
|
|
|
|
|
|
bb.10:
|
|
|
|
; CHECK-LABEL: bb.10
|
|
|
|
; CHECK: JumpTableDest8
|
|
|
|
early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.4
|
|
|
|
BR killed $x10
|
|
|
|
|
|
|
|
bb.11:
|
|
|
|
; First destination is 2^20 before reference. Just within reach of ADR.
|
|
|
|
dead $xzr = SPACE 1048580, undef $xzr
|
|
|
|
|
|
|
|
bb.12:
|
|
|
|
; CHECK-LABEL: bb.12
|
|
|
|
; CHECK: JumpTableDest32
|
|
|
|
early-clobber $x10, dead early-clobber $x11 = JumpTableDest32 undef killed $x9, undef killed $x8, %jump-table.5
|
|
|
|
BR killed $x10
|
|
|
|
...
|