[Mlir-commits] [mlir] [mlir][linalg] Extend elementwise (PR #124661)

Rolf Morel llvmlistbot at llvm.org
Tue Feb 4 04:13:10 PST 2025


rolfmorel wrote:

Sorry to bring this up late, but I feel others might also have missed the elephant in the room: 

### How is this new `linalg.elementwise`/`linalg.elemwise` op supposed to relate to the existing `linalg.elemwise_unary` and `linalg.elemwise_binary` ops?

Somehow I completely missed that these ops already exist. TBF, the RFC and PRs seem to have left this topic out as well.

@javedabsar1, given that their existence provides a clear design alternative (i.e. extend them to support indexing maps and call it a day), could you help me/us understand the benefit of going with a new op? In particular:
 - What's the benefit of lumping these ops under just one op? That is, is there a benefit to lumping arities?
 - Is the intention to deprecate  `linalg.elemwise_unary` and `linalg.elemwise_binary`?
   - If not, why not keep the IR representation much closer to the existing ops? E.g. just a `fun` attribute in attr-dict instead of discussing `kind` etc.

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


More information about the Mlir-commits mailing list