AMDGPU: Add detailed buffer, global and flat atomic fadd tests
authorPetar Avramovic <Petar.Avramovic@amd.com>
Fri, 23 Sep 2022 15:40:00 +0000 (17:40 +0200)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Fri, 23 Sep 2022 15:52:10 +0000 (17:52 +0200)
commit48968c47b0a15f8c21d54043100f3ee6bf4847e5
treecb6bb44f7b750a24e0c7821673640db82a423437
parente03d36d4aec2727fffeecc5c02ced2dc71a7283e
AMDGPU: Add detailed buffer, global and flat atomic fadd tests

Precommit for D130579 that will remove manual selection and use
patterns from td files. Tests are grouped based on target features.

All patterns have rtn and no-rtn versions.

buffer atomics patterns are selected based on the intrinsic used
(raw or struct) and the offset operand (imm or vgpr):
_offset raw with imm offset
_offen raw with vgpr offset (or large imm offset)
_idxen struct with imm offset
_bothen struct with vgpr offset (or large imm offset)

global and flat atomics are selected via intrinsic or the atomicrmw fadd.
atomicrmw tests have amdgpu-unsafe-fp-atomics=true and non-system scope
since they get expanded otherwise. atomicrmw fadd does not support vector
type, test float and double.

global atomics patterns are selected based on address type via (global or
flat) intrinsic or atomicrmw fadd with global address(addrspace(1)*).
'no suffix' vgpr addrspace(1)* address
_saddr sgpr addrspace(1)* address

flat atomics patterns are selected via (flat)intrinsic or atomicrmw fadd
with flat address (* - address space 0).

Differential Revision: https://reviews.llvm.org/D131561
28 files changed:
llvm/test/CodeGen/AMDGPU/GlobalISel/buffer-atomic-fadd.f32-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/buffer-atomic-fadd.f32-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/buffer-atomic-fadd.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/buffer-atomic-fadd.v2f16-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/buffer-atomic-fadd.v2f16-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/flat-atomic-fadd.f32.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/flat-atomic-fadd.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/flat-atomic-fadd.v2f16.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/global-atomic-fadd.f32-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/global-atomic-fadd.f32-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/global-atomic-fadd.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/global-atomic-fadd.v2f16-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/global-atomic-fadd.v2f16-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/buffer-atomic-fadd.f32-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/buffer-atomic-fadd.f32-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/buffer-atomic-fadd.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/buffer-atomic-fadd.v2f16-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/buffer-atomic-fadd.v2f16-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/flat-atomic-fadd.f32.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/flat-atomic-fadd.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/flat-atomic-fadd.v2f16.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/global-atomic-fadd.f32-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/global-atomic-fadd.f32-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/global-atomic-fadd.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/global-atomic-fadd.v2f16-no-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/global-atomic-fadd.v2f16-rtn.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.atomic.fadd.rtn_no-rtn.ll [deleted file]
llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-rmw-fadd.ll