[Mlir-commits] [mlir] Documentation updates and typo fixes (PR #125273)

Timothy Hoffman llvmlistbot at llvm.org
Mon Feb 24 08:22:28 PST 2025


https://github.com/tim-hoffman updated https://github.com/llvm/llvm-project/pull/125273

>From e9e6076a0fac29f3eae43294e882b950fdd29c2a Mon Sep 17 00:00:00 2001
From: Tim Hoffman <timothy.hoffman at veridise.com>
Date: Mon, 27 Jan 2025 21:28:01 -0600
Subject: [PATCH 1/5] docs: use correct attribute class name

The type mentioned caused compiler errors. For existing code that uses the proper type see `mlir/Dialect/LLVMIR/LLVMOps.td` and `mlir/Dialect/ControlFlow/IR/ControlFlowOps.td`
---
 mlir/docs/DefiningDialects/Operations.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/docs/DefiningDialects/Operations.md b/mlir/docs/DefiningDialects/Operations.md
index 8ff60ac21424c..486129b0f33c7 100644
--- a/mlir/docs/DefiningDialects/Operations.md
+++ b/mlir/docs/DefiningDialects/Operations.md
@@ -248,7 +248,7 @@ To declare a variadic operand that has a variadic number of sub-ranges, wrap the
 `TypeConstraint` for the operand with `VariadicOfVariadic<...,
 "<segment-attribute-name>">`.
 
-The second field of the `VariadicOfVariadic` is the name of an `I32ElementsAttr`
+The second field of the `VariadicOfVariadic` is the name of a `DenseI32ArrayAttr`
 argument that contains the sizes of the variadic sub-ranges. This attribute will
 be used when determining the size of sub-ranges, or when updating the size of
 sub-ranges.

>From 8c72cb40e8d989ba7899835158c8a7efb53d87c3 Mon Sep 17 00:00:00 2001
From: Tim Hoffman <timothy.hoffman at veridise.com>
Date: Mon, 27 Jan 2025 21:28:39 -0600
Subject: [PATCH 2/5] docs: typo in MemRefLayoutAttrInterface description

---
 mlir/include/mlir/IR/BuiltinAttributeInterfaces.td | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
index 017559cc353e6..6220d80264bdf 100644
--- a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
+++ b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
@@ -481,7 +481,7 @@ def MemRefLayoutAttrInterface : AttrInterface<"MemRefLayoutAttrInterface"> {
     Note: the MemRef type's layout is assumed to represent simple strided buffer
     layout. For more complicated case, like sparse storage buffers,
     it is preferable to use separate type with more specic layout, rather then
-    introducing extra complexity to the builin MemRef type.
+    introducing extra complexity to the builtin MemRef type.
   }];
 
   let methods = [

>From 82a6d2faf575e396a80024ebcc39b0f273804c0c Mon Sep 17 00:00:00 2001
From: Tim Hoffman <timothy.hoffman at veridise.com>
Date: Wed, 29 Jan 2025 14:43:53 -0600
Subject: [PATCH 3/5] docs: remove SingleResult trait mention, doesn't exist

---
 mlir/docs/Traits/_index.md | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mlir/docs/Traits/_index.md b/mlir/docs/Traits/_index.md
index 3fa24ec77107f..4127fe75dc6f5 100644
--- a/mlir/docs/Traits/_index.md
+++ b/mlir/docs/Traits/_index.md
@@ -8,10 +8,9 @@ mechanism which abstracts implementation details and properties that are common
 across many different attributes/operations/types/etc.. `Traits` may be used to
 specify special properties and constraints of the object, including whether an
 operation has side effects or that its output has the same type as the input.
-Some examples of operation traits are `Commutative`, `SingleResult`,
-`Terminator`, etc. See the more comprehensive list of
-[operation traits](#operation-traits-list) below for more examples of what is
-possible.
+Some examples of operation traits are `Commutative`, `Terminator`, etc. See the
+more comprehensive list of [operation traits](#operation-traits-list) below for
+more examples of what is possible.
 
 ## Defining a Trait
 

>From cd8fc468484f90875caf377906babf3ba44ef027 Mon Sep 17 00:00:00 2001
From: Tim Hoffman <timothy.hoffman at veridise.com>
Date: Fri, 31 Jan 2025 13:35:30 -0600
Subject: [PATCH 4/5] docs: add `prop-dict` to Custom Directives documentation

`prop-dict` is supported in custom directive since https://github.com/llvm/llvm-project/pull/77061 but documentation was not added here
---
 mlir/docs/DefiningDialects/Operations.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mlir/docs/DefiningDialects/Operations.md b/mlir/docs/DefiningDialects/Operations.md
index 486129b0f33c7..2adaf181de28a 100644
--- a/mlir/docs/DefiningDialects/Operations.md
+++ b/mlir/docs/DefiningDialects/Operations.md
@@ -887,11 +887,12 @@ declarative parameter to `parse` method argument is detailed below:
     -   Variadic: `SmallVectorImpl<Type> &`
     -   VariadicOfVariadic: `SmallVectorImpl<SmallVector<Type>> &`
 *   `attr-dict` Directive: `NamedAttrList &`
+*   `prop-dict` Directive: `OperationState &`
 
 When a variable is optional, the value should only be specified if the variable
 is present. Otherwise, the value should remain `None` or null.
 
-The arguments to the `print<UserDirective>` method is firstly a reference to the
+The arguments to the `print<UserDirective>` method are firstly a reference to the
 `OpAsmPrinter`(`OpAsmPrinter &`), second the op (e.g. `FooOp op` which can be
 `Operation *op` alternatively), and finally a set of output parameters
 corresponding to the parameters specified in the format. The mapping of
@@ -921,6 +922,7 @@ declarative parameter to `print` method argument is detailed below:
     -   Variadic: `TypeRange`
     -   VariadicOfVariadic: `TypeRangeRange`
 *   `attr-dict` Directive: `DictionaryAttr`
+*   `prop-dict` Directive: `FooOp::Properties`
 
 When a variable is optional, the provided value may be null. When a variable is
 referenced in a custom directive parameter using `ref`, it is passed in by

>From 0038805cb14a6289dc61fe31b3ddb748e4c2f7db Mon Sep 17 00:00:00 2001
From: Tim Hoffman <timothy.hoffman at veridise.com>
Date: Mon, 24 Feb 2025 10:22:13 -0600
Subject: [PATCH 5/5] remove comment about callback

---
 mlir/lib/IR/SymbolTable.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp
index 71adfc467611b..b186e0fcf0a2b 100644
--- a/mlir/lib/IR/SymbolTable.cpp
+++ b/mlir/lib/IR/SymbolTable.cpp
@@ -806,9 +806,9 @@ static std::optional<SymbolTable::UseRange> getSymbolUsesImpl(SymbolT symbol,
 }
 
 /// Get all of the uses of the given symbol that are nested within the given
-/// operation 'from', invoking the provided callback for each. This does not
-/// traverse into any nested symbol tables. This function returns std::nullopt
-/// if there are any unknown operations that may potentially be symbol tables.
+/// operation 'from'. This does not traverse into any nested symbol tables.
+/// This function returns std::nullopt if there are any unknown operations that
+/// may potentially be symbol tables.
 auto SymbolTable::getSymbolUses(StringAttr symbol, Operation *from)
     -> std::optional<UseRange> {
   return getSymbolUsesImpl(symbol, from);



More information about the Mlir-commits mailing list