[mlir][Linalg] Add layout specification support to bufferization.
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Tue, 13 Jul 2021 10:20:10 +0000 (10:20 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Tue, 13 Jul 2021 10:22:18 +0000 (10:22 +0000)
commite312fc49ae1ec86999676edc9c02a4ac0bc39cec
treeac276db0ae424b3853fdc3d43a9b9c8861308743
parentad2c66ec5d4bb0425625155bba966732ef85e6e5
[mlir][Linalg] Add layout specification support to bufferization.

Previously, linalg bufferization always had to be conservative at function boundaries and assume the most dynamic strided memref layout.
This revision introduce the mechanism to specify a  linalg.buffer_layout function argument attribute that carries an affine map used to set a less pessimistic layout.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D105859
mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir