[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In 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

[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D111665#3059690 , @tra wrote: > In D111665#3059427 , @jdoerfert > wrote: > >> Not loving the magic constants here but I don't think we have a enum or >> similar right now. > > Yup.

[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Artem Belevich via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf526ee5b8517: [CUDA] Provide address space conversion builtins. (authored by tra). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111665/new/ https://reviews

[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D111665#3059427 , @jdoerfert wrote: > Not loving the magic constants here but I don't think we have a enum or > similar right now. Yup. > I also have to question the people that choose `size_t` here... we will end > up with int

[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision. jdoerfert added a comment. This revision is now accepted and ready to land. Not loving the magic constants here but I don't think we have a enum or similar right now. I also have to question the people that choose `size_t` here... we will end up with int2ptr(ptr

[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. Tested by verifying that generated code (both PTX and SASS) matches that of NVCC: https://godbolt.org/z/rWYYx63bT Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111665/new/ https://reviews.llvm.org/D111665

[PATCH] D111665: [CUDA] Provide address space conversion builtins.

2021-10-12 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision. tra added a reviewer: jdoerfert. Herald added subscribers: bixia, yaxunl. tra requested review of this revision. Herald added a project: clang. CUDA-11 headers rely on these NVCC builtins. Despite having `__nv` previx, those are *not* provided by libdevice. Repository: