[mlir][memref] Clarify the documentation for memref.clone [NFC]
authorStephan Herhut <herhut@google.com>
Mon, 19 Jul 2021 10:12:36 +0000 (12:12 +0200)
committerStephan Herhut <herhut@google.com>
Mon, 19 Jul 2021 11:30:02 +0000 (13:30 +0200)
The wording was wrong and suggested that operands to memref.clone may not be mutated.

Differential Revision: https://reviews.llvm.org/D106258

mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td

index 3385a7e..5101d59 100644 (file)
@@ -425,8 +425,10 @@ def CloneOp : MemRef_Op<"clone", [
     %arg1 = memref.clone %arg0 : memref<?xf32> to memref<?xf32>
     ```
 
-    Note, that mutating the source or result of the clone operation leads to
-    undefined behavior.
+    Valid implementations of this operation may alias the input and output
+    views or create an actual copy. Mutating the source or result
+    of the clone operation after the clone operation thus leads to undefined
+    behavior.
   }];
 
   let arguments = (ins Arg<AnyRankedOrUnrankedMemRef, "", []>:$input);