tra added a comment.

LGTM. This could be useful for other types. 
E.g. `long double` is technically not supported by NVPTX. We current demote it 
to double, so host-side does not cause errors, but ideally it should be treated 
similar to what you propose for i128 here.



================
Comment at: clang/lib/Sema/Sema.cpp:1858-1859
 void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
-  if (!LangOpts.SYCLIsDevice && !(LangOpts.OpenMP && LangOpts.OpenMPIsDevice))
+  if (!LangOpts.SYCLIsDevice && !(LangOpts.OpenMP && LangOpts.OpenMPIsDevice) 
&&
+      !LangOpts.CUDAIsDevice)
     return;
----------------
Nit:I'd rephrase it a bit to make it a bit easier to understand (less 
negations).



================
Comment at: clang/lib/Sema/SemaType.cpp:1498-1500
     if (!S.Context.getTargetInfo().hasInt128Type() &&
-        !S.getLangOpts().SYCLIsDevice &&
+        !S.getLangOpts().SYCLIsDevice && !S.getLangOpts().CUDAIsDevice &&
         !(S.getLangOpts().OpenMP && S.getLangOpts().OpenMPIsDevice))
----------------
Similarly, here I'd separate the check for i128 support by the target and the 
compilation mode check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111047

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

Reply via email to