Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/RISCV/rv32-move-merge-crash.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

83 lines
2.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc -mtriple=riscv32 -mattr=+m,+zcmp -verify-machineinstrs < %s | FileCheck %s --check-prefix=ZCMP
; RUN: llc -mtriple=riscv32 -mattr=+m,+xqccmp -verify-machineinstrs < %s | FileCheck %s --check-prefix=XQCCMP
; RUN: llc -mtriple=riscv32 -mattr=+m,+zcmp,+experimental-p -verify-machineinstrs < %s | FileCheck %s --check-prefix=ZCMP-P
; RUN: llc -mtriple=riscv64 -mattr=+m,+zcmp,+experimental-p -verify-machineinstrs < %s | FileCheck %s --check-prefix=ZCMP-P64
; This source code exposed a crash in the RISC-V Zcmp move merging pass.
; The root cause was: mergeGPRPairInsns being called on targets without
; Zdinx or P extension support, triggering an unreachable in
; getGPRPairCopyOpcode.
define void @test(i32 %arg0, i32 %arg1) nounwind {
; ZCMP-LABEL: test:
; ZCMP: # %bb.0: # %entry
; ZCMP-NEXT: #APP
; ZCMP-NEXT: csrr a4, 66
; ZCMP-NEXT: #NO_APP
; ZCMP-NEXT: #APP
; ZCMP-NEXT: csrr a5, 67
; ZCMP-NEXT: #NO_APP
; ZCMP-NEXT: #APP
; ZCMP-NEXT: #NO_APP
; ZCMP-NEXT: mv a0, a4
; ZCMP-NEXT: mv a1, a5
; ZCMP-NEXT: tail foo
;
; XQCCMP-LABEL: test:
; XQCCMP: # %bb.0: # %entry
; XQCCMP-NEXT: #APP
; XQCCMP-NEXT: csrr a4, 66
; XQCCMP-NEXT: #NO_APP
; XQCCMP-NEXT: #APP
; XQCCMP-NEXT: csrr a5, 67
; XQCCMP-NEXT: #NO_APP
; XQCCMP-NEXT: #APP
; XQCCMP-NEXT: #NO_APP
; XQCCMP-NEXT: mv a0, a4
; XQCCMP-NEXT: mv a1, a5
; XQCCMP-NEXT: tail foo
;
; ZCMP-P-LABEL: test:
; ZCMP-P: # %bb.0: # %entry
; ZCMP-P-NEXT: #APP
; ZCMP-P-NEXT: csrr a4, 66
; ZCMP-P-NEXT: #NO_APP
; ZCMP-P-NEXT: #APP
; ZCMP-P-NEXT: csrr a5, 67
; ZCMP-P-NEXT: #NO_APP
; ZCMP-P-NEXT: #APP
; ZCMP-P-NEXT: #NO_APP
; ZCMP-P-NEXT: padd.dw a0, a4, zero
; ZCMP-P-NEXT: tail foo
;
; ZCMP-P64-LABEL: test:
; ZCMP-P64: # %bb.0: # %entry
; ZCMP-P64-NEXT: #APP
; ZCMP-P64-NEXT: csrr a4, 66
; ZCMP-P64-NEXT: #NO_APP
; ZCMP-P64-NEXT: #APP
; ZCMP-P64-NEXT: csrr a5, 67
; ZCMP-P64-NEXT: #NO_APP
; ZCMP-P64-NEXT: #APP
; ZCMP-P64-NEXT: #NO_APP
; ZCMP-P64-NEXT: mv a0, a4
; ZCMP-P64-NEXT: mv a1, a5
; ZCMP-P64-NEXT: tail foo
entry:
%0 = tail call i32 asm sideeffect "csrr $0, 0x42", "=r"()
%1 = tail call i32 asm sideeffect "csrr $0, 0x43", "=r"()
tail call void asm sideeffect "", "~{x17},~{x10},~{x11},~{x12},~{x13}"()
%cmp = icmp eq i32 %0, 11
br i1 %cmp, label %if.else, label %if.else
if.else:
%call = tail call i32 @foo(i32 %0, i32 %1)
br label %if.end
if.end:
ret void
}
declare i32 @foo(i32, i32)