[mlir][bufferize] Extract buffer hoisting into separate function
authorMatthias Springer <springerm@google.com>
Tue, 15 Mar 2022 12:22:21 +0000 (21:22 +0900)
committerMatthias Springer <springerm@google.com>
Tue, 15 Mar 2022 12:25:03 +0000 (21:25 +0900)
commit39ec46bd83703364d6d4da1e2ca3b09fa12d7a6b
tree6c5d8b66618d08b0414da62126edc2363f2e8e7e
parent3227aa3aa83440ff94a3b13a29623e03b05098f2
[mlir][bufferize] Extract buffer hoisting into separate function

This improves the modularity of the bufferization.

From now on, all ops that do not implement BufferizableOpInterface are considered hoisting barriers. Previously, all ops that do not implement the interface were not considered barriers and such ops had to be marked as barriers explicitly. This was unsafe because we could've hoisted across unknown ops where it was not safe to hoist.

As a side effect, this allows for cleaning up AffineBufferizableOpInterfaceImpl. This build unit no longer needed and can be deleted.

Differential Revision: https://reviews.llvm.org/D121519
17 files changed:
mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/AffineInterfaceImpl.h [deleted file]
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/AffineInterfaceImpl.cpp [deleted file]
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp
mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/lib/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-partial.mlir
mlir/test/Dialect/Linalg/bufferize.mlir
mlir/test/Dialect/Linalg/comprehensive-module-bufferize-alloca.mlir
mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
mlir/test/Dialect/Tensor/bufferize.mlir
mlir/test/lib/Dialect/Linalg/CMakeLists.txt
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel