[Mlir-commits] [mlir] [mlir][bufferization] Support custom types (1/N) (PR #142986)

Andrei Golubev llvmlistbot at llvm.org
Wed Jun 18 01:14:06 PDT 2025


================
@@ -57,7 +57,40 @@ struct BufferizationInlinerInterface : public DialectInlinerInterface {
 template <typename Tensor>
 struct BuiltinTensorExternalModel
     : TensorLikeType::ExternalModel<BuiltinTensorExternalModel<Tensor>,
-                                    Tensor> {};
+                                    Tensor> {
+  llvm::FailureOr<BufferLikeType> getBufferType(
+      mlir::Type tensor, const BufferizationOptions &options,
+      const BufferizationState &state,
+      llvm::function_ref<mlir::InFlightDiagnostic()> emitError) const {
+    auto tensorType = cast<TensorType>(tensor);
+    // Fall back to tensor -> memref conversion.
----------------
andrey-golubev wrote:

never mind, outdated comment that i missed when moving stuff around.

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


More information about the Mlir-commits mailing list