[Mlir-commits] [mlir] [mlir][linalg][elementwise] Fold broadcast into new elementwise (PR #167626)

Julian Oppermann llvmlistbot at llvm.org
Thu Nov 27 14:56:30 PST 2025


https://github.com/jopperm commented:

The approach looks good to me. I want to point out that this already goes a bit beyond @rengolin's option 1: as the pass applies the patterns greedily, it handles chains of transposes and broadcasts automatically. IMHO this is useful.

I wonder whether the pattern should only fold if the elementwise's operand's map satisfies `isProjectedPermutation()`. My current understanding is that composing with the maps corresponding to the `linalg.transpose` and `linalg.broadcast` ops would preserve that property, and should help reversibility via the transform that @javedabsar1 linked.

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


More information about the Mlir-commits mailing list