blob: d90d08bb805d5da8ebf3ae6b3534a7a67be16f52 [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc -mtriple=riscv32 -code-model=small -mattr=+zba -O3 < %s | FileCheck %s --check-prefix=RV32I-SMALL
; RUN: llc -mtriple=riscv32 -code-model=small -mattr=+xqcili,+zba -O3 < %s | FileCheck %s --check-prefix=RV32IXQCILI-SMALL
; RUN: llc -mtriple=riscv32 -code-model=small -mattr=+xqcili,+xqcisls,+zba -O3 < %s | FileCheck %s --check-prefix=RV32IXQCILI-XQCISLS-SMALL
; RUN: llc -mtriple=riscv32 -code-model=medium -mattr=+zba -O3 < %s | FileCheck %s --check-prefix=RV32I-MEDIUM
; RUN: llc -mtriple=riscv32 -relocation-model=pic -mattr=+zba -O3 < %s | FileCheck %s --check-prefix=RV32I-PIC
; RUN: llc -mtriple=riscv64 -code-model=small -mattr=+zba -O3 < %s | FileCheck %s --check-prefixes=RV64I-SMALL,CHECK
; RUN: llc -mtriple=riscv64 -code-model=medium -mattr=+zba -O3 < %s | FileCheck %s --check-prefix=RV64I-MEDIUM
; RUN: llc -mtriple=riscv64 -relocation-model=pic -mattr=+zba -O3 < %s | FileCheck %s --check-prefix=RV64I-PIC
; RUN: llc -mtriple=riscv64 -code-model=small -mattr=+experimental-zilx -O3 < %s | FileCheck %s --check-prefixes=RV64ZILX-SMALL,CHECK
declare void @use(i32)
define void @sink_through_jt(ptr %p) {
; RV32I-SMALL-LABEL: sink_through_jt:
; RV32I-SMALL: # %bb.0: # %entry
; RV32I-SMALL-NEXT: addi sp, sp, -16
; RV32I-SMALL-NEXT: .cfi_def_cfa_offset 16
; RV32I-SMALL-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
; RV32I-SMALL-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
; RV32I-SMALL-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
; RV32I-SMALL-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
; RV32I-SMALL-NEXT: .cfi_offset ra, -4
; RV32I-SMALL-NEXT: .cfi_offset s0, -8
; RV32I-SMALL-NEXT: .cfi_offset s1, -12
; RV32I-SMALL-NEXT: .cfi_offset s2, -16
; RV32I-SMALL-NEXT: li s0, 12
; RV32I-SMALL-NEXT: addi s1, a0, 1
; RV32I-SMALL-NEXT: lui s2, %hi(.LJTI0_0)
; RV32I-SMALL-NEXT: addi s2, s2, %lo(.LJTI0_0)
; RV32I-SMALL-NEXT: j .LBB0_3
; RV32I-SMALL-NEXT: .LBB0_1: # %c10
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 110
; RV32I-SMALL-NEXT: .LBB0_2: # %m
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: call use
; RV32I-SMALL-NEXT: addi s1, s1, 1
; RV32I-SMALL-NEXT: .LBB0_3: # %disp
; RV32I-SMALL-NEXT: # =>This Inner Loop Header: Depth=1
; RV32I-SMALL-NEXT: lbu a0, -1(s1)
; RV32I-SMALL-NEXT: addi a0, a0, -1
; RV32I-SMALL-NEXT: bltu s0, a0, .LBB0_14
; RV32I-SMALL-NEXT: # %bb.4: # %disp
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: sh2add a0, a0, s2
; RV32I-SMALL-NEXT: lw a0, 0(a0)
; RV32I-SMALL-NEXT: jr a0
; RV32I-SMALL-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: lw a0, 0(s1)
; RV32I-SMALL-NEXT: addi a0, a0, 7
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_6: # %c3
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 103
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_7: # %c11
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 111
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_8: # %c8
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 108
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_9: # %c1
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 101
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_10: # %c2
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 102
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_11: # %c6
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 106
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_12: # %other
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 55
; RV32I-SMALL-NEXT: call use
; RV32I-SMALL-NEXT: li a0, 0
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_13: # %c4
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 104
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_14: # %c0
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 100
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_15: # %c5
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 105
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_16: # %c9
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 109
; RV32I-SMALL-NEXT: j .LBB0_2
; RV32I-SMALL-NEXT: .LBB0_17: # %c7
; RV32I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-SMALL-NEXT: li a0, 107
; RV32I-SMALL-NEXT: j .LBB0_2
;
; RV32IXQCILI-SMALL-LABEL: sink_through_jt:
; RV32IXQCILI-SMALL: # %bb.0: # %entry
; RV32IXQCILI-SMALL-NEXT: addi sp, sp, -16
; RV32IXQCILI-SMALL-NEXT: .cfi_def_cfa_offset 16
; RV32IXQCILI-SMALL-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
; RV32IXQCILI-SMALL-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
; RV32IXQCILI-SMALL-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
; RV32IXQCILI-SMALL-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
; RV32IXQCILI-SMALL-NEXT: .cfi_offset ra, -4
; RV32IXQCILI-SMALL-NEXT: .cfi_offset s0, -8
; RV32IXQCILI-SMALL-NEXT: .cfi_offset s1, -12
; RV32IXQCILI-SMALL-NEXT: .cfi_offset s2, -16
; RV32IXQCILI-SMALL-NEXT: li s0, 12
; RV32IXQCILI-SMALL-NEXT: addi s1, a0, 1
; RV32IXQCILI-SMALL-NEXT: qc.e.li s2, .LJTI0_0
; RV32IXQCILI-SMALL-NEXT: j .LBB0_3
; RV32IXQCILI-SMALL-NEXT: .LBB0_1: # %c10
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 110
; RV32IXQCILI-SMALL-NEXT: .LBB0_2: # %m
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: call use
; RV32IXQCILI-SMALL-NEXT: addi s1, s1, 1
; RV32IXQCILI-SMALL-NEXT: .LBB0_3: # %disp
; RV32IXQCILI-SMALL-NEXT: # =>This Inner Loop Header: Depth=1
; RV32IXQCILI-SMALL-NEXT: lbu a0, -1(s1)
; RV32IXQCILI-SMALL-NEXT: addi a0, a0, -1
; RV32IXQCILI-SMALL-NEXT: bltu s0, a0, .LBB0_14
; RV32IXQCILI-SMALL-NEXT: # %bb.4: # %disp
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: sh2add a0, a0, s2
; RV32IXQCILI-SMALL-NEXT: lw a0, 0(a0)
; RV32IXQCILI-SMALL-NEXT: jr a0
; RV32IXQCILI-SMALL-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: lw a0, 0(s1)
; RV32IXQCILI-SMALL-NEXT: addi a0, a0, 7
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_6: # %c3
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 103
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_7: # %c11
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 111
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_8: # %c8
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 108
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_9: # %c1
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 101
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_10: # %c2
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 102
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_11: # %c6
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 106
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_12: # %other
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 55
; RV32IXQCILI-SMALL-NEXT: call use
; RV32IXQCILI-SMALL-NEXT: li a0, 0
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_13: # %c4
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 104
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_14: # %c0
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 100
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_15: # %c5
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 105
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_16: # %c9
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 109
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-SMALL-NEXT: .LBB0_17: # %c7
; RV32IXQCILI-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-SMALL-NEXT: li a0, 107
; RV32IXQCILI-SMALL-NEXT: j .LBB0_2
;
; RV32IXQCILI-XQCISLS-SMALL-LABEL: sink_through_jt:
; RV32IXQCILI-XQCISLS-SMALL: # %bb.0: # %entry
; RV32IXQCILI-XQCISLS-SMALL-NEXT: addi sp, sp, -16
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .cfi_def_cfa_offset 16
; RV32IXQCILI-XQCISLS-SMALL-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
; RV32IXQCILI-XQCISLS-SMALL-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
; RV32IXQCILI-XQCISLS-SMALL-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
; RV32IXQCILI-XQCISLS-SMALL-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .cfi_offset ra, -4
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .cfi_offset s0, -8
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .cfi_offset s1, -12
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .cfi_offset s2, -16
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li s0, 12
; RV32IXQCILI-XQCISLS-SMALL-NEXT: addi s1, a0, 1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: qc.e.li s2, .LJTI0_0
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_3
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_1: # %c10
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 110
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_2: # %m
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: call use
; RV32IXQCILI-XQCISLS-SMALL-NEXT: addi s1, s1, 1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_3: # %disp
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # =>This Inner Loop Header: Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: lbu a0, -1(s1)
; RV32IXQCILI-XQCISLS-SMALL-NEXT: addi a0, a0, -1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: bltu s0, a0, .LBB0_14
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # %bb.4: # %disp
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: qc.lrw a0, s2, a0, 2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: jr a0
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: lw a0, 0(s1)
; RV32IXQCILI-XQCISLS-SMALL-NEXT: addi a0, a0, 7
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_6: # %c3
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 103
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_7: # %c11
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 111
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_8: # %c8
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 108
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_9: # %c1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 101
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_10: # %c2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 102
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_11: # %c6
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 106
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_12: # %other
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 55
; RV32IXQCILI-XQCISLS-SMALL-NEXT: call use
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 0
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_13: # %c4
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 104
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_14: # %c0
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 100
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_15: # %c5
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 105
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_16: # %c9
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 109
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
; RV32IXQCILI-XQCISLS-SMALL-NEXT: .LBB0_17: # %c7
; RV32IXQCILI-XQCISLS-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32IXQCILI-XQCISLS-SMALL-NEXT: li a0, 107
; RV32IXQCILI-XQCISLS-SMALL-NEXT: j .LBB0_2
;
; RV32I-MEDIUM-LABEL: sink_through_jt:
; RV32I-MEDIUM: # %bb.0: # %entry
; RV32I-MEDIUM-NEXT: addi sp, sp, -16
; RV32I-MEDIUM-NEXT: .cfi_def_cfa_offset 16
; RV32I-MEDIUM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
; RV32I-MEDIUM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
; RV32I-MEDIUM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
; RV32I-MEDIUM-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
; RV32I-MEDIUM-NEXT: .cfi_offset ra, -4
; RV32I-MEDIUM-NEXT: .cfi_offset s0, -8
; RV32I-MEDIUM-NEXT: .cfi_offset s1, -12
; RV32I-MEDIUM-NEXT: .cfi_offset s2, -16
; RV32I-MEDIUM-NEXT: .Lpcrel_hi0:
; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(.LJTI0_0)
; RV32I-MEDIUM-NEXT: addi s0, a0, 1
; RV32I-MEDIUM-NEXT: li s1, 12
; RV32I-MEDIUM-NEXT: addi s2, a1, %pcrel_lo(.Lpcrel_hi0)
; RV32I-MEDIUM-NEXT: j .LBB0_3
; RV32I-MEDIUM-NEXT: .LBB0_1: # %c10
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 110
; RV32I-MEDIUM-NEXT: .LBB0_2: # %m
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: call use
; RV32I-MEDIUM-NEXT: addi s0, s0, 1
; RV32I-MEDIUM-NEXT: .LBB0_3: # %disp
; RV32I-MEDIUM-NEXT: # =>This Inner Loop Header: Depth=1
; RV32I-MEDIUM-NEXT: lbu a0, -1(s0)
; RV32I-MEDIUM-NEXT: addi a0, a0, -1
; RV32I-MEDIUM-NEXT: bltu s1, a0, .LBB0_14
; RV32I-MEDIUM-NEXT: # %bb.4: # %disp
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: sh2add a0, a0, s2
; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
; RV32I-MEDIUM-NEXT: jr a0
; RV32I-MEDIUM-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: lw a0, 0(s0)
; RV32I-MEDIUM-NEXT: addi a0, a0, 7
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_6: # %c3
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 103
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_7: # %c11
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 111
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_8: # %c8
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 108
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_9: # %c1
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 101
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_10: # %c2
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 102
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_11: # %c6
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 106
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_12: # %other
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 55
; RV32I-MEDIUM-NEXT: call use
; RV32I-MEDIUM-NEXT: li a0, 0
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_13: # %c4
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 104
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_14: # %c0
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 100
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_15: # %c5
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 105
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_16: # %c9
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 109
; RV32I-MEDIUM-NEXT: j .LBB0_2
; RV32I-MEDIUM-NEXT: .LBB0_17: # %c7
; RV32I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-MEDIUM-NEXT: li a0, 107
; RV32I-MEDIUM-NEXT: j .LBB0_2
;
; RV32I-PIC-LABEL: sink_through_jt:
; RV32I-PIC: # %bb.0: # %entry
; RV32I-PIC-NEXT: addi sp, sp, -16
; RV32I-PIC-NEXT: .cfi_def_cfa_offset 16
; RV32I-PIC-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
; RV32I-PIC-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
; RV32I-PIC-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
; RV32I-PIC-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
; RV32I-PIC-NEXT: .cfi_offset ra, -4
; RV32I-PIC-NEXT: .cfi_offset s0, -8
; RV32I-PIC-NEXT: .cfi_offset s1, -12
; RV32I-PIC-NEXT: .cfi_offset s2, -16
; RV32I-PIC-NEXT: .Lpcrel_hi0:
; RV32I-PIC-NEXT: auipc a1, %pcrel_hi(.LJTI0_0)
; RV32I-PIC-NEXT: addi s0, a0, 1
; RV32I-PIC-NEXT: li s1, 12
; RV32I-PIC-NEXT: addi s2, a1, %pcrel_lo(.Lpcrel_hi0)
; RV32I-PIC-NEXT: j .LBB0_3
; RV32I-PIC-NEXT: .LBB0_1: # %c10
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 110
; RV32I-PIC-NEXT: .LBB0_2: # %m
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: call use
; RV32I-PIC-NEXT: addi s0, s0, 1
; RV32I-PIC-NEXT: .LBB0_3: # %disp
; RV32I-PIC-NEXT: # =>This Inner Loop Header: Depth=1
; RV32I-PIC-NEXT: lbu a0, -1(s0)
; RV32I-PIC-NEXT: addi a0, a0, -1
; RV32I-PIC-NEXT: bltu s1, a0, .LBB0_14
; RV32I-PIC-NEXT: # %bb.4: # %disp
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: sh2add a0, a0, s2
; RV32I-PIC-NEXT: lw a0, 0(a0)
; RV32I-PIC-NEXT: add a0, s2, a0
; RV32I-PIC-NEXT: jr a0
; RV32I-PIC-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: lw a0, 0(s0)
; RV32I-PIC-NEXT: addi a0, a0, 7
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_6: # %c3
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 103
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_7: # %c11
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 111
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_8: # %c8
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 108
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_9: # %c1
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 101
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_10: # %c2
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 102
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_11: # %c6
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 106
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_12: # %other
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 55
; RV32I-PIC-NEXT: call use
; RV32I-PIC-NEXT: li a0, 0
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_13: # %c4
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 104
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_14: # %c0
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 100
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_15: # %c5
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 105
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_16: # %c9
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 109
; RV32I-PIC-NEXT: j .LBB0_2
; RV32I-PIC-NEXT: .LBB0_17: # %c7
; RV32I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV32I-PIC-NEXT: li a0, 107
; RV32I-PIC-NEXT: j .LBB0_2
;
; RV64I-SMALL-LABEL: sink_through_jt:
; RV64I-SMALL: # %bb.0: # %entry
; RV64I-SMALL-NEXT: addi sp, sp, -32
; RV64I-SMALL-NEXT: .cfi_def_cfa_offset 32
; RV64I-SMALL-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
; RV64I-SMALL-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
; RV64I-SMALL-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
; RV64I-SMALL-NEXT: sd s2, 0(sp) # 8-byte Folded Spill
; RV64I-SMALL-NEXT: .cfi_offset ra, -8
; RV64I-SMALL-NEXT: .cfi_offset s0, -16
; RV64I-SMALL-NEXT: .cfi_offset s1, -24
; RV64I-SMALL-NEXT: .cfi_offset s2, -32
; RV64I-SMALL-NEXT: li s0, 12
; RV64I-SMALL-NEXT: addi s1, a0, 1
; RV64I-SMALL-NEXT: lui s2, %hi(.LJTI0_0)
; RV64I-SMALL-NEXT: addi s2, s2, %lo(.LJTI0_0)
; RV64I-SMALL-NEXT: j .LBB0_3
; RV64I-SMALL-NEXT: .LBB0_1: # %c10
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 110
; RV64I-SMALL-NEXT: .LBB0_2: # %m
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: call use
; RV64I-SMALL-NEXT: addi s1, s1, 1
; RV64I-SMALL-NEXT: .LBB0_3: # %disp
; RV64I-SMALL-NEXT: # =>This Inner Loop Header: Depth=1
; RV64I-SMALL-NEXT: lbu a0, -1(s1)
; RV64I-SMALL-NEXT: addi a0, a0, -1
; RV64I-SMALL-NEXT: bltu s0, a0, .LBB0_14
; RV64I-SMALL-NEXT: # %bb.4: # %disp
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: sh2add a0, a0, s2
; RV64I-SMALL-NEXT: lw a0, 0(a0)
; RV64I-SMALL-NEXT: jr a0
; RV64I-SMALL-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: lw a0, 0(s1)
; RV64I-SMALL-NEXT: addiw a0, a0, 7
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_6: # %c3
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 103
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_7: # %c11
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 111
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_8: # %c8
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 108
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_9: # %c1
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 101
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_10: # %c2
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 102
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_11: # %c6
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 106
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_12: # %other
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 55
; RV64I-SMALL-NEXT: call use
; RV64I-SMALL-NEXT: li a0, 0
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_13: # %c4
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 104
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_14: # %c0
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 100
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_15: # %c5
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 105
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_16: # %c9
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 109
; RV64I-SMALL-NEXT: j .LBB0_2
; RV64I-SMALL-NEXT: .LBB0_17: # %c7
; RV64I-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-SMALL-NEXT: li a0, 107
; RV64I-SMALL-NEXT: j .LBB0_2
;
; RV64I-MEDIUM-LABEL: sink_through_jt:
; RV64I-MEDIUM: # %bb.0: # %entry
; RV64I-MEDIUM-NEXT: addi sp, sp, -32
; RV64I-MEDIUM-NEXT: .cfi_def_cfa_offset 32
; RV64I-MEDIUM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
; RV64I-MEDIUM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
; RV64I-MEDIUM-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
; RV64I-MEDIUM-NEXT: sd s2, 0(sp) # 8-byte Folded Spill
; RV64I-MEDIUM-NEXT: .cfi_offset ra, -8
; RV64I-MEDIUM-NEXT: .cfi_offset s0, -16
; RV64I-MEDIUM-NEXT: .cfi_offset s1, -24
; RV64I-MEDIUM-NEXT: .cfi_offset s2, -32
; RV64I-MEDIUM-NEXT: .Lpcrel_hi0:
; RV64I-MEDIUM-NEXT: auipc a1, %pcrel_hi(.LJTI0_0)
; RV64I-MEDIUM-NEXT: addi s0, a0, 1
; RV64I-MEDIUM-NEXT: li s1, 12
; RV64I-MEDIUM-NEXT: addi s2, a1, %pcrel_lo(.Lpcrel_hi0)
; RV64I-MEDIUM-NEXT: j .LBB0_3
; RV64I-MEDIUM-NEXT: .LBB0_1: # %c10
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 110
; RV64I-MEDIUM-NEXT: .LBB0_2: # %m
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: call use
; RV64I-MEDIUM-NEXT: addi s0, s0, 1
; RV64I-MEDIUM-NEXT: .LBB0_3: # %disp
; RV64I-MEDIUM-NEXT: # =>This Inner Loop Header: Depth=1
; RV64I-MEDIUM-NEXT: lbu a0, -1(s0)
; RV64I-MEDIUM-NEXT: addi a0, a0, -1
; RV64I-MEDIUM-NEXT: bltu s1, a0, .LBB0_14
; RV64I-MEDIUM-NEXT: # %bb.4: # %disp
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: sh3add a0, a0, s2
; RV64I-MEDIUM-NEXT: ld a0, 0(a0)
; RV64I-MEDIUM-NEXT: jr a0
; RV64I-MEDIUM-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: lw a0, 0(s0)
; RV64I-MEDIUM-NEXT: addiw a0, a0, 7
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_6: # %c3
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 103
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_7: # %c11
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 111
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_8: # %c8
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 108
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_9: # %c1
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 101
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_10: # %c2
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 102
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_11: # %c6
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 106
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_12: # %other
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 55
; RV64I-MEDIUM-NEXT: call use
; RV64I-MEDIUM-NEXT: li a0, 0
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_13: # %c4
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 104
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_14: # %c0
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 100
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_15: # %c5
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 105
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_16: # %c9
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 109
; RV64I-MEDIUM-NEXT: j .LBB0_2
; RV64I-MEDIUM-NEXT: .LBB0_17: # %c7
; RV64I-MEDIUM-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-MEDIUM-NEXT: li a0, 107
; RV64I-MEDIUM-NEXT: j .LBB0_2
;
; RV64I-PIC-LABEL: sink_through_jt:
; RV64I-PIC: # %bb.0: # %entry
; RV64I-PIC-NEXT: addi sp, sp, -32
; RV64I-PIC-NEXT: .cfi_def_cfa_offset 32
; RV64I-PIC-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
; RV64I-PIC-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
; RV64I-PIC-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
; RV64I-PIC-NEXT: sd s2, 0(sp) # 8-byte Folded Spill
; RV64I-PIC-NEXT: .cfi_offset ra, -8
; RV64I-PIC-NEXT: .cfi_offset s0, -16
; RV64I-PIC-NEXT: .cfi_offset s1, -24
; RV64I-PIC-NEXT: .cfi_offset s2, -32
; RV64I-PIC-NEXT: .Lpcrel_hi0:
; RV64I-PIC-NEXT: auipc a1, %pcrel_hi(.LJTI0_0)
; RV64I-PIC-NEXT: addi s0, a0, 1
; RV64I-PIC-NEXT: li s1, 12
; RV64I-PIC-NEXT: addi s2, a1, %pcrel_lo(.Lpcrel_hi0)
; RV64I-PIC-NEXT: j .LBB0_3
; RV64I-PIC-NEXT: .LBB0_1: # %c10
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 110
; RV64I-PIC-NEXT: .LBB0_2: # %m
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: call use
; RV64I-PIC-NEXT: addi s0, s0, 1
; RV64I-PIC-NEXT: .LBB0_3: # %disp
; RV64I-PIC-NEXT: # =>This Inner Loop Header: Depth=1
; RV64I-PIC-NEXT: lbu a0, -1(s0)
; RV64I-PIC-NEXT: addi a0, a0, -1
; RV64I-PIC-NEXT: bltu s1, a0, .LBB0_14
; RV64I-PIC-NEXT: # %bb.4: # %disp
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: sh2add a0, a0, s2
; RV64I-PIC-NEXT: lw a0, 0(a0)
; RV64I-PIC-NEXT: add a0, s2, a0
; RV64I-PIC-NEXT: jr a0
; RV64I-PIC-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: lw a0, 0(s0)
; RV64I-PIC-NEXT: addiw a0, a0, 7
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_6: # %c3
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 103
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_7: # %c11
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 111
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_8: # %c8
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 108
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_9: # %c1
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 101
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_10: # %c2
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 102
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_11: # %c6
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 106
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_12: # %other
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 55
; RV64I-PIC-NEXT: call use
; RV64I-PIC-NEXT: li a0, 0
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_13: # %c4
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 104
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_14: # %c0
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 100
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_15: # %c5
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 105
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_16: # %c9
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 109
; RV64I-PIC-NEXT: j .LBB0_2
; RV64I-PIC-NEXT: .LBB0_17: # %c7
; RV64I-PIC-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64I-PIC-NEXT: li a0, 107
; RV64I-PIC-NEXT: j .LBB0_2
;
; RV64ZILX-SMALL-LABEL: sink_through_jt:
; RV64ZILX-SMALL: # %bb.0: # %entry
; RV64ZILX-SMALL-NEXT: addi sp, sp, -32
; RV64ZILX-SMALL-NEXT: .cfi_def_cfa_offset 32
; RV64ZILX-SMALL-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
; RV64ZILX-SMALL-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
; RV64ZILX-SMALL-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
; RV64ZILX-SMALL-NEXT: sd s2, 0(sp) # 8-byte Folded Spill
; RV64ZILX-SMALL-NEXT: .cfi_offset ra, -8
; RV64ZILX-SMALL-NEXT: .cfi_offset s0, -16
; RV64ZILX-SMALL-NEXT: .cfi_offset s1, -24
; RV64ZILX-SMALL-NEXT: .cfi_offset s2, -32
; RV64ZILX-SMALL-NEXT: li s0, 12
; RV64ZILX-SMALL-NEXT: addi s1, a0, 1
; RV64ZILX-SMALL-NEXT: lui s2, %hi(.LJTI0_0)
; RV64ZILX-SMALL-NEXT: addi s2, s2, %lo(.LJTI0_0)
; RV64ZILX-SMALL-NEXT: j .LBB0_3
; RV64ZILX-SMALL-NEXT: .LBB0_1: # %c10
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 110
; RV64ZILX-SMALL-NEXT: .LBB0_2: # %m
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: call use
; RV64ZILX-SMALL-NEXT: addi s1, s1, 1
; RV64ZILX-SMALL-NEXT: .LBB0_3: # %disp
; RV64ZILX-SMALL-NEXT: # =>This Inner Loop Header: Depth=1
; RV64ZILX-SMALL-NEXT: lbu a0, -1(s1)
; RV64ZILX-SMALL-NEXT: addi a0, a0, -1
; RV64ZILX-SMALL-NEXT: bltu s0, a0, .LBB0_14
; RV64ZILX-SMALL-NEXT: # %bb.4: # %disp
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: lxsw a0, (s2), a0
; RV64ZILX-SMALL-NEXT: jr a0
; RV64ZILX-SMALL-NEXT: .LBB0_5: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: lw a0, 0(s1)
; RV64ZILX-SMALL-NEXT: addiw a0, a0, 7
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_6: # %c3
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 103
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_7: # %c11
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 111
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_8: # %c8
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 108
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_9: # %c1
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 101
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_10: # %c2
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 102
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_11: # %c6
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 106
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_12: # %other
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 55
; RV64ZILX-SMALL-NEXT: call use
; RV64ZILX-SMALL-NEXT: li a0, 0
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_13: # %c4
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 104
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_14: # %c0
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 100
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_15: # %c5
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 105
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_16: # %c9
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 109
; RV64ZILX-SMALL-NEXT: j .LBB0_2
; RV64ZILX-SMALL-NEXT: .LBB0_17: # %c7
; RV64ZILX-SMALL-NEXT: # in Loop: Header=BB0_3 Depth=1
; RV64ZILX-SMALL-NEXT: li a0, 107
; RV64ZILX-SMALL-NEXT: j .LBB0_2
entry:
br label %disp
disp:
%ip = phi ptr [ %p, %entry ], [ %ipn, %c0 ], [ %ipn, %c1 ], [ %ipn, %c2 ],
[ %ipn, %c3 ], [ %ipn, %c4 ], [ %ipn, %c5 ], [ %ipn, %c6 ],
[ %ipn, %c7 ], [ %ipn, %c8 ], [ %ipn, %c9 ], [ %ipn, %c10 ],
[ %ipn, %c11 ], [ %ipn, %m ]
%op = load i8, ptr %ip
%ipn = getelementptr i8, ptr %ip, i64 1
%x = load i32, ptr %ipn
%v = add i32 %x, 7
switch i8 %op, label %c0 [
i8 1, label %m
i8 2, label %other
i8 3, label %c1
i8 4, label %c2
i8 5, label %c3
i8 6, label %c4
i8 7, label %c5
i8 8, label %c6
i8 9, label %c7
i8 10, label %c8
i8 11, label %c9
i8 12, label %c10
i8 13, label %c11
]
; Second predecessor of %m, so that %disp -> %m is a critical edge.
other:
call void @use(i32 55)
br label %m
m:
%phi = phi i32 [ %v, %disp ], [ 0, %other ]
call void @use(i32 %phi)
br label %disp
c0:
call void @use(i32 100)
br label %disp
c1:
call void @use(i32 101)
br label %disp
c2:
call void @use(i32 102)
br label %disp
c3:
call void @use(i32 103)
br label %disp
c4:
call void @use(i32 104)
br label %disp
c5:
call void @use(i32 105)
br label %disp
c6:
call void @use(i32 106)
br label %disp
c7:
call void @use(i32 107)
br label %disp
c8:
call void @use(i32 108)
br label %disp
c9:
call void @use(i32 109)
br label %disp
c10:
call void @use(i32 110)
br label %disp
c11:
call void @use(i32 111)
br label %disp
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}