Providing buffer assignment for MLIR
authorEhsan Toosi <ehsan.nadjaran_toosi@dfki.de>
Mon, 20 Apr 2020 10:41:14 +0000 (12:41 +0200)
committerMarcel Koester <marcel.koester@dfki.de>
Tue, 28 Apr 2020 08:17:59 +0000 (10:17 +0200)
commit5c352e69e76a26e4eda075e20aa6a9bb7686042c
treecfa9040326d350e6751ac2d1e5bb3fdf5ab8f3e2
parentf03b505ee7f23018493b93e3828fc3672c6f903c
Providing buffer assignment for MLIR

We have provided a generic buffer assignment transformation ported from
TensorFlow. This generic transformation pass automatically analyzes the values
and their aliases (also in other blocks) and returns the valid positions for
Alloc and Dealloc operations. To find these positions, the algorithm uses the
block Dominator and Post-Dominator analyses. In our proposed algorithm, we have
considered aliasing, liveness, nested regions, branches, conditional branches,
critical edges, and independency to custom block terminators. This
implementation doesn't support block loops. However, we have considered this in
our design. For this purpose, it is only required to have a loop analysis to
insert Alloc and Dealloc operations outside of these loops in some special
cases.

Differential Revision: https://reviews.llvm.org/D78484
mlir/include/mlir/Transforms/BufferPlacement.h [new file with mode: 0644]
mlir/include/mlir/Transforms/Passes.h
mlir/include/mlir/Transforms/Passes.td
mlir/lib/Transforms/BufferPlacement.cpp [new file with mode: 0644]
mlir/lib/Transforms/CMakeLists.txt
mlir/test/Transforms/buffer-placement-prepration.mlir [new file with mode: 0644]
mlir/test/Transforms/buffer-placement.mlir [new file with mode: 0644]
mlir/test/lib/Transforms/CMakeLists.txt
mlir/test/lib/Transforms/TestBufferPlacement.cpp [new file with mode: 0644]
mlir/tools/mlir-opt/mlir-opt.cpp