[Mlir-commits] [mlir] [mlir][bufferization] Introduce reconcileBufferTypeMismatchFn hook (PR #202667)

Matthias Springer llvmlistbot at llvm.org
Tue Jun 16 08:34:46 PDT 2026


================
@@ -273,6 +273,13 @@ struct BufferizationOptions {
   using DefaultMemorySpaceFn =
       std::function<std::optional<Attribute>(TensorLikeType t)>;
 
+  /// Resolve a mismatch between buffer types that were independently inferred,
+  /// which results in a conflict at the "merge" point. Returns `failure()` to
+  /// signal bufferization failure; returns a buffer-like type when
+  /// reconciliation suceeded.
+  using ReconcileBufferTypeMismatchFn = std::function<FailureOr<BufferLikeType>(
+      BufferLikeType x, BufferLikeType y, const BufferizationOptions &)>;
----------------
matthias-springer wrote:

nit: You can drop variable names `x` and `y` here

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


More information about the Mlir-commits mailing list