MLIR  19.0.0git
Passes.h
Go to the documentation of this file.
1 //===- Passes.h - Bufferization pipeline entry points -----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This header file defines prototypes of all bufferization pipelines.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_BUFFERIZATION_PIPELINES_PASSES_H
14 #define MLIR_DIALECT_BUFFERIZATION_PIPELINES_PASSES_H
15 
17 #include "mlir/Pass/PassOptions.h"
18 
19 namespace mlir {
20 namespace bufferization {
21 
22 /// Options for the buffer deallocation pipeline.
24  : public PassPipelineOptions<BufferDeallocationPipelineOptions> {
25  PassOptions::Option<bool> privateFunctionDynamicOwnership{
26  *this, "private-function-dynamic-ownership",
27  llvm::cl::desc(
28  "Allows to add additional results to private functions to return "
29  "ownership of returned memrefs to callers. This can avoid spurious "
30  "buffer clones in the callee."),
31  llvm::cl::init(false)};
32 
33  /// Implicit conversion to `DeallocationOptions`.
34  operator DeallocationOptions() const {
35  DeallocationOptions options;
37  return options;
38  }
39 };
40 
41 //===----------------------------------------------------------------------===//
42 // Building and Registering.
43 //===----------------------------------------------------------------------===//
44 
45 /// Adds the buffer deallocation pipeline to the `OpPassManager`. This
46 /// is the standard pipeline for deallocating the MemRefs introduced by the
47 /// One-Shot bufferization pass.
49  OpPassManager &pm, const BufferDeallocationPipelineOptions &options);
50 
51 /// Registers all pipelines for the `bufferization` dialect. Currently,
52 /// this includes only the "buffer-deallocation-pipeline".
54 
55 } // namespace bufferization
56 } // namespace mlir
57 
58 #endif // MLIR_DIALECT_BUFFERIZATION_PIPELINES_PASSES_H
static llvm::ManagedStatic< PassManagerOptions > options
This class represents a pass manager that runs passes on either a specific operation type,...
Definition: PassManager.h:48
Subclasses of PassPipelineOptions provide a set of options that can be used to initialize a pass pipe...
Definition: PassOptions.h:330
void registerBufferizationPipelines()
Registers all pipelines for the bufferization dialect.
void buildBufferDeallocationPipeline(OpPassManager &pm, const BufferDeallocationPipelineOptions &options)
Adds the buffer deallocation pipeline to the OpPassManager.
Include the generated interface declarations.
Options for the buffer deallocation pipeline.
Definition: Passes.h:24
PassOptions::Option< bool > privateFunctionDynamicOwnership
Definition: Passes.h:25
Options for BufferDeallocationOpInterface-based buffer deallocation.