My plan is to add some sort of aggressive fusion option to the patterns to allow this fusion, but I'm not sure if it is necessary. In codegen, we probably want to try to propagate through these ops, since we want to push any reshapes as far as we can to the edges of the function. In dispatch creation, the same logic would make sense to me, but I am unsure how it will play with the fusion logic that follows it. My question is, is it worth adding an option for this at all, or should I just remove the restriction?
The current reshape propagation patterns upstream bail on multi-result operations, but the implementation seems to support such cases as far as I can tell: https://github.com/llvm/llvm-project/blob/3733528e521b7ee6af3950c65c3ff421c8fd0af6/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp#L1253-L1258
This gist is an example of where propagation through a multi result op is needed: https://gist.github.com/Max191/d95fad4a3a47d77c78dcb157f4f2eac7
My plan is to add some sort of aggressive fusion option to the patterns to allow this fusion, but I'm not sure if it is necessary. In codegen, we probably want to try to propagate through these ops, since we want to push any reshapes as far as we can to the edges of the function. In dispatch creation, the same logic would make sense to me, but I am unsure how it will play with the fusion logic that follows it. My question is, is it worth adding an option for this at all, or should I just remove the restriction?