tra added a comment.

In D111665#3059989 <https://reviews.llvm.org/D111665#3059989>, @jdoerfert wrote:

> Except when it doesn't get instcombined away: https://godbolt.org/z/YE4EfEPde

Well, it does get translated into sensible PTX, so, while not ideal, it's not 
too big of a deal.
Using an integer is a sensible approach to prevent accidental load/store using 
a wrong address space.

An alternative would be to make conversion functions return a pointer with 
specific AS attribute, but that's clang-specific and it would not work for 
something that needs to plug in into CUDA headers that were written for NVCC.

So, yeah. It could be better, but it's tolerable. At least we didn't have to 
resort to using inline asm. :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111665

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to