[mlir][bufferization] Add optional `copy` operand to AllocTensorOp
authorMatthias Springer <springerm@google.com>
Thu, 9 Jun 2022 19:36:39 +0000 (21:36 +0200)
committerMatthias Springer <springerm@google.com>
Thu, 9 Jun 2022 19:37:15 +0000 (21:37 +0200)
commit56d68e8d7a17c32d2fd0d0894fc0776df0d85673
tree1f91452dacd800ff5761d7550327ca5a3a979a5d
parent9617ffce0d376afe2539f477533f8c14f769cc6e
[mlir][bufferization] Add optional `copy` operand to AllocTensorOp

If `copy` is specified, the newly allocated buffer is initialized with the given contents. Also add an optional `escape` attribute to indicate whether the buffer of the tensor may be returned from the parent block (aka. "escape") after bufferization.

This change is in preparation of connecting One-Shot Bufferize to the sparse compiler.

Differential Revision: https://reviews.llvm.org/D126570
mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
mlir/python/mlir/dialects/_bufferization_ops_ext.py
mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize.mlir
mlir/test/Dialect/Bufferization/canonicalize.mlir
mlir/test/Dialect/Bufferization/invalid.mlir
mlir/test/Dialect/Bufferization/ops.mlir
mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco.py