================
@@ -6197,15 +6200,16 @@ makeClusterDimsArgExpr(Sema &S, Expr *E, const 
CUDAClusterDimsAttr &AL,
         << &AL << Idx << AANT_ArgumentIntegerConstant << E->getSourceRange();
     return {};
   }
-  // Make sure we can fit it in 4 bits.
-  if (!I->isIntN(4)) {
-    S.Diag(E->getExprLoc(), diag::err_ice_too_large)
-        << toString(*I, 10, false) << 4 << /*Unsigned=*/1;
-    return {};
-  }
   if (*I < 0) {
     S.Diag(E->getExprLoc(), diag::warn_attribute_argument_n_negative)
         << &AL << Idx << E->getSourceRange();
+    return {};
+  }
+  // Make sure we can fit it in 16 bits, so the product below cannot overflow.
+  if (!I->isIntN(16)) {
----------------
shiltian wrote:

`int8_t` would also work if that's what you are going after. `int16_t` is not 
necessary, that's what I'm trying to say. If you are using `int8_t`, you also 
don't need to change the caller.

https://github.com/llvm/llvm-project/pull/230186
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to