[mlir][bufferization] Add bufferization.copy_tensor op
This operation is a "copy" operation on tensors. It is guaranteed to bufferize to a memcpy. This is different from "tensor.insert_slice", which may fold away. Note: There is a symmetry between certain tensor, bufferization and memref ops: * `tensor.empty`, `bufferization.alloc_tensor`, `memref.alloc` * (none), `bufferization.dealloc_tensor`, `memref.dealloc` * `tensor.insert_slice`, `bufferization.copy_tensor`, `memref.copy` Tensor ops can generally canonicalize/fold away, while bufferization dialect ops can be used when a certain side effect is expected to materialize; so they do not fold away. Differential Revision: https://reviews.llvm.org/D153552
Loading
Please sign in to comment