[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

Alex Bradbury via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 15 08:51:22 PST 2024


asb wrote:

There should be a release note for this as well as the RISCVUsage update.

I have concerns that the codegen part of this isn't correct. Specifically, the [requirement](https://llvm.org/docs/Atomics.html#atomics-and-codegen) that "One very important property of the atomic operations is that if your backend supports any inline lock-free atomic operations of a given size, you should support ALL operations of that size in a lock-free manner." It would be good if the codegen tests were updated so we see AMO codegen when only zalrsc is present, and cmpxchg when there's only zaamo. I _think_ that for the atomics not natively supported at widths up to and including xlen, the tests should show lowering to the `__sync_*` instructions [documented here](https://llvm.org/docs/Atomics.html#libcalls-sync), similar to when +forced-atomics is enabled.

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


More information about the cfe-commits mailing list