Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/Mips/jump-table-mul.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

67 lines
1.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; We used to generate a mul+mflo sequence instead of shifting by 2/3 to get the jump table address
; RUN: llc %s -O2 -mtriple=mips64-unknown-freebsd -target-abi n64 -relocation-model=pic -o - | FileCheck %s
define i64 @test(i64 %arg) {
; CHECK-LABEL: test:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: lui $1, %hi(%neg(%gp_rel(test)))
; CHECK-NEXT: daddu $2, $1, $25
; CHECK-NEXT: sltiu $1, $4, 11
; CHECK-NEXT: beqz $1, .LBB0_4
; CHECK-NEXT: nop
; CHECK-NEXT: # %bb.1: # %entry
; CHECK-NEXT: daddiu $1, $2, %lo(%neg(%gp_rel(test)))
; CHECK-NEXT: dsll $2, $4, 3
; CHECK-NEXT: ld $3, %got_page(.LJTI0_0)($1)
; CHECK-NEXT: daddu $2, $2, $3
; CHECK-NEXT: ld $2, %got_ofst(.LJTI0_0)($2)
; CHECK-NEXT: daddu $1, $1, $2
; CHECK-NEXT: jr $1
; CHECK-NEXT: nop
; CHECK-NEXT: .LBB0_2: # %sw.bb
; CHECK-NEXT: jr $ra
; CHECK-NEXT: daddiu $2, $zero, 1
; CHECK-NEXT: .LBB0_3: # %sw.bb1
; CHECK-NEXT: jr $ra
; CHECK-NEXT: daddiu $2, $zero, 0
; CHECK-NEXT: .LBB0_4: # %default
; CHECK-NEXT: jr $ra
; CHECK-NEXT: daddiu $2, $zero, 1234
; Previously this dsll was the following sequence:
; daddiu $2, $zero, 8
; dmult $4, $2
; mflo $2
entry:
switch i64 %arg, label %default [
i64 0, label %sw.bb
i64 3, label %sw.bb
i64 5, label %sw.bb
i64 10, label %sw.bb1
]
default:
ret i64 1234
sw.bb:
ret i64 1
sw.bb1:
ret i64 0
}
; CHECK-LABEL: .section .rodata,"a",@progbits
; CHECK-NEXT: .p2align 3
; CHECK-LABEL: .LJTI0_0:
; CHECK-NEXT: .gpdword .LBB0_2
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_2
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_2
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_4
; CHECK-NEXT: .gpdword .LBB0_3