[mlir] Added documentation for bufferization to memref conversion pass.

Added documentation to clearify the purpose of the bufferization to memref pass
and added some remarks.

Differential Revision: https://reviews.llvm.org/D115326
This commit is contained in:
Julian Gross 2021-12-08 11:29:47 +01:00
parent 21dbfd4300
commit 524d6a2d6a
1 changed files with 24 additions and 0 deletions

View File

@ -133,6 +133,30 @@ def ConvertAsyncToLLVM : Pass<"convert-async-to-llvm", "ModuleOp"> {
def ConvertBufferizationToMemRef : Pass<"convert-bufferization-to-memref"> {
let summary = "Convert operations from the Bufferization dialect to the "
"MemRef dialect";
let description = [{
This pass converts bufferization operations into memref operations.
In the current state, this pass only transforms a `bufferization.clone`
operation into `memref.alloc` and `memref.copy` operations. This conversion
is needed, since some clone operations could remain after applying several
transformation processes. Currently, only `canonicalize` transforms clone
operations or even eliminates them. This can lead to errors if any clone op
survived after all conversion passes (starting from the bufferization
dialect) are performed.
See:
https://llvm.discourse.group/t/bufferization-error-related-to-memref-clone/4665
To avoid these errors, this pass can be performed as a last clean-up pass to
transform remaining operations and to proceed in other dialects (memref
e.g.).
Note that this pass only transforms the operation without any further
analyses. This pass does not consider any memory analysis or optimization
and hence does not resolve any memory leaks.
}];
let constructor = "mlir::createBufferizationToMemRefPass()";
let dependentDialects = ["arith::ArithmeticDialect", "memref::MemRefDialect"];
}