[all-commits] [llvm/llvm-project] 00eaff: [mlir][bufferization] Add tensor-like and buffer-l...

Andrei Golubev via All-commits all-commits at lists.llvm.org
Tue Apr 15 02:39:11 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00eaff3e9c897c263a879416d0f151d7ca7eeaff
      https://github.com/llvm/llvm-project/commit/00eaff3e9c897c263a879416d0f151d7ca7eeaff
  Author: Andrei Golubev <andrey.golubev at intel.com>
  Date:   2025-04-15 (Tue, 15 Apr 2025)

  Changed paths:
    A mlir/include/mlir/Dialect/Bufferization/IR/BufferizationTypeInterfaces.h
    A mlir/include/mlir/Dialect/Bufferization/IR/BufferizationTypeInterfaces.td
    M mlir/include/mlir/Dialect/Bufferization/IR/CMakeLists.txt
    M mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
    M mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
    A mlir/test/Dialect/Bufferization/Transforms/tensorlike-bufferlike.mlir
    M mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
    A mlir/test/lib/Dialect/Bufferization/TestTensorLikeAndBufferLike.cpp
    M mlir/test/lib/Dialect/Test/CMakeLists.txt
    M mlir/test/lib/Dialect/Test/TestTypeDefs.td
    M mlir/test/lib/Dialect/Test/TestTypes.h
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir][bufferization] Add tensor-like and buffer-like interfaces (#134220)

Current one-shot bufferization infrastructure operates on top of
TensorType and BaseMemRefType. These are non-extensible base classes of
the respective builtins: tensor and memref. Thus, the infrastructure is
bound to work only with builtin tensor/memref types. At the same time,
there are customization points that allow one to provide custom logic to
control the bufferization behavior.

This patch introduces new type interfaces: tensor-like and buffer-like
that aim to supersede TensorType/BaseMemRefType within the bufferization
dialect and allow custom tensors / memrefs to be used. Additionally,
these new type interfaces are attached to the respective builtin types
so that the switch is seamless.

Note that this patch does very minimal initial work, it does NOT
refactor bufferization infrastructure.

See https://discourse.llvm.org/t/rfc-changing-base-types-for-tensors-and-memrefs-from-c-base-classes-to-type-interfaces/85509



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list