reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
# 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:       4
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):

  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
...