[Mlir-commits] [mlir] [mlir] Allow blacklist ops for reduction linalg elementwise fusion (PR #144176)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jun 16 11:18:48 PDT 2025


MaheshRavishankar wrote:

> As @rengolin suggests, it is worth considering making this configurable as a function of the IR. In particular, I can see it being useful to be able to annotate a parent scope with a `#dlti.map<"reduction-fusion-blacklist" = "linalg.elementwise<mul>"` attribute and this fusion pass respecting this attribute _for this scope_. This could be achieved by doing a `dlti::query(op, ["reduction-fusion-blacklist"])` at any `op` which is being considered for fusion. (A step further would be to have DLTI attribute that acts like an actual cost model, taking into account, e.g. tensor dim sizes and hardware info available through other DLTI attributes.)
> 
> That also highlights that I am not sure the current approach works with the abstracted `linalg.elementwise<`_operator_`>` op. Does it?

Not sure about that. I am opposed to having any bespoke way of specifying "blacklist" etc. This is precisely why there is a call back to the fusion function that allows you to disallow any fusion you want based on cost model fro mthe caller without that leaking into the implementation of the function. All of these could live downstream and not try to have a bespoke way upstream.

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


More information about the Mlir-commits mailing list