[clang] [llvm] [AArch64] Implement the atomic store with hint intrinsic (PR #198316)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 23 01:04:36 PDT 2026
nikic wrote:
> > As far as I understand it, the hint here is specifically a cache hint.
>
> That would be true for now, but in the future this intrinsic will be used for adding other types of hints to atomic store in the future. For example in [ARM-software/acle#430](https://github.com/ARM-software/acle/pull/430) we will extend the allowed hints to support Contention management hints. So therefore I think using !mem.cache_hint wouldn't be possible here. Though, if we generalized this mechanism to support any kind of hint we could use it here.
cc @YonahGoldberg but I think this still fits within the spirit of `!mem.cache_hint`.
Though I'll say that the description of these hints is really not great:
> Ensures that the memory write effect of the next instruction occurs before any other effects from other threads.
That doesn't sound like a hint, that sounds like a change to the memory model! Elsewhere I found this description:
> That there is a performance benefit if a particular memory access is sequenced before memory accesses from other threads of execution in the coherence order to the same location.
Whew, that makes more sense...
https://github.com/llvm/llvm-project/pull/198316
More information about the cfe-commits
mailing list