[Mlir-commits] [mlir] [MLIR] Determine contiguousness of memrefs with dynamic dimensions (PR #142421)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Jun 6 10:07:52 PDT 2025


================
@@ -0,0 +1,210 @@
+//===- LayoutTest.cpp - unit tests related to memref layout --------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/MemRef/IR/MemRef.h"
+#include "mlir/IR/AffineMap.h"
+#include "mlir/IR/Builders.h"
+#include "mlir/IR/BuiltinTypes.h"
+#include "gtest/gtest.h"
+
+using namespace mlir;
+using namespace mlir::memref;
+
+TEST(MemRefLayout, maxContigDim) {
+  MLIRContext ctx;
+  OpBuilder b(&ctx);
+
+  const auto _ = ShapedType::kDynamic;
+  const auto f32 = b.getF32Type();
----------------
ftynse wrote:

https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable

In general, MLIR uses `auto` when the type is obvious from line-level context (cast, constructor) or too long to spell.

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


More information about the Mlir-commits mailing list