1; RUN: llc -mtriple amdgcn-amd-- -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3; Before the fix that this test was committed with, this code would leave
4; an unused stack slot, causing ScratchSize to be non-zero.
5
6; GCN-LABEL: store_v3i32:
7; GCN:        ds_read_b32
8; GCN:        ds_read_b64
9; GCN:        ds_write_b32
10; GCN:        ds_write_b64
11; GCN: ScratchSize: 0
12define amdgpu_kernel void @store_v3i32(<3 x i32> addrspace(3)* %out, <3 x i32> %a) nounwind {
13  %val = load <3 x i32>, <3 x i32> addrspace(3)* %out
14  %val.1 = add <3 x i32> %a, %val
15  store <3 x i32> %val.1, <3 x i32> addrspace(3)* %out, align 16
16  ret void
17}
18
19; GCN-LABEL: store_v5i32:
20; GCN:        ds_read_b32
21; GCN:        ds_read_b128
22; GCN:        ds_write_b32
23; GCN:        ds_write_b128
24; GCN: ScratchSize: 0
25define amdgpu_kernel void @store_v5i32(<5 x i32> addrspace(3)* %out, <5 x i32> %a) nounwind {
26  %val = load <5 x i32>, <5 x i32> addrspace(3)* %out
27  %val.1 = add <5 x i32> %a, %val
28  store <5 x i32> %val.1, <5 x i32> addrspace(3)* %out, align 16
29  ret void
30}
31