[all-commits] [llvm/llvm-project] d62964: [mlir][OpDSL] Add support for adding canonicalizat...

Tobias Gysi via All-commits all-commits at lists.llvm.org
Tue Mar 8 08:00:17 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d629645fcdf30576b1d4dc9ea2639321c4b33eae
      https://github.com/llvm/llvm-project/commit/d629645fcdf30576b1d4dc9ea2639321c4b33eae
  Author: gysit <gysit at google.com>
  Date:   2022-03-08 (Tue, 08 Mar 2022)

  Changed paths:
    M mlir/docs/Dialects/Linalg/OpDSL.md
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
    M mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py
    M mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
    M mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
    R mlir/test/python/dialects/linalg/opdsl/interfaces.py
    A mlir/test/python/dialects/linalg/opdsl/metadata.py
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

  Log Message:
  -----------
  [mlir][OpDSL] Add support for adding canonicalization patterns.

Extend OpDSL with a `defines` method that can set the `hasCanonicalizer` flag for an OpDSL operation. If the flag is set via `defines(Canonicalizer)` the operation needs to implement the `getCanonicalizationPatterns` method. The revision specifies the flag for linalg.fill_tensor and adds an empty `FillTensorOp::getCanonicalizationPatterns` implementation.

This revision is a preparation step to replace linalg.fill by its OpDSL counterpart linalg.fill_tensor. The two are only functionally equivalent if both specify the same canonicalization patterns. The revision is thus a prerequisite for the linalg.fill replacement.

Depends On D120725

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D120726




More information about the All-commits mailing list