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

James Newling llvmlistbot at llvm.org
Tue Jun 3 10:01:29 PDT 2025


================
@@ -646,35 +646,40 @@ LogicalResult MemRefType::verify(function_ref<InFlightDiagnostic()> emitError,
 }
 
 bool MemRefType::areTrailingDimsContiguous(int64_t n) {
-  if (!isLastDimUnitStride())
-    return false;
+  return getLayout().isIdentity() ||
----------------
newling wrote:

```suggestion
  
```
If it's identity, the function `getMaxCollapsableTrailingDims` returns `n`

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


More information about the Mlir-commits mailing list