[PATCH] D92439: Fix missing error for use of 128-bit integer inside SPIR64 device code.

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 09:19:38 PST 2020


jdoerfert added a comment.

So, NVPTX seems to do something sensible with i128, though I haven't done rigorous testing.



================
Comment at: clang/lib/Sema/Sema.cpp:241
+      (Context.getAuxTargetInfo() &&
+       Context.getAuxTargetInfo()->hasInt128Type())) {
     // If either of the 128-bit integer types are unavailable to name lookup,
----------------
jyu2 wrote:
> jdoerfert wrote:
> > I don't understand why this (and the changes below) are necessary. Host and device compilation are separate. This should not be any different to CUDA, HIP, or OpenMP offload which seem not to require this.
> As far as I can know, in real compile, the auxtarget should be also set for example SYCL.  May be that is only for our compiler.  I am not sure what do you mean by it should same with CUDA, HIP...?  Do you mean, CUDA(or HIP...) target should also not support 128-bit integer?  If so, I don't see any error emit for CUDA when I try with nvptx64-nvidia-cuda.
> 
> Thanks.
> 
I'm not saying auxtarget is not set. I'm trying to understand why this is necessary. Why would you initialize `__int128_t` if your target doesn't support it? What happens if you only include the SPIR.h change?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92439



More information about the cfe-commits mailing list