llvm-project/llvm/test/CodeGen/AMDGPU/inline-asm-av-constraint-err.ll
Matt Arsenault ff53086924
AMDGPU: Add new VA inline asm constraint for AV registers (#152665)
Add a new constraint corresponding to the AV_* register classes
for operands which can allocate AGPRs or VGPRs. This applies
to load and stores on gfx90a+, and srcA / srcB for MFMA instructions.

The error emitted on unsupported targets isn't ideal, it is
produced by the register allocator without a rationale, but it is
consistent with the existing errors.

I mostly want this for writing allocation tests.
2025-08-12 10:17:28 +09:00

28 lines
787 B
LLVM

; RUN: not llc -mtriple=amdgcn -mcpu=gfx90a -filetype=null %s 2>&1 | FileCheck %s
; Make sure illegal type uses are correctly diagnosed
; CHECK: error: couldn't allocate input reg for constraint 'VA'
define void @use_A_i8(i8 %x) {
call void asm sideeffect "; use $0", "^VA"(i8 %x)
ret void
}
; CHECK: error: couldn't allocate output register for constraint 'VA'
define i8 @def_A_i8() {
%ret = call i8 asm sideeffect "; def $0", "=^VA"()
ret i8 %ret
}
; CHECK: error: couldn't allocate input reg for constraint 'VA'
define void @use_A_i1(i1 %x) {
call void asm sideeffect "; use $0", "^VA"(i1 %x)
ret void
}
; CHECK: error: couldn't allocate output register for constraint 'VA'
define i1 @def_A_i1() {
%ret = call i1 asm sideeffect "; def $0", "=^VA"()
ret i1 %ret
}