74 lines · plain
1; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1200 -stop-after=prologepilog < %s | FileCheck -check-prefix=CHECK %s2 3; Make sure we use a stack pointer and allocate 112 * 4 bytes at the beginning of the stack.4 5define amdgpu_cs void @amdgpu_cs() #0 {6; CHECK-LABEL: {{^}}name: amdgpu_cs7; CHECK: scratchReservedForDynamicVGPRs: 4488 ret void9}10 11define amdgpu_kernel void @kernel() #0 {12; CHECK-LABEL: {{^}}name: kernel13; CHECK: scratchReservedForDynamicVGPRs: 44814 ret void15}16 17define amdgpu_cs void @with_local() #0 {18; CHECK-LABEL: {{^}}name: with_local19; CHECK: scratchReservedForDynamicVGPRs: 44820 %local = alloca i32, addrspace(5)21 store volatile i8 13, ptr addrspace(5) %local22 ret void23}24 25define amdgpu_cs void @with_calls() #0 {26; CHECK-LABEL: {{^}}name: with_calls27; CHECK: scratchReservedForDynamicVGPRs: 44828 %local = alloca i32, addrspace(5)29 store volatile i8 15, ptr addrspace(5) %local30 call amdgpu_gfx void @callee(i32 71)31 ret void32}33 34define amdgpu_cs void @realign_stack(<32 x i32> %x) #0 {35; CHECK-LABEL: {{^}}name: realign_stack36; CHECK: scratchReservedForDynamicVGPRs: 51237 %v = alloca <32 x i32>, align 128, addrspace(5)38 ; use volatile store to avoid promotion of alloca to registers39 store volatile <32 x i32> %x, ptr addrspace(5) %v40 call amdgpu_gfx void @callee(i32 71)41 ret void42}43 44; Non-entry functions and graphics shaders can't run on a compute queue,45; so they don't need to worry about CWSR.46define amdgpu_gs void @amdgpu_gs() #0 {47; CHECK-LABEL: {{^}}name: amdgpu_gs48; CHECK: scratchReservedForDynamicVGPRs: 049 %local = alloca i32, addrspace(5)50 store volatile i8 15, ptr addrspace(5) %local51 call amdgpu_gfx void @callee(i32 71)52 ret void53}54 55define amdgpu_gfx void @amdgpu_gfx() #0 {56; CHECK-LABEL: {{^}}name: amdgpu_gfx57; CHECK: scratchReservedForDynamicVGPRs: 058 %local = alloca i32, addrspace(5)59 store volatile i8 15, ptr addrspace(5) %local60 call amdgpu_gfx void @callee(i32 71)61 ret void62}63 64define void @default() #0 {65; CHECK-LABEL: {{^}}name: default66; CHECK: scratchReservedForDynamicVGPRs: 067 ret void68}69 70declare amdgpu_gfx void @callee(i32) #071 72attributes #0 = { nounwind "amdgpu-dynamic-vgpr-block-size" = "16" }73 74