MLIR  18.0.0git
BufferizationPipelines.cpp
Go to the documentation of this file.
1 //===- BufferizationPipelines.cpp - Pipelines for bufferization -----------===//
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 
10 
14 #include "mlir/Pass/PassManager.h"
15 #include "mlir/Transforms/Passes.h"
16 
17 //===----------------------------------------------------------------------===//
18 // Pipeline implementation.
19 //===----------------------------------------------------------------------===//
20 
23  pm.addPass(memref::createExpandReallocPass(/*emitDeallocs=*/false));
26  options.privateFunctionDynamicOwnership.getValue()));
30  pm.addPass(createCSEPass());
32 }
33 
34 //===----------------------------------------------------------------------===//
35 // Pipeline registration.
36 //===----------------------------------------------------------------------===//
37 
40  "buffer-deallocation-pipeline",
41  "The default pipeline for automatically inserting deallocation "
42  "operations after one-shot bufferization. Deallocation operations "
43  "(except `memref.realloc`) may not be present already.",
45 }
static llvm::ManagedStatic< PassManagerOptions > options
This class represents a pass manager that runs passes on either a specific operation type,...
Definition: PassManager.h:48
void addPass(std::unique_ptr< Pass > pass)
Add the given pass to this pass manager.
Definition: Pass.cpp:356
std::unique_ptr< Pass > createOwnershipBasedBufferDeallocationPass(bool privateFuncDynamicOwnership=false)
Creates an instance of the OwnershipBasedBufferDeallocation pass to free all allocated buffers.
void registerBufferizationPipelines()
Registers all pipelines for the bufferization dialect.
std::unique_ptr< Pass > createLowerDeallocationsPass()
Creates an instance of the LowerDeallocations pass to lower bufferization.dealloc operations to the m...
std::unique_ptr< Pass > createBufferDeallocationSimplificationPass()
Creates a pass that optimizes bufferization.dealloc operations.
void buildBufferDeallocationPipeline(OpPassManager &pm, const BufferDeallocationPipelineOptions &options)
Adds the buffer deallocation pipeline to the OpPassManager.
std::unique_ptr< Pass > createExpandReallocPass(bool emitDeallocs=true)
Creates an operation pass to expand memref.realloc operations into their components.
std::unique_ptr< Pass > createCSEPass()
Creates a pass to perform common sub expression elimination.
Definition: CSE.cpp:416
std::unique_ptr< Pass > createCanonicalizerPass()
Creates an instance of the Canonicalizer pass, configured with default settings (which can be overrid...
PassPipelineRegistration provides a global initializer that registers a Pass pipeline builder routine...
Definition: PassRegistry.h:174
Options for the buffer deallocation pipeline.
Definition: Passes.h:23