[Mlir-commits] [llvm] [mlir] [mlir][tensor][linalg] Move RelayoutOpInterface from linalg back to tensor (PR #127533)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Feb 17 10:52:04 PST 2025


banach-space wrote:

> RelayoutOpInterface is used only to identify tensor.pack/tensor.unpack ops.

Please note that `tensor.pack` + `tensor.unpack` have been moved to Linalg. With this interface, Tensor depends on the interface rather than the whole dialect. I discuss this more in this PR:
* https://github.com/llvm/llvm-project/pull/125823

> What is the dependency that you mention between tensor and linalg?

That's needed here: https://github.com/llvm/llvm-project/blob/0d2722c20d75b237524dd4ec87a1d3da707ec96e/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp#L3914-L3918

@rengolin , I assumed that a dependency on an interface is fine. From https://mlir.llvm.org/docs/Interfaces/:
> Interfaces provide a generic way of interacting with the IR. The goal is to be able to **express transformations/analyses** in terms of these interfaces **without encoding specific knowledge** about the exact operation or dialect involved. This makes the compiler more easily extensible by allowing the addition of new dialects and operations in a decoupled way with respect to the implementation of transformations/analyses.

What's your interpretation of that paragraph? Is there a better mechanism to reject that pattern for Linalg Ops?

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


More information about the Mlir-commits mailing list