[Mlir-commits] [mlir] [MLIR][Spirv] Don't lower tensors that can't be represented by an ArrayType (PR #171002)

Stefan Weigl-Bosker llvmlistbot at llvm.org
Mon Dec 8 08:18:19 PST 2025


================
@@ -502,6 +502,11 @@ static Type convertTensorType(const spirv::TargetEnv &targetEnv,
                << type << " illegal: cannot handle zero-element tensors\n");
     return nullptr;
   }
+  if (arrayElemCount > std::numeric_limits<unsigned>::max()) {
----------------
sweiglbosker wrote:

iirc the spec says array length is unbounded, so i think we can choose whatever sane limit we want? But yeah I asked about `unsigned` usage because if we were to use `int64_t` we wouldn’t have to worry about ub like this at all during conversion. So if there is no reason for the `unsigned` usage id suggest changing to `int64_t`

https://github.com/llvm/llvm-project/pull/171002


More information about the Mlir-commits mailing list