blob: 0623110564b4850bd265f3bf875fd0a61f731338 [file] [log] [blame]
Tim Renouf65df6832019-07-04 17:38:24 +00001; 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:
Mirko Brkusaninf363e472020-08-21 11:51:06 +02007; GCN: ds_read_b96
8; GCN: ds_write_b96
Tim Renouf65df6832019-07-04 17:38:24 +00009; GCN: ScratchSize: 0
Nikita Popovee8670b2022-12-19 12:39:01 +010010define amdgpu_kernel void @store_v3i32(ptr addrspace(3) %out, <3 x i32> %a) nounwind {
11 %val = load <3 x i32>, ptr addrspace(3) %out
Tim Renouf65df6832019-07-04 17:38:24 +000012 %val.1 = add <3 x i32> %a, %val
Nikita Popovee8670b2022-12-19 12:39:01 +010013 store <3 x i32> %val.1, ptr addrspace(3) %out, align 16
Tim Renouf65df6832019-07-04 17:38:24 +000014 ret void
15}
16
17; GCN-LABEL: store_v5i32:
Matt Arsenault2e236182020-04-01 16:46:10 -040018; GCN: ds_read_b128
Austin Kerbow8c521822021-11-10 09:59:31 -080019; GCN: ds_read_b32
Tim Renouf65df6832019-07-04 17:38:24 +000020; GCN: ds_write_b32
Matt Arsenault2e236182020-04-01 16:46:10 -040021; GCN: ds_write_b128
Tim Renouf65df6832019-07-04 17:38:24 +000022; GCN: ScratchSize: 0
Nikita Popovee8670b2022-12-19 12:39:01 +010023define amdgpu_kernel void @store_v5i32(ptr addrspace(3) %out, <5 x i32> %a) nounwind {
24 %val = load <5 x i32>, ptr addrspace(3) %out
Tim Renouf65df6832019-07-04 17:38:24 +000025 %val.1 = add <5 x i32> %a, %val
Nikita Popovee8670b2022-12-19 12:39:01 +010026 store <5 x i32> %val.1, ptr addrspace(3) %out, align 16
Tim Renouf65df6832019-07-04 17:38:24 +000027 ret void
28}