diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td --- a/mlir/include/mlir/Conversion/Passes.td +++ b/mlir/include/mlir/Conversion/Passes.td @@ -133,6 +133,30 @@ 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"]; }