[llvm] [AMDGPU] Introduce orderign parameter to atomic intrinsics and introduce new llvm.amdgcn.image.atomic.load intrinsic. (PR #73613)

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 09:02:24 PST 2023


nhaehnle wrote:

> The problem with doing this is generic passes that should really know this is an atomic operation do not know it. It sort of works for codegen, but it's also a different representation from a normal scope. In the past I've thought about introducing a call atomic flag to allow generically carrying the ordering and scope

Just based off of the function attributes, generic passes should assume that there may be an atomic operation in there based on the `memory` attribute (or lack thereof). Or maybe it's a lack of `nosync`[0] -- do does this intrinsic lack `nosync` as defined?  -- I've never heard an entirely convincing story about how all this is supposed to work.

If there are passes that make assumptions because this is an intrinsic, perhaps those passes should be fixed?

[0] Actually... `nosync` is a default attribute, and we define `AMDGPUImageDimIntrinsic` as a `DefaultAttrsIntrinsic`. That seems like an already existing bug for the image_atomic intrinsics. @sstipanovic can you fix that?

https://github.com/llvm/llvm-project/pull/73613


More information about the llvm-commits mailing list