[PATCH] D66197: AMDGPU: Add intrinsics for address space identification

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 11:37:56 PDT 2019


jdoerfert added a comment.

In D66197#1629810 <https://reviews.llvm.org/D66197#1629810>, @arsenm wrote:

> In D66197#1629784 <https://reviews.llvm.org/D66197#1629784>, @jdoerfert wrote:
>
> > Do we really need these to be "amdgpu" specific?
>
>
> I don't know what a generic intrinsic that does this would look like. This is pretty specific to these two cases, and in general I don't think pointer address spaces can be identified


I would have thought it could be pessimistically resolved in the IR or precise at runtime if the hardware supports that.
E.g.,

`if (__builtin_is_private(ptr)) { ... } else { ... }`

and we can fold

  %cast = addrspacecast i8 addrspace(1)* %gptr to i8*
  %is.private = call i1 @llvm.is.private(i8* %cast)

to `%is.private = true`


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

https://reviews.llvm.org/D66197





More information about the llvm-commits mailing list