[clang] [llvm] [AMDGPU] Add an option to disable unsafe uses of atomic xor (PR #69229)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 07:37:04 PST 2024


yxsamliu wrote:

> We're gradually converging on something that looks like this, subject to bike shedding the name

I did not know about this PR. It is interesting that our other discussions lead to similar solution.

I agree that per-instruction metadata is needed, and the metadata should convey separate control for fp atomic and unsupported integer atomic across PCIE.

The reason to use per-instruction metadata instead of per-function metadata or attribute is that per-function attribute does not work well for inlined functions.

As for controlling FE emitting this metadata, a more-fine-grained control e.g. pragma is desirable, however, for this patch, a clang option is probably sufficient. We could consider pragma control later.

We need to coin some good concise name for the metadata:

For unsafe fp atomic - unsafe_fp ?

For unsupported integer atomic across PCIE - unsafe_pcie ? fine_grained may not be suitable since fine_grained memory accessed across XGMI supports integer atomic AND/OR/XOR ops etc

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


More information about the cfe-commits mailing list