[mlir] Introduce CloneOp and adapt test cases in BufferDeallocation.
authorJulian Gross <julian.gross@dfki.de>
Thu, 18 Mar 2021 13:07:49 +0000 (14:07 +0100)
committerJulian Gross <julian.gross@dfki.de>
Mon, 29 Mar 2021 08:19:10 +0000 (10:19 +0200)
commit06b03800f3fcbf49f5ddd4145b40f04e4ba4eb42
treece3fffa9df8396571d1bc805729bcdff31b9e801
parent3a68c6d26c9438eff1dc4483082076d3b1e117b5
[mlir] Introduce CloneOp and adapt test cases in BufferDeallocation.

Add a new clone operation to the memref dialect. This operation implicitly
copies data from a source buffer to a new buffer. In contrast to the linalg.copy
operation, this operation does not accept a target buffer as an argument.
Instead, this operation performs a conceptual allocation which does not need to
be performed manually.

Furthermore, this operation resolves the dependency from the linalg-dialect
in the BufferDeallocation pass. In addition, we also extended the canonicalization
patterns to fold clone operations. The copy removal pass has been removed.

Differential Revision: https://reviews.llvm.org/D99172
18 files changed:
mlir/docs/BufferDeallocationInternals.md
mlir/include/mlir/Dialect/MemRef/IR/MemRef.h
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
mlir/include/mlir/Dialect/MemRef/Utils/MemRefUtils.h [new file with mode: 0644]
mlir/include/mlir/Transforms/BufferUtils.h
mlir/include/mlir/Transforms/Passes.h
mlir/include/mlir/Transforms/Passes.td
mlir/lib/Dialect/MemRef/CMakeLists.txt
mlir/lib/Dialect/MemRef/IR/CMakeLists.txt [deleted file]
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp [new file with mode: 0644]
mlir/lib/Transforms/BufferDeallocation.cpp
mlir/lib/Transforms/BufferUtils.cpp
mlir/lib/Transforms/CMakeLists.txt
mlir/lib/Transforms/CopyRemoval.cpp [deleted file]
mlir/test/Transforms/buffer-deallocation.mlir
mlir/test/Transforms/canonicalize.mlir
mlir/test/Transforms/copy-removal.mlir [deleted file]