[mlir][Linalg] Extend buffer allocation to support Linalg init tensors
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Tue, 6 Oct 2020 11:40:52 +0000 (11:40 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Tue, 6 Oct 2020 13:24:27 +0000 (13:24 +0000)
commitd8ee28b96ee77a466aea5e9ca9c6ed57b2194b4d
treec9692aa9ae5c62b66f769405285d8ff79dcce723
parent8fa45e1fd527269140c4e2a1652fef5500da16fd
[mlir][Linalg] Extend buffer allocation to support Linalg init tensors

This revision adds init_tensors support to buffer allocation for Linalg on tensors.
Currently makes the assumption that the init_tensors fold onto the first output tensors.

This assumption is not currently enforced or cast in stone and requires experimenting with tiling linalg on tensors for ops **without reductions**.

Still this allows progress towards the end-to-end goal.
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp
mlir/test/Transforms/buffer-placement-preparation.mlir
mlir/test/lib/Transforms/TestBufferPlacement.cpp