MLIR  16.0.0git
OneShotModuleBufferize.h
Go to the documentation of this file.
1 //===- OneShotModuleBufferize.h - Bufferization across Func. Boundaries ---===//
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 #ifndef MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
10 #define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
11 
12 namespace mlir {
13 
14 struct LogicalResult;
15 class ModuleOp;
16 
17 namespace bufferization {
18 class OneShotAnalysisState;
19 struct OneShotBufferizationOptions;
20 
21 /// Analyze `moduleOp` and its nested ops. Bufferization decisions are stored in
22 /// `state`.
23 LogicalResult analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state);
24 
25 /// Bufferize `op` and its nested ops that implement `BufferizableOpInterface`.
26 ///
27 /// Note: This function does not run One-Shot Analysis. No buffer copies are
28 /// inserted unless `options.copyBeforeWrite` is set, in which case buffers are
29 /// copied before every write.
30 LogicalResult bufferizeModuleOp(ModuleOp moduleOp,
31  const OneShotBufferizationOptions &options);
32 
33 /// Run One-Shot Module Bufferization on the given module. Performs a simple
34 /// function call analysis to determine which function arguments are
35 /// inplaceable. Then analyzes and bufferizes FuncOps one-by-one with One-Shot
36 /// Bufferize.
37 LogicalResult runOneShotModuleBufferize(
38  ModuleOp moduleOp,
39  const bufferization::OneShotBufferizationOptions &options);
40 
41 } // namespace bufferization
42 } // namespace mlir
43 
44 #endif // MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_ONESHOTMODULEBUFFERIZE_H
static llvm::ManagedStatic< PassManagerOptions > options
LogicalResult runOneShotModuleBufferize(ModuleOp moduleOp, const bufferization::OneShotBufferizationOptions &options)
Run One-Shot Module Bufferization on the given module.
LogicalResult bufferizeModuleOp(ModuleOp moduleOp, const OneShotBufferizationOptions &options)
Bufferize op and its nested ops that implement BufferizableOpInterface.
LogicalResult analyzeModuleOp(ModuleOp moduleOp, OneShotAnalysisState &state)
Analyze moduleOp and its nested ops.
Include the generated interface declarations.