[Mlir-commits] [mlir] [mlir][linalg] Enable CollapseLinalgDimensions to collapse linalg::CopyOp (PR #68526)

Nicolas Vasilache llvmlistbot at llvm.org
Wed Oct 11 07:50:56 PDT 2023


nicolasvasilache wrote:

> > Overall change looks reasonable. Some refactoring might make this better, but this throws up some design issues. Why is `CopyOp` treated specially? This should work for other Linalg named ops as well. An alternative would be to use matchers to match a `linalg.generic` and convert to a `linalg.copy` after it is collapsed. That way we could keep the two concerns separate (and having a matcher for `linalg.generic` -> `linalg.copy` might be helpful in other places as well.
> 
> Actually am fully convient with the current design also. I am afraid that by the time I will need to collapse the `linalg.copy` it would be hard to identify it was `linalg.copy` at the beginning (i.e. after fusion). Any idea how to solve it?

I don't have concerns with the current implementation.
In the future, when we finally have "specialize" patterns available, the changes will be very minimal.

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


More information about the Mlir-commits mailing list