Skip to content

Conversation

@matthias-springer
Copy link
Member

Add an overload that does not take any options and uses the default options instead.

@llvmbot llvmbot added mlir mlir:bufferization Bufferization infrastructure labels Dec 9, 2025
@matthias-springer matthias-springer changed the title [mlir][bufferization] Add convenience overload for buildBufferDeallocationPipeline [mlir][bufferization][NFC] Add convenience overload for buildBufferDeallocationPipeline Dec 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 9, 2025

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-bufferization

Author: Matthias Springer (matthias-springer)

Changes

Add an overload that does not take any options and uses the default options instead.


Full diff: https://github.com/llvm/llvm-project/pull/171305.diff

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Bufferization/Pipelines/Passes.h (+1)
  • (modified) mlir/lib/Dialect/Bufferization/Pipelines/BufferizationPipelines.cpp (+7-1)
diff --git a/mlir/include/mlir/Dialect/Bufferization/Pipelines/Passes.h b/mlir/include/mlir/Dialect/Bufferization/Pipelines/Passes.h
index f220d20ad3a1f..e4d5b81f52577 100644
--- a/mlir/include/mlir/Dialect/Bufferization/Pipelines/Passes.h
+++ b/mlir/include/mlir/Dialect/Bufferization/Pipelines/Passes.h
@@ -47,6 +47,7 @@ struct BufferDeallocationPipelineOptions
 /// One-Shot bufferization pass.
 void buildBufferDeallocationPipeline(
     OpPassManager &pm, const BufferDeallocationPipelineOptions &options);
+void buildBufferDeallocationPipeline(OpPassManager &pm);
 
 /// Registers all pipelines for the `bufferization` dialect. Currently,
 /// this includes only the "buffer-deallocation-pipeline".
diff --git a/mlir/lib/Dialect/Bufferization/Pipelines/BufferizationPipelines.cpp b/mlir/lib/Dialect/Bufferization/Pipelines/BufferizationPipelines.cpp
index 51feec79e2174..f8eb45c7f323b 100644
--- a/mlir/lib/Dialect/Bufferization/Pipelines/BufferizationPipelines.cpp
+++ b/mlir/lib/Dialect/Bufferization/Pipelines/BufferizationPipelines.cpp
@@ -17,6 +17,10 @@
 // Pipeline implementation.
 //===----------------------------------------------------------------------===//
 
+void mlir::bufferization::buildBufferDeallocationPipeline(OpPassManager &pm) {
+  buildBufferDeallocationPipeline(pm, BufferDeallocationPipelineOptions());
+}
+
 void mlir::bufferization::buildBufferDeallocationPipeline(
     OpPassManager &pm, const BufferDeallocationPipelineOptions &options) {
   memref::ExpandReallocPassOptions expandAllocPassOptions{
@@ -44,5 +48,7 @@ void mlir::bufferization::registerBufferizationPipelines() {
       "The default pipeline for automatically inserting deallocation "
       "operations after one-shot bufferization. Deallocation operations "
       "(except `memref.realloc`) may not be present already.",
-      buildBufferDeallocationPipeline);
+      [](OpPassManager &pm, const BufferDeallocationPipelineOptions &options) {
+        buildBufferDeallocationPipeline(pm, options);
+      });
 }

Copy link
Member

@maerhart maerhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthias-springer matthias-springer merged commit 182a59d into main Dec 9, 2025
13 checks passed
@matthias-springer matthias-springer deleted the users/matthias-springer/pipeline_overload branch December 9, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mlir:bufferization Bufferization infrastructure mlir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants