Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/RISCV/jumptable-swguarded.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

74 lines
1.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple riscv32 < %s | FileCheck %s
; RUN: llc -mtriple riscv64 < %s | FileCheck %s
; Test using t2 to jump table branch.
define void @above_threshold(i32 signext %in, ptr %out) nounwind {
; CHECK-LABEL: above_threshold:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: lpad 0
; CHECK-NEXT: addi a0, a0, -1
; CHECK-NEXT: li a2, 5
; CHECK-NEXT: bltu a2, a0, .LBB0_9
; CHECK-NEXT: # %bb.1: # %entry
; CHECK-NEXT: slli a0, a0, 2
; CHECK-NEXT: lui a2, %hi(.LJTI0_0)
; CHECK-NEXT: addi a2, a2, %lo(.LJTI0_0)
; CHECK-NEXT: add a0, a2, a0
; CHECK-NEXT: lw t2, 0(a0)
; CHECK-NEXT: jr t2
; CHECK-NEXT: .LBB0_2: # %bb1
; CHECK-NEXT: li a0, 4
; CHECK-NEXT: j .LBB0_8
; CHECK-NEXT: .LBB0_3: # %bb5
; CHECK-NEXT: li a0, 100
; CHECK-NEXT: j .LBB0_8
; CHECK-NEXT: .LBB0_4: # %bb3
; CHECK-NEXT: li a0, 2
; CHECK-NEXT: j .LBB0_8
; CHECK-NEXT: .LBB0_5: # %bb4
; CHECK-NEXT: li a0, 1
; CHECK-NEXT: j .LBB0_8
; CHECK-NEXT: .LBB0_6: # %bb2
; CHECK-NEXT: li a0, 3
; CHECK-NEXT: j .LBB0_8
; CHECK-NEXT: .LBB0_7: # %bb6
; CHECK-NEXT: li a0, 200
; CHECK-NEXT: .LBB0_8: # %exit
; CHECK-NEXT: sw a0, 0(a1)
; CHECK-NEXT: .LBB0_9: # %exit
; CHECK-NEXT: ret
entry:
switch i32 %in, label %exit [
i32 1, label %bb1
i32 2, label %bb2
i32 3, label %bb3
i32 4, label %bb4
i32 5, label %bb5
i32 6, label %bb6
]
bb1:
store i32 4, ptr %out
br label %exit
bb2:
store i32 3, ptr %out
br label %exit
bb3:
store i32 2, ptr %out
br label %exit
bb4:
store i32 1, ptr %out
br label %exit
bb5:
store i32 100, ptr %out
br label %exit
bb6:
store i32 200, ptr %out
br label %exit
exit:
ret void
}
!llvm.module.flags = !{!0}
!0 = !{i32 8, !"cf-protection-branch", i32 1}