This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add llvm.amdgcn.raw.atomic.buffer.load intrinsic to support OpAtomicLoad lowering
Needs ReviewPublic

Authored by mariusz-sikora-at-amd on Nov 28 2022, 3:48 AM.

Details

Summary

This adds llvm.amdgcn.raw.atomic.buffer.load intrinsic to support
OpAtomicLoad lowering on AMDGPU. Previously this was lowered to
llvm.amdgcn.raw.buffer.load which caused the load in some cases
to be marked as invariant and hoisted in LICM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 3:48 AM
mariusz-sikora-at-amd requested review of this revision.Nov 28 2022, 3:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 3:48 AM
foad added inline comments.Nov 28 2022, 6:13 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.atomic.buffer.load.ll
3

Should test globalisel too.

arsenm added inline comments.Nov 28 2022, 7:10 AM
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
977

We really ought to fix these bypassing the usual atomic memory model stuff

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.atomic.buffer.load.ll
23

Use named values in tests

53

Needs tests with more types. i64, <2 x i16>, <4 x i16>, and some pointers