[Mlir-commits] [mlir] [MLIR][MemRef] Validate linear size before lowering allocs (PR #179155)

Jakub Kuderski llvmlistbot at llvm.org
Mon Feb 2 06:03:03 PST 2026


================
@@ -116,8 +118,16 @@ void ConvertToLLVMPattern::getMemRefDescriptorSizes(
     bool useSizeAsStride = stride == 1;
     if (staticSize == ShapedType::kDynamic)
       stride = ShapedType::kDynamic;
-    if (stride != ShapedType::kDynamic)
-      stride *= staticSize;
+    if (stride != ShapedType::kDynamic) {
+      auto res = llvm::checkedMul(stride, staticSize);
----------------
kuhar wrote:

can you spell out the type here?

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


More information about the Mlir-commits mailing list