[Mlir-commits] [mlir] dd484ba - [MLIR] Tidy up documentation for `Shape_JoinOp`, `Shape_ReduceOp`, and
Frederik Gossen
llvmlistbot at llvm.org
Thu May 28 06:43:15 PDT 2020
Author: Frederik Gossen
Date: 2020-05-28T13:42:19Z
New Revision: dd484baffdf4a92e564c38a17d35a742e633b0e0
URL: https://github.com/llvm/llvm-project/commit/dd484baffdf4a92e564c38a17d35a742e633b0e0
DIFF: https://github.com/llvm/llvm-project/commit/dd484baffdf4a92e564c38a17d35a742e633b0e0.diff
LOG: [MLIR] Tidy up documentation for `Shape_JoinOp`, `Shape_ReduceOp`, and
`Shape_ConstSizeOp`
Fix places that refer to `shape.type` instead of `shape.shape`.
Differential Revision: https://reviews.llvm.org/D80278
Added:
Modified:
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
index 406aac2db99a..dddc4c3ea08c 100644
--- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
+++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
@@ -115,9 +115,9 @@ def Shape_ConstSizeOp : Shape_Op<"const_size",
[ConstantLike,
NoSideEffect,
DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
- let summary = "Creates a constant of !shape.size type.";
+ let summary = "Creates a constant of type `shape.size`";
let description = [{
- Creates a !shape.size type representing the constant size given by `value`.
+ Creates a `shape.size` type representing the constant size given by `value`.
```mlir
%x = shape.const_size 10
@@ -217,10 +217,10 @@ def Shape_GetExtentOp : Shape_Op<"get_extent",
def Shape_JoinOp : Shape_Op<"join", []> {
let summary = "Returns the least general shape.size of its operands";
let description = [{
- An operation that computes the least general shape of input operands. This
- effectively asserts that corresponding static dimensions are equal. The
- behavior is to match each element of the `shape.type` and propagate the most
- restrictive information, returning an invalid shape if there are
+ An operation that computes the least general shape of input operands.
+ This effectively asserts that corresponding static dimensions are equal.
+ The behavior is to match each element of the `shape.shape` and propagate the
+ most restrictive information, returning an invalid shape if there are
contradictory requirements. E.g., using pseudo code
```
@@ -238,7 +238,7 @@ def Shape_JoinOp : Shape_Op<"join", []> {
used to return an error to the user upon mismatch of dimensions.
```mlir
- %c = shape.join %a, %b, error="<reason>" : !shape.type
+ %c = shape.join %a, %b, error="<reason>" : !shape.shape
```
}];
@@ -279,14 +279,14 @@ def Shape_ReduceOp : Shape_Op<"reduce", []> {
number of elements
```mlir
- func @shape_num_elements(%shape : !shape.type) -> !shape.size {
+ func @shape_num_elements(%shape : !shape.shape) -> !shape.size {
%0 = "shape.constant_dim"() {value = 1 : i32} : () -> !shape.size
%1 = "shape.reduce"(%shape, %0) ( {
^bb0(%index: i32, %dim: !shape.size, %lci: !shape.size):
%acc = "shape.mul"(%lci, %dim) :
(!shape.size, !shape.size) -> !shape.size
shape.yield %acc : !shape.size
- }) : (!shape.type, !shape.size) -> (!shape.size)
+ }) : (!shape.shape, !shape.size) -> (!shape.size)
return %1 : !shape.size
}
```
More information about the Mlir-commits
mailing list