[Mlir-commits] [mlir] [MLIR] Fixing the memref linearization size computation (PR #138922)
Zhuoran Yin
llvmlistbot at llvm.org
Wed May 7 13:29:12 PDT 2025
jerryyin wrote:
@krzysz00 I was attempting to construct a minimal test case like:
```mlir
func.func @memref_alloca_load_i4_column(%arg0: index, %arg1: index) -> i4 {
%0 = memref.alloc() : memref<4x8xi4, strided<[8, 1]>>
%1 = memref.load %0[%arg0, %arg1] : memref<4x8xi4, strided<[8, 1]>>
return %1 : i4
}
```
But having this test case will fail the legalization and complained that the alloc is illegal.
> ** Failure : alloc-like operations should have been normalized
> "(anonymous namespace)::ExtractStridedMetadataOpAllocFolder<mlir::memref::AllocOp>" result 0
After some debugging, looks like it is triggered from below
https://github.com/llvm/llvm-project/blob/9da103ab9e656274357a1f09456431dac84ac549/mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp#L786-L789
It seems like non-identity memref was never supported before. Not sure I read it right on this. But if this is the case, then we can't seem to construct a column major or non-packed test case just because the op associated with it can't be legalized.
https://github.com/llvm/llvm-project/pull/138922
More information about the Mlir-commits
mailing list