mgehre-amd wrote: There are very similar patterns in mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp. How are they related? Should the new pattern also live in that file? https://github.com/llvm/llvm-project/pull/126898