[PATCH] D124728: Allow pointer types for atomicrmw xchg

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 00:47:19 PDT 2022


asb added a comment.

In D124728#3507010 <https://reviews.llvm.org/D124728#3507010>, @efriedma wrote:

>> One thing that's not immediately clear to me is what the the appropriate handling of pointers with a non-default address space should be? I think specifically, atomicrmw of non-integral pointer types may have to be disallowed?
>
> I don't see a particular problem here?  I mean, an atomic xchg is perfectly sensible for non-integral pointers; semantically, it doesn't even require examining the pointer bits.  I guess it's possible some targets can't implement an atomic pointer xchg, but it's not like we're forcing frontends to use it...

My concern was cases where there's no available atomic operation that can handle the pointer (e.g. atomic operations are only available on GPRs and it can't be stored in a GPR). Though as you say, frontends can just not generate it.


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

https://reviews.llvm.org/D124728



More information about the llvm-commits mailing list