58 lines · plain
1; RUN: llc -mtriple=amdgcn -mcpu=bonaire < %s | FileCheck -check-prefix=GCN -check-prefix=CI -check-prefix=ALL %s2; RUN: llc -mtriple=amdgcn -mcpu=carrizo -mattr=-flat-for-global < %s | FileCheck -check-prefix=GCN -check-prefix=VI -check-prefix=ALL %s3; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=-flat-for-global < %s | FileCheck -check-prefix=GCN -check-prefix=GFX9 -check-prefix=ALL %s4 5; ALL-LABEL: {{^}}large_alloca_pixel_shader:6; GCN-DAG: s_mov_b32 s4, SCRATCH_RSRC_DWORD07; GCN-DAG: s_mov_b32 s5, SCRATCH_RSRC_DWORD18; GCN-DAG: s_mov_b32 s6, -19 10; CI-DAG: s_mov_b32 s7, 0xe8f00011; VI-DAG: s_mov_b32 s7, 0xe8000012; GFX9-DAG: s_mov_b32 s7, 0xe0000013 14; GCN: s_add_u32 s4, s4, s015; GCN: s_addc_u32 s5, s5, 016 17; GCN: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, s[4:7], 0 offen18; GCN: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, s[4:7], 0 offen19 20; ALL: ; ScratchSize: 3277221define amdgpu_ps void @large_alloca_pixel_shader(i32 %x, i32 %y) #0 {22 %large = alloca [8192 x i32], align 4, addrspace(5)23 %gep = getelementptr [8192 x i32], ptr addrspace(5) %large, i32 0, i32 819124 store volatile i32 %x, ptr addrspace(5) %gep25 %gep1 = getelementptr [8192 x i32], ptr addrspace(5) %large, i32 0, i32 %y26 %val = load volatile i32, ptr addrspace(5) %gep127 store volatile i32 %val, ptr addrspace(1) poison28 ret void29}30 31; ALL-LABEL: {{^}}large_alloca_pixel_shader_inreg:32; GCN-DAG: s_mov_b32 s4, SCRATCH_RSRC_DWORD033; GCN-DAG: s_mov_b32 s5, SCRATCH_RSRC_DWORD134; GCN-DAG: s_mov_b32 s6, -135 36; CI-DAG: s_mov_b32 s7, 0xe8f00037; VI-DAG: s_mov_b32 s7, 0xe8000038; GFX9-DAG: s_mov_b32 s7, 0xe0000039 40; GCN: s_add_u32 s4, s4, s241; GCN: s_addc_u32 s5, s5, 042 43; GCN: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, s[4:7], 0 offen44; GCN: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, s[4:7], 0 offen45 46; ALL: ; ScratchSize: 3277247define amdgpu_ps void @large_alloca_pixel_shader_inreg(i32 inreg %x, i32 inreg %y) #0 {48 %large = alloca [8192 x i32], align 4, addrspace(5)49 %gep = getelementptr [8192 x i32], ptr addrspace(5) %large, i32 0, i32 819150 store volatile i32 %x, ptr addrspace(5) %gep51 %gep1 = getelementptr [8192 x i32], ptr addrspace(5) %large, i32 0, i32 %y52 %val = load volatile i32, ptr addrspace(5) %gep153 store volatile i32 %val, ptr addrspace(1) poison54 ret void55}56 57attributes #0 = { nounwind }58