[Mlir-commits] [mlir] [MLIR] Add pattern to bubble up tensor.extract_slice (PR #126898)
ofri frishman
llvmlistbot at llvm.org
Sun Feb 16 05:42:45 PST 2025
ofri-frishman wrote:
> Let me suggest a partial solution.
>
> We should be able to identify relevant transformations by simply "grep"-ing for "interesting" Ops in the test directory. For this to work, we need to make sure that:
>
> * we have good (meaningful + descriptive) test file names,
> * we have good (meaningful + descriptive) function names,
> * we test patterns in isolation and document what patterns are being excercised (e.g. [here](https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Vector/vector-transfer-permutation-lowering.mlir#L5)).
>
> As a stepping stone, @ofri-frishman, please make sure that the new pattern is tested in isolation. As for the right location, there seems to be 2 good candidates:
>
> * "mlir/lib/Dialect/Linalg/Transforms/BubbleUpExtractSlice.cpp",
> * "mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp".
>
> This pattern feels like "bubbling up" to me, though "swap" might be more fitting actually. Just to avoid bike-shedding, I suggest "BubbleUpExtractSlice.cpp", but lets note (in comments) that this is basically a "swap". We can re-visit later.
I amended the commit and added a separate transform op to apply the pattern directly + tests that isolate the pattern.
Moved the pattern to "mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp".
Added a comment about the pattern currently being a bubble up pattern but that there is a possibility to rework it into a swap pattern.
https://github.com/llvm/llvm-project/pull/126898
More information about the Mlir-commits
mailing list