[all-commits] [llvm/llvm-project] 2eb384: [MLIR][Linalg] Improve morphism semantics (#222959)

Renato Golin via All-commits all-commits at lists.llvm.org
Tue Sep 15 04:23:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2eb384fccbf866b34a84f86c0e1355a6caed0f0e
      https://github.com/llvm/llvm-project/commit/2eb384fccbf866b34a84f86c0e1355a6caed0f0e
  Author: Renato Golin <rengolin at systemcall.eu>
  Date:   2026-09-15 (Tue, 15 Sep 2026)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/IR/Linalg.h
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
    M mlir/include/mlir/Dialect/Linalg/Passes.td
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
    M mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    A mlir/test/Dialect/Linalg/categorize-named-ops.mlir
    M mlir/test/Dialect/Linalg/decompose-generic-by-unfolding-projected-permutation.mlir
    M mlir/test/Dialect/Linalg/generalize-named-ops.mlir
    M mlir/test/Dialect/Linalg/specialize-generic-ops.mlir

  Log Message:
  -----------
  [MLIR][Linalg] Improve morphism semantics (#222959)

As exposed on the issues linked, the linalg morphism semantics could be
improved.

This PR changes the following semantics:
* Completes support for `-linalg-morph-ops` to include contractions and
ternary elementwise.
* Adds a `-linalg-categorize-ops`, which moves both named and generic
ops to category.
* Adds the possibility of "stopping at category" for both specialization
and generalization (not accessible from command line options but used by
the new categorize / old morph-ops pass).
* Removes the morphism options structure, since it's just a Boolean
flag.
* Improve test coverage, and make sure that `-linalg-morph-ops` does the
same thing as the other options.

It does NOT:
* Change the semantics of generalization, which continues to generalize
everything.
* Change the semantics of specialization, which continues to convert to
named or category whenever possible.

There's also come cleanups for the matching of elementwise that was
simpler as a `TypeSwitch`.

Fixes #221266 and #221191 

Assisted by: Claude Opus



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