[all-commits] [llvm/llvm-project] 5d9e85: [mlir][transform] Add TrackingListener

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Mar 29 02:10:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d9e858ae6d62b2d3b5f74bda8bb841ce0e630b0
      https://github.com/llvm/llvm-project/commit/5d9e858ae6d62b2d3b5f74bda8bb841ce0e630b0
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
    A mlir/include/mlir/Dialect/Tensor/TransformOps/TensorTransformOps.h
    M mlir/include/mlir/Dialect/Transform/IR/TransformOps.h
    M mlir/lib/Dialect/Tensor/CMakeLists.txt
    A mlir/lib/Dialect/Tensor/TransformOps/CMakeLists.txt
    A mlir/lib/Dialect/Tensor/TransformOps/TensorTransformOps.cpp
    M mlir/lib/Dialect/Transform/IR/TransformOps.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir][transform] Add TrackingListener

This change makes it possible to use a greedy pattern rewrite as part of a transform op, even if the transform op does not invalidate the target handle (in particular transform ops without `FunctionalStyleTransformOpTrait`) and the targeted op is not isolated from above.

The listener API allows us to track replacements of ops with values, but not ops with ops. Therefore, the TrackingListener is conservative: If an op is replaced with values that all have the same defining op and the defining op is of the same type as the original op, it is safe to assume that the op was replaced with an equivalent op. Otherwise, the op mapping is dropped. When this is not good enough, transforms can track values instead or provide a custom `findReplacementOp` function.

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




More information about the All-commits mailing list