[PATCH] D136032: [X86][2/2] Adding atomic add/sub/or/xor/and lowering into RAO-INT instructions

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 15 21:03:14 PDT 2022


pengfei added a comment.

In D136032#3860829 <https://reviews.llvm.org/D136032#3860829>, @craig.topper wrote:

> It's not immediately clear to me that these are intended as a general atomic replacement. Is there more detail documentation or usage guide anywhere?

Not yet other than the ISE. I read several documents about the general atomic, but the RAO-INT is a new technology. I'm not very sure the relationships between them.

In D136032#3860833 <https://reviews.llvm.org/D136032#3860833>, @efriedma wrote:

> I'd rather not do this until we have:
>
> 1. Some published document that describes the relationship of these new instructions with the C++ atomic model, including interactions with existing atomic lowering.  (I don't trust that it's correct based on the two sentences in the manual.)
> 2. Some idea whether this is actually preferable; mfence is expensive.

Yeah, good points, thanks @efriedma. I use mfence for conservative reasons. I had the impression mfence is cheaper than lock. Maybe I was wrong? Anyway, I can make it only work for `monotonic`. This should be enough as a beginning.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136032/new/

https://reviews.llvm.org/D136032



More information about the llvm-commits mailing list