[Mlir-commits] [mlir] [mlir][bufferization] Add tensor-like and memref-like interfaces (PR #134220)

Matthias Springer llvmlistbot at llvm.org
Mon Apr 7 05:34:54 PDT 2025


================
@@ -0,0 +1,42 @@
+//===- BufferizationTypeInterfaces.td - Type Interfaces ----*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the definition file for type interfaces used in Bufferization.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef BUFFERIZATION_TYPE_INTERFACES
+#define BUFFERIZATION_TYPE_INTERFACES
+
+include "mlir/IR/OpBase.td"
+
+def Bufferization_TensorLikeTypeInterface
+    : TypeInterface<"TensorLikeType"> {
+  let cppNamespace = "::mlir::bufferization";
+  let description = [{
+    Indicates that this type is a tensor type (similarly to a MLIR builtin
+    tensor) for bufferization purposes.
+
+    The interface currently has no methods as it is used by types to opt into
+    being supported by the bufferization procedures.
+  }];
+}
+
+def Bufferization_MemRefLikeTypeInterface
----------------
matthias-springer wrote:

Can ask for one more change? The term used in the bufferization is "buffer", not memref. Can we change this to `BufferLikeTypeInterface`? E.g., we have `getBufferType` in `BufferizableOpInterface`.

https://github.com/llvm/llvm-project/pull/134220


More information about the Mlir-commits mailing list