[mlir][linalg][bufferize][NFC] Analyze OpOperands instead of OpResults
authorMatthias Springer <springerm@google.com>
Fri, 7 Jan 2022 15:56:13 +0000 (00:56 +0900)
committerMatthias Springer <springerm@google.com>
Fri, 7 Jan 2022 16:00:30 +0000 (01:00 +0900)
commit8e2b6aac32d672e6eec18c65b77e002cd08033b1
tree46f27337f1f5cf0a792f78924f09610852f8d617
parente56a9c9b5b83923b8ed7b21994e6f9f11166aae0
[mlir][linalg][bufferize][NFC] Analyze OpOperands instead of OpResults

With this change, the analysis takes a look at OpOperands instead of OpResults. OpOperands can bufferize out-of-place (even if they have no aliasing OpResults). The analysis does no longer care about OpResults.

Previously, only OpResults could bufferize out-of-place, so OpOperands that have no aliasing OpResults were never copied by Comprehensive Bufferize. This does not fit wwell with the new CallOp bufferization that is introduced in a subsequent change. In essence, called FuncOps can then be treated as "black boxes" that may read/write to any bbArg, even if they do not return anything.

Differential Revision: https://reviews.llvm.org/D115706
mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.td
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizationInterfaceImpl.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/LinalgInterfaceImpl.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/TensorInterfaceImpl.cpp
mlir/test/Dialect/Linalg/comprehensive-bufferize-analysis-2fill-extract-matmul-all-perms.mlir
mlir/test/Dialect/Linalg/comprehensive-module-bufferize-analysis.mlir