[Mlir-commits] [mlir] [mlir][linalg] Extend `FuseElementwiseOps` pattern to work with named ops (PR #144922)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Nov 4 10:25:25 PST 2025
MaheshRavishankar wrote:
> Ok, makes sense. Although they would already have to generalize named ops to get any use out of the previous implementation anyway. So the end result would be the same, besides the change to `MapOp` that allows it to be generalized and, thus, fused.
>
Not everyone goes down named ops for all elementwise operations. Most common use case is that you use named ops for compute ops like matmul/convs/etc. and use generic ops for elementwise operations.
> I think I disagree. Users can already change their controlFn when calling `populateElementwiseOpsFusionPatterns` if they don't want to opt into this. Or if they aren't using this, but rather `fuseElementwiseOps` directly, they can still have their own logic to avoid calling this when they don't want to (just like `populateElementwiseOpsFusionPatterns` does). So I don't see any benefit in adding more code
There are many users of this functionality, all using this for elementwise operations. There is not much code duplication. The implementation is common, just a separate entry point without causing all downstream users to HAVE to update the controlFn. It would be good to not break the world.
https://github.com/llvm/llvm-project/pull/144922
More information about the Mlir-commits
mailing list