1; RUN: not llc -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -global-isel-abort=2 -pass-remarks-missed="gisel.*" -verify-machineinstrs -o /dev/null 2>&1 %s | FileCheck -check-prefix=ERR %s 2 3; ERR: remark: <unknown>:0:0: cannot select: %{{[0-9]+}}:sreg_32(p5) = G_DYN_STACKALLOC %{{[0-9]+}}:vgpr(s32), 1 (in function: kernel_dynamic_stackalloc_vgpr_align4) 4; ERR-NEXT: warning: Instruction selection used fallback path for kernel_dynamic_stackalloc_vgpr_align4 5; ERR-NEXT: error: <unknown>:0:0: in function kernel_dynamic_stackalloc_vgpr_align4 void (i32 addrspace(1)*): unsupported dynamic alloca 6 7; ERR: remark: <unknown>:0:0: cannot select: %{{[0-9]+}}:sreg_32(p5) = G_DYN_STACKALLOC %{{[0-9]+}}:vgpr(s32), 1 (in function: func_dynamic_stackalloc_vgpr_align4) 8; ERR-NEXT: warning: Instruction selection used fallback path for func_dynamic_stackalloc_vgpr_align4 9; ERR-NEXT: error: <unknown>:0:0: in function func_dynamic_stackalloc_vgpr_align4 void (i32): unsupported dynamic alloca 10 11define amdgpu_kernel void @kernel_dynamic_stackalloc_vgpr_align4(i32 addrspace(1)* %ptr) { 12 %id = call i32 @llvm.amdgcn.workitem.id.x() 13 %gep = getelementptr i32, i32 addrspace(1)* %ptr, i32 %id 14 %n = load i32, i32 addrspace(1)* %gep 15 %alloca = alloca i32, i32 %n, align 4, addrspace(5) 16 store volatile i32 addrspace(5)* %alloca, i32 addrspace(5)* addrspace(1)* undef 17 ret void 18} 19 20define void @func_dynamic_stackalloc_vgpr_align4(i32 %n) { 21 %alloca = alloca i32, i32 %n, align 4, addrspace(5) 22 store volatile i32 addrspace(5)* %alloca, i32 addrspace(5)* addrspace(1)* undef 23 ret void 24} 25 26declare i32 @llvm.amdgcn.workitem.id.x() #0 27 28attributes #0 = { nounwind readnone speculatable } 29