[Mlir-commits] [mlir] [mlir][bufferization] `MaterializeInDestinationOp`: Support memref destinations (PR #68074)
Nicolas Vasilache
llvmlistbot at llvm.org
Fri Oct 6 03:25:39 PDT 2023
================
@@ -361,10 +399,15 @@ def Bufferization_ToTensorOp : Bufferization_Op<"to_tensor", [
thereof) will bufferize out-of-place to prevent emitting any writes to
`memref` during bufferization.
- If the given memref does not alias with any other memref passed to another
- `to_tensor` op, the `restrict` unit attribute can be set. Only such
- operations are supported by One-Shot Bufferize. (Otherwise, potential memref
- aliasing relationships would have to be captured in One-Shot Bufferize.)
+ The `restrict` unit attribute (similar to the C `restrict` keyword)
+ indicates that the produced tensor result is the only way for the tensor
+ IR to gain access to the `memref` operand (or an alias thereof). E.g.,
+ there must be no other `to_tensor` op with the same or with an aliasing
+ `memref` operand.
+
+ Note: Only `to_tensor` ops with the `restrict` unit attribute are supported
+ by One-Shot Bufferize. Other IR is rejected. (To support `to_tensor`
----------------
nicolasvasilache wrote:
same here, can we be more explicit about user's responsibility / UB vs what the analysis will catch ?
https://github.com/llvm/llvm-project/pull/68074
More information about the Mlir-commits
mailing list