1; RUN: llc -march=amdgcn -mcpu=bonaire < %s | FileCheck -check-prefix=GCN -check-prefix=CI -check-prefix=ALL %s 2; RUN: llc -march=amdgcn -mcpu=carrizo -mattr=-flat-for-global < %s | FileCheck -check-prefix=GCN -check-prefix=VI -check-prefix=ALL %s 3; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=-flat-for-global < %s | FileCheck -check-prefix=GCN -check-prefix=GFX9 -check-prefix=ALL %s 4 5; ALL-LABEL: {{^}}large_alloca_pixel_shader: 6; GCN-DAG: s_mov_b32 s8, SCRATCH_RSRC_DWORD0 7; GCN-DAG: s_mov_b32 s9, SCRATCH_RSRC_DWORD1 8; GCN-DAG: s_mov_b32 s10, -1 9; CI-DAG: s_mov_b32 s11, 0xe8f000 10; VI-DAG: s_mov_b32 s11, 0xe80000 11; GFX9-DAG: s_mov_b32 s11, 0xe00000 12 13; GCN: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, s[8:11], s0 offen 14; GCN: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, s[8:11], s0 offen 15 16; ALL: ; ScratchSize: 32772 17define amdgpu_ps void @large_alloca_pixel_shader(i32 %x, i32 %y) #0 { 18 %large = alloca [8192 x i32], align 4, addrspace(5) 19 %gep = getelementptr [8192 x i32], [8192 x i32] addrspace(5)* %large, i32 0, i32 8191 20 store volatile i32 %x, i32 addrspace(5)* %gep 21 %gep1 = getelementptr [8192 x i32], [8192 x i32] addrspace(5)* %large, i32 0, i32 %y 22 %val = load volatile i32, i32 addrspace(5)* %gep1 23 store volatile i32 %val, i32 addrspace(1)* undef 24 ret void 25} 26 27; ALL-LABEL: {{^}}large_alloca_pixel_shader_inreg: 28; GCN-DAG: s_mov_b32 s8, SCRATCH_RSRC_DWORD0 29; GCN-DAG: s_mov_b32 s9, SCRATCH_RSRC_DWORD1 30; GCN-DAG: s_mov_b32 s10, -1 31; CI-DAG: s_mov_b32 s11, 0xe8f000 32; VI-DAG: s_mov_b32 s11, 0xe80000 33; GFX9-DAG: s_mov_b32 s11, 0xe00000 34 35; GCN: buffer_store_dword {{v[0-9]+}}, {{v[0-9]+}}, s[8:11], s2 offen 36; GCN: buffer_load_dword {{v[0-9]+}}, {{v[0-9]+}}, s[8:11], s2 offen 37 38; ALL: ; ScratchSize: 32772 39define amdgpu_ps void @large_alloca_pixel_shader_inreg(i32 inreg %x, i32 inreg %y) #0 { 40 %large = alloca [8192 x i32], align 4, addrspace(5) 41 %gep = getelementptr [8192 x i32], [8192 x i32] addrspace(5)* %large, i32 0, i32 8191 42 store volatile i32 %x, i32 addrspace(5)* %gep 43 %gep1 = getelementptr [8192 x i32], [8192 x i32] addrspace(5)* %large, i32 0, i32 %y 44 %val = load volatile i32, i32 addrspace(5)* %gep1 45 store volatile i32 %val, i32 addrspace(1)* undef 46 ret void 47} 48 49attributes #0 = { nounwind } 50