[mlir][bufferize] Improve resolveConflicts for ExtractSliceOp
authorMatthias Springer <springerm@google.com>
Thu, 9 Jun 2022 20:14:53 +0000 (22:14 +0200)
committerMatthias Springer <springerm@google.com>
Thu, 9 Jun 2022 20:19:37 +0000 (22:19 +0200)
commit87b46776c44e0ef74f97c671eb39c317d8242769
tree0487a7e3b381ad1ff2cbc76292dd8e88f375d484
parent72a049d77844d8da44613e4d9f109bd39e802602
[mlir][bufferize] Improve resolveConflicts for ExtractSliceOp

It is sometimes better to make a copy of the OpResult instead of making a copy of the OpOperand. E.g., when bufferizing tensor.extract_slice.

This implementation will eventually make parts of extract_slice's `bufferize` implementation obsolete (and simplify it). It will only need to handle in-place OpOperands.

Differential Revision: https://reviews.llvm.org/D126819
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
mlir/test/Dialect/Tensor/one-shot-bufferize-tensor-copy-insertion.mlir [new file with mode: 0644]