[all-commits] [llvm/llvm-project] e4a503: [mlir][Linalg] Introduce a ContractionOpInterface

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Thu Feb 4 09:03:28 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e4a503a26d55bbb9c6589ceb7371ebad04b8a55e
      https://github.com/llvm/llvm-project/commit/e4a503a26d55bbb9c6589ceb7371ebad04b8a55e
  Author: Nicolas Vasilache <nicolas.vasilache at gmail.com>
  Date:   2021-02-04 (Thu, 04 Feb 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc
    M mlir/include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
    M mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
    M mlir/test/lib/Transforms/TestLinalgTransforms.cpp
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp

  Log Message:
  -----------
  [mlir][Linalg] Introduce a ContractionOpInterface

This revision takes advantage of recent extensions to vectorization to refactor contraction detection into a bona fide Linalg interface.
The mlit-linalg-ods-gen parser is extended to support adding such interfaces.
The detection that was originally enabling vectorization is refactored to serve as both a test on a generic LinalgOp as well as to verify ops that declare to conform to that interface.

This is plugged through Linalg transforms and strategies but it quickly becomes evident that the complexity and rigidity of the C++ class based templating does not pay for itself.
Therefore, this revision changes the API for vectorization patterns to get rid of templates as much as possible.
Variadic templates are relegated to the internals of LinalgTransformationFilter as much as possible and away from the user-facing APIs.

It is expected other patterns / transformations will follow the same path and drop as much C++ templating as possible from the class definition.

Differential revision: https://reviews.llvm.org/D95973




More information about the All-commits mailing list