[all-commits] [llvm/llvm-project] a70262: [mlir] add support for transform dialect value han...

ftynse via All-commits all-commits at lists.llvm.org
Thu Feb 9 04:11:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a702628843befd93e7ac074c299254ff90b9de63
      https://github.com/llvm/llvm-project/commit/a702628843befd93e7ac074c299254ff90b9de63
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M mlir/docs/Dialects/Transform.md
    M mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
    M mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td
    M mlir/include/mlir/Dialect/Transform/IR/TransformTypes.td
    M mlir/include/mlir/Dialect/Transform/Transforms/TransformInterpreterPassBase.h
    A mlir/include/mlir/Dialect/Transform/Utils/RaggedArray.h
    M mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
    M mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
    M mlir/lib/Dialect/Transform/IR/TransformTypes.cpp
    M mlir/lib/Dialect/Transform/Transforms/TransformInterpreterPassBase.cpp
    M mlir/test/Dialect/Linalg/transform-op-match.mlir
    M mlir/test/Dialect/Transform/check-use-after-free.mlir
    M mlir/test/Dialect/Transform/expensive-checks.mlir
    M mlir/test/Dialect/Transform/multi-arg-top-level-ops.mlir
    A mlir/test/Dialect/Transform/multi-arg-top-level-values.mlir
    M mlir/test/Dialect/Transform/ops-invalid.mlir
    M mlir/test/Dialect/Transform/test-dialect-injection.mlir
    M mlir/test/Dialect/Transform/test-interpreter.mlir
    M mlir/test/Dialect/Transform/transform-state-extension.mlir
    M mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp
    M mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.td
    M mlir/test/lib/Dialect/Transform/TestTransformDialectInterpreter.cpp

  Log Message:
  -----------
  [mlir] add support for transform dialect value handles

Introduce support for the third kind of values in the transform dialect:
value handles. Similarly to operation handles, value handles are
pointing to a set of values in the payload IR. This enables
transformation to be targeted at specific values, such as individual
results of a multi-result payload operation without indirecting through
the producing op or block arguments that previously could not be easily
addressed. This is expected to support a broad class of memory-oriented
transformations such as selective bufferization, buffer assignment, and
memory transfer management.

Value handles are functionally similar to operation handles and require
similar implementation logic. The most important change concerns the
handle invalidation mechanism where operation and value handles can
affect each other.

This patch includes two cleanups that make it easier to introduce value
handles:

  - `RaggedArray` structure that encapsulates the SmallVector of
    ArrayRef backed by flat SmallVector logic, frequently used in the
    transform interfaces implementation;

  - rewrite the tests that associated payload handles with an integer
    value `reinterpret_cast`ed as a pointer, which were a frequent
    source of confusion and crashes when adding more debugging
    facilities that can inspect the payload.

Reviewed By: springerm

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




More information about the All-commits mailing list