[mlir][bufferize] Better implementation of AnalysisState::isTensorYielded
authorMatthias Springer <springerm@google.com>
Wed, 15 Jun 2022 08:15:09 +0000 (10:15 +0200)
committerMatthias Springer <springerm@google.com>
Wed, 15 Jun 2022 08:15:47 +0000 (10:15 +0200)
commita36c801d127a2c4264ce0b7d1377b491409603cc
treefd2733187d9c6ed3cd927c37d2d97a9c2a97eff9
parent0f72a0d2aea33b2264daa90f9127c31934ef98d1
[mlir][bufferize] Better implementation of AnalysisState::isTensorYielded

If `create-deallocs=0`, mark all bufferization.alloc_tensor ops as escaping. (Unless they already have an `escape` attribute.) In the absence of analysis information, check SSA use-def chains to see if the value may be yielded.

Differential Revision: https://reviews.llvm.org/D127302
mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
mlir/lib/Dialect/Bufferization/Transforms/TensorCopyInsertion.cpp
mlir/test/Dialect/Bufferization/Transforms/tensor-copy-insertion.mlir