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

Matthias Springer llvmlistbot at llvm.org
Thu Jun 11 02:30:39 PDT 2026


================
@@ -364,6 +372,13 @@ struct BufferizationOptions {
   DefaultMemorySpaceFn defaultMemorySpaceFn =
       [](TensorLikeType t) -> std::optional<Attribute> { return Attribute(); };
 
+  /// Hook to reconcile two buffer types that were independently inferred for
+  /// the same bufferized value (e.g. init_arg vs. yielded value in `scf.for`,
+  /// branches of `scf.if`, cases of `scf.index_switch`). The default keeps the
+  /// framework behavior (promote to fully-dynamic layout on layout mismatch,
+  /// fail on memory-space mismatch).
+  ReconcileBufferTypeMismatchFn reconcileBufferTypeMismatchFn = nullptr;
----------------
matthias-springer wrote:

You can move down the comment about the default value to here.

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


More information about the Mlir-commits mailing list