[Mlir-commits] [mlir] [mlir][linalg] Produce canonical linalg.generic for im2col (PR #134675)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Apr 9 02:46:08 PDT 2025
fabrizio-indirli wrote:
I was advised that a possible reason for the current code (that hides the input access pattern inside the op body) is that the indexing maps of a linalg.generic must be invertible, as [linalg::GenericOp implements the _TilingInterface_](https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Linalg/IR/LinalgDialect.cpp#L144).
However an indexing map such as `affine_map<(d0, d1, d2) -> (d0, d1 floordiv 14 + d2 floordiv 12, d1 mod 14 + (d2 mod 12) floordiv 4, d2 mod 4)>` is not invertible and would break the requirement. In the current upstream implementation, this is "hidden" by sinking the input access pattern inside the op body, instead of exposing it in the linalg.generic's interface.
https://github.com/llvm/llvm-project/pull/134675
More information about the Mlir-commits
mailing list