[Mlir-commits] [mlir] [mlir][Tensor] Add rank-reducing slice in generatedSlices (PR #174248)
Bangtian Liu
llvmlistbot at llvm.org
Tue Jan 6 09:18:05 PST 2026
bangtianliu wrote:
> I think the issue here is that you have a producer that is to be fused on the outs operand. In the split-reduction case there is an extra rank-reducing slice that is thwarting the fusion. You can potentially use the output IR after the pattern runs in your downstream code as the input IR and use the transform operation that is just doing the fusion to demonstrate the error.
I tested whether tracking the rank-reducing slice in generatedSlices enables additional fusion with the default cleanup patterns.
Result: identical output with and without tracking. The reason is:
- The slice's source is the tiled producer (inside the loop)
- Default patterns (merge consecutive, bubble up, canonicalize) don't transform it to enable further fusion
I did add a test in the new commit. The tracking is primarily useful for cleanup patterns like SwapExtractSliceWithFillPatterns (not in the default cleanup patterns, so I documented in the added test) that can swap extract_slice(fill) → fill(extract_slice).
https://github.com/llvm/llvm-project/pull/174248
More information about the Mlir-commits
mailing list