brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 7bf9a29 Raw
51 lines · plain
1; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 < %s | FileCheck -check-prefixes=CHECK,GFX908 %s2; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a < %s 2> %t.err | FileCheck -check-prefixes=CHECK,GFX90A %s3; RUN: FileCheck --implicit-check-not=error -check-prefix=ERR < %t.err %s4 5; Test undefined behavior where a function ends up needing AGPRs that6; was marked with "amdgpu-agpr-alloc="="0". There should be no asserts.7 8; TODO: Should this be an error, or let UB happen?9 10; ERR: error: <unknown>:0:0: no registers from class available to allocate in function 'kernel_illegal_agpr_use_asm'11; ERR: error: <unknown>:0:0: no registers from class available to allocate in function 'func_illegal_agpr_use_asm'12 13; CHECK: {{^}}kernel_illegal_agpr_use_asm:14; CHECK: ; use a015 16; CHECK: NumVgprs: 017; CHECK: NumAgprs: 118define amdgpu_kernel void @kernel_illegal_agpr_use_asm() #0 {19  call void asm sideeffect "; use $0", "a"(i32 poison)20  ret void21}22 23; CHECK: {{^}}func_illegal_agpr_use_asm:24; CHECK: ; use a025 26; CHECK: NumVgprs: 027; CHECK: NumAgprs: 128define void @func_illegal_agpr_use_asm() #0 {29  call void asm sideeffect "; use $0", "a"(i32 poison)30  ret void31}32 33; CHECK-LABEL: {{^}}kernel_calls_mfma.f32.32x32x1f32:34; GFX908: v_accvgpr_write_b3235; GFX90A-NOT: v_accvgpr_write_b3236 37; GFX908: NumVgprs: 538; GFX908: NumAgprs: 3239; GFX90A: NumVgprs: 3540; GFX90A: NumAgprs: 041 42; GFX908: TotalNumVgprs: 3243; GFX90A: TotalNumVgprs: 3544define amdgpu_kernel void @kernel_calls_mfma.f32.32x32x1f32(ptr addrspace(1) %out, float %a, float %b, <32 x float> %c) #0 {45  %result = call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float %a, float %b, <32 x float> %c, i32 0, i32 0, i32 0)46  store <32 x float> %result, ptr addrspace(1) %out47  ret void48}49 50attributes #0 = { "amdgpu-agpr-alloc"="0" }51