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

Momchil Velikov llvmlistbot at llvm.org
Thu Jun 5 09:03:13 PDT 2025


================
@@ -646,35 +646,43 @@ LogicalResult MemRefType::verify(function_ref<InFlightDiagnostic()> emitError,
 }
 
 bool MemRefType::areTrailingDimsContiguous(int64_t n) {
-  if (!isLastDimUnitStride())
-    return false;
+  return getMaxContiguousTrailingDims() >= std::min(n, getRank());
----------------
momchil-velikov wrote:

Nope, no logic here, an assertion is more appropriate.

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


More information about the Mlir-commits mailing list