[all-commits] [llvm/llvm-project] 40a8bd: [mlir] use side effects in the Transform dialect

ftynse via All-commits all-commits at lists.llvm.org
Fri Apr 22 14:29:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40a8bd635b08f310e4f95b0789a70953bba1e645
      https://github.com/llvm/llvm-project/commit/40a8bd635b08f310e4f95b0789a70953bba1e645
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2022-04-22 (Fri, 22 Apr 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Transform/IR/TransformDialect.h
    M mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td
    A mlir/include/mlir/Dialect/Transform/IR/TransformEffects.td
    M mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
    M mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
    M mlir/lib/Dialect/Transform/IR/CMakeLists.txt
    M mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
    M mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
    M mlir/lib/Dialect/Transform/IR/TransformOps.cpp
    M mlir/test/Dialect/Transform/ops-invalid.mlir
    M mlir/test/Dialect/Transform/ops.mlir
    M mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp
    M mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.td
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir] use side effects in the Transform dialect

Currently, the sequence of Transform dialect operations only supports a single
use of each operand (verified by the `transform.sequence` operation). This was
originally motivated by the need to guard against accessing a payload IR
operation associated with a transform IR value after this operation has likely
been rewritten by a transformation. However, not all Transform dialect
operations rewrite payload IR, in particular the "navigation" operation such as
`transform.pdl_match` do not.

Introduce memory effects to the Transform dialect operations to describe their
effect on the payload IR and the mapping between payload IR opreations and
transform IR values. Use these effects to replace the single-use rule, allowing
repeated reads and disallowing use-after-free, where operations with the "free"
effect are considered to "consume" the transform IR value and rewrite the
corresponding payload IR operations). As an additional improvement, this
enables code motion transformation on the transform IR itself.

Reviewed By: Mogball

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




More information about the All-commits mailing list