The pattern is structured similar to other patterns like LinalgTilingPattern. The fusion patterns takes options that allows you to fuse with producers of multiple operands at once.
- The pattern fuses only at the level that is known to be legal, i.e if a reduction loop in the consumer is tiled, then fusion should happen "before" this loop. Some refactoring of the fusion code is needed to fuse only where it is legal.
- Since the fusion on buffers uses the LinalgDependenceGraph that is not mutable in place the fusion pattern keeps the original operations in the IR, but are tagged with a marker that can be later used to find the original operations.
This change also fixes an issue with tiling and distribution/interchange where if the tile size of a loop were 0 it wasnt account for in these.
Should you keep originalOp + fusedOp too ?
I realize you can access the originalOp from the pattern, it is more for symmetry/consistency.