[all-commits] [llvm/llvm-project] 930211: [mlir][python] Register linalg.ElementwiseOp wrapp...

Maksim Levental via All-commits all-commits at lists.llvm.org
Tue Sep 15 21:48:59 PDT 2026


  Branch: refs/heads/users/makslevental/fix-linalg-elemwise
  Home:   https://github.com/llvm/llvm-project
  Commit: 9302119614292df67443f705fd4337eb52f65277
      https://github.com/llvm/llvm-project/commit/9302119614292df67443f705fd4337eb52f65277
  Author: makslevental <maksim.levental at gmail.com>
  Date:   2026-09-15 (Tue, 15 Sep 2026)

  Changed paths:
    M mlir/python/mlir/dialects/linalg/__init__.py
    M mlir/test/python/dialects/linalg/ops.py

  Log Message:
  -----------
  [mlir][python] Register linalg.ElementwiseOp wrapper as op view

The hand-written ElementwiseOp wrapper subclassed the generated OpView but
was not registered in the op-view registry, so ops reconstructed from the
registry (e.g. Operation.opview) were instances of the generated base class
rather than the publicly exported subclass. This made
isinstance(op.opview, linalg.ElementwiseOp) and match/case dispatch return
False for real linalg.elementwise ops.

Register the wrapper with replace=True (as pdl.py does) so the exported
class is the one the registry instantiates.

Fixes #223673


  Commit: 2d7343a53ba65d4cab5470e79a0c2e51130ba71b
      https://github.com/llvm/llvm-project/commit/2d7343a53ba65d4cab5470e79a0c2e51130ba71b
  Author: makslevental <maksim.levental at gmail.com>
  Date:   2026-09-15 (Tue, 15 Sep 2026)

  Changed paths:
    M mlir/test/python/dialects/linalg/ops.py

  Log Message:
  -----------
  Remove comment per review


Compare: https://github.com/llvm/llvm-project/compare/d6b8eef28ce6...2d7343a53ba6

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list