[Mlir-commits] [mlir] 77b18ff - [MLIR][Bufferization] Improve documentation of introduction and `summary`s

Alex Zinenko llvmlistbot at llvm.org
Fri Jun 2 02:47:17 PDT 2023


Author: rikhuijzer
Date: 2023-06-02T11:47:10+02:00
New Revision: 77b18ff5cf1cb6d0f010bc4ee1e5b9273cf912bc

URL: https://github.com/llvm/llvm-project/commit/77b18ff5cf1cb6d0f010bc4ee1e5b9273cf912bc
DIFF: https://github.com/llvm/llvm-project/commit/77b18ff5cf1cb6d0f010bc4ee1e5b9273cf912bc.diff

LOG: [MLIR][Bufferization] Improve documentation of introduction and `summary`s

This patch suggests to add a sentence in the introduction which clarifies
the aim of the dialect in one sentence. I hope that I understood it correctly.

For the `summary` fields, I have scrolled through the Bufferization page
(<https://mlir.llvm.org/docs/Bufferization>) and added missing summaries
or standardized existing ones to make the summaries easier to read.

Reviewed By: springerm

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationBase.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationBase.td
index 442be0aa232d0..23eb2abf66d1a 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationBase.td
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationBase.td
@@ -17,10 +17,12 @@ def Bufferization_Dialect : Dialect {
   let description = [{
     Bufferization in MLIR is the process of converting the `tensor` type to the
     `memref` type.
-    The `bufferization` dialect is intended to collect operations/interfaces
-    specific to the bufferization passes.
+    Simply put, bufferization is the process of converting computations on the
+    mathematical tensor construct to computations on physical memory buffers.
+    The `bufferization` dialect contains operations/interfaces specific to the
+    bufferization passes.
 
-    Overview of the bufferization infrastructure and important conceptual
+    An overview of the bufferization infrastructure and important conceptual
     details related to using the MLIR dialect conversion infrastructure can be
     found in [bufferization](/docs/Bufferization/) and [buffer
     deallocation](/docs/BufferDeallocationInternals/).

diff  --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
index 3c242a36d0e47..534bc26302ea1 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
@@ -26,7 +26,7 @@ class Bufferization_Op<string mnemonic, list<Trait> traits = []>
 def Bufferization_AllocTensorOp : Bufferization_Op<"alloc_tensor",
     [AttrSizedOperandSegments, BufferizableOpInterface,
      DeclareOpInterfaceMethods<ReifyRankedShapedTypeOpInterface>]> {
-  let summary = "buffer allocation in tensor land";
+  let summary = "allocate buffer for a tensor";
 
   let description = [{
     `bufferization.alloc_tensor` materializes an uninitialized tensor with a
@@ -172,6 +172,7 @@ def Bufferization_CloneOp : Bufferization_Op<"clone", [
       return build($_builder, $_state, value.getType(), value);
     }]>];
 
+  let summary = "clone a memref";
   let description = [{
     Clones the data in the input view into an implicitly defined output view.
 
@@ -207,7 +208,7 @@ def Bufferization_CloneOp : Bufferization_Op<"clone", [
 
 def Bufferization_DeallocTensorOp : Bufferization_Op<"dealloc_tensor",
     [BufferizableOpInterface]> {
-  string summary = "Releases underlying sparse storage format of given tensor";
+  string summary = "release underlying storage format of given tensor";
   string description = [{
     `bufferization.dealloc_tensor` is a buffer deallocation in tensor land. This
     op can be used for manual buffer deallocation. Some bufferizations (such as
@@ -270,7 +271,7 @@ def Bufferization_ToTensorOp : Bufferization_Op<"to_tensor", [
                    "memref", "result",
                    "memref::getTensorTypeFromMemRefType($_self)">
   ]> {
-  let summary = "memref to tensor operation";
+  let summary = "create a tensor from a `memref`";
   let description = [{
     An operation that creates a tensor from a `memref`. The result value is a
     tensor whose shape and element type match the memref operand.
@@ -369,7 +370,7 @@ def Bufferization_ToMemrefOp : Bufferization_Op<"to_memref", [
                    "memref", "tensor",
                    "memref::getTensorTypeFromMemRefType($_self)">
   ]> {
-  let summary = "tensor to memref cast operation";
+  let summary = "cast a tensor to memref";
   let description = [{
     An operation that returns the future buffer of a `tensor`.
 


        


More information about the Mlir-commits mailing list