[Mlir-commits] [mlir] [mlir][bufferize] Add hoist-dynamic-allocs-option to buffer-results-to-out-params (PR #160985)

Matthias Springer llvmlistbot at llvm.org
Sat Sep 27 02:18:07 PDT 2025


================
@@ -164,15 +165,23 @@ struct BufferResultsToOutParamsOpts {
   bool addResultAttribute = false;
 
   /// If true, the pass eliminates the memref.alloc and memcpy if the returned
-  /// memref is allocated in the current function.
+  /// memref is static allocated in the current function.
   bool hoistStaticAllocs = false;
+
+  /// If true, the pass eliminates the memref.alloc and memcpy if the returned
+  /// memref is dynamic allocated in the current function.
+  bool hoistDynamicAllocs = false;
+
+  /// It maps the shape source of the dynamic shape memref returned by each
+  /// function.
+  llvm::DenseMap<func::FuncOp, SmallVector<SmallVector<Value>>> dynamicSizesMap;
----------------
matthias-springer wrote:

This is not really an option because you populate the field during the transformation. Can you pass this as a separate function parameter?

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


More information about the Mlir-commits mailing list