[Mlir-commits] [mlir] [mlir] [linalg] Add canonicalize pattern to swap transpose with broadcast (PR #97063)

Diego Caballero llvmlistbot at llvm.org
Thu Jul 4 10:45:25 PDT 2024


https://github.com/dcaballe commented:

This looks like an interesting canonicalization, indeed! 

Two side effects we should watch out for: 

1) This may lead to not only lit test failures but also to performance regressions if we turn a transpose with a highly optimized lowering into a simpler transpose that falls into a default lowering path. 
2) We may get some performance improvements if we get rid of the transpose in `transpose(broadcast(1D->2D))` (assuming the transpose is not already optimized away somehow). We should add a test for this scenario.

An interesting follow-up would be to consider scenarios where a type conversion happens between the broadcast and the transpose.

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


More information about the Mlir-commits mailing list