[Mlir-commits] [mlir] 000e426 - [mlir][bufferize][doc] Fix documentation of return type of `to_memref`.

Ingo Müller llvmlistbot at llvm.org
Wed Jul 20 06:21:53 PDT 2022


Author: Ingo Müller
Date: 2022-07-20T13:21:49Z
New Revision: 000e4264492e55a265ec92942f479e0973c221b1

URL: https://github.com/llvm/llvm-project/commit/000e4264492e55a265ec92942f479e0973c221b1
DIFF: https://github.com/llvm/llvm-project/commit/000e4264492e55a265ec92942f479e0973c221b1.diff

LOG: [mlir][bufferize][doc] Fix documentation of return type of `to_memref`.

This is my very first contact with this dialect, so I am not very
confident with this commit, but it seems like the op returns a memref,
not a tensor, so that's what comment about the result type should say.

[mlir][bufferization][doc] Improve typesetting of inline code. Fix Typo.

Reviewed By: pifon2a

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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
index 33f61aa56a010..4d7e5462a5f6d 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
@@ -48,7 +48,7 @@ def Bufferization_AllocTensorOp : Bufferization_Op<"alloc_tensor",
 
     The optional `memory_space` attribute specifies the memory space when
     bufferizing this op. The memory space is inferred from `copy` if specified.
-    If neigher `copy` nor `memory_space` is specified, the default memory space
+    If neither `copy` nor `memory_space` is specified, the default memory space
     is used during bufferization.
 
     Both dense and sparse tensor types are supported. The result of a
@@ -258,11 +258,11 @@ def Bufferization_ToTensorOp : Bufferization_Op<"to_tensor", [
   ]> {
   let summary = "memref to tensor operation";
   let description = [{
-    Create a tensor from a memref, making an independent copy of the element
+    Create a tensor from a `memref`, making an independent copy of the element
     data. The result value is a tensor whose shape and element type match the
     memref operand.
 
-    The opposite of this op is to_memref. Together, these two ops are
+    The opposite of this op is `to_memref`. Together, these two ops are
     useful for source/target materializations when doing type conversions
     involving tensors and memrefs.
 
@@ -351,15 +351,15 @@ def Bufferization_ToMemrefOp : Bufferization_Op<"to_memref", [
     Casts a tensor to a memref.
 
     ```mlir
-    // Result type is tensor<4x?xf32>
+    // Result type is memref<4x?xf32, #map0, 42>
     %12 = bufferization.to_memref %10 : memref<4x?xf32, #map0, 42>
     ```
 
-    Note, that mutating the result of the to_memref operation leads to
+    Note, that mutating the result of the `to_memref` operation leads to
     undefined behavior.
 
     This operation is a specialized variant of the built-in
-    unrealized_conversion_cast and is intended for use in the context of
+    `unrealized_conversion_cast` and is intended for use in the context of
     gradual bufferization.
   }];
 


        


More information about the Mlir-commits mailing list