[PATCH] D80278: [MLIR] Tidy up documentation for `Shape_JoinOp`, `Shape_ReduceOp`, and `Shape_ConstSizeOp`
Frederik Gossen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 01:35:07 PDT 2020
frgossen created this revision.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, grosul1, Joonsoo, stephenneuendorffer, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: jpienaar.
Herald added a reviewer: silvas.
Herald added a project: LLVM.
Fix places that refer to `shape.type` instead of `shape.shape`.
Depends On D80277 <https://reviews.llvm.org/D80277>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80278
Files:
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
Index: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
===================================================================
--- mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
+++ mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
@@ -117,9 +117,9 @@
[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
@@ -168,10 +168,10 @@
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
```
@@ -189,7 +189,7 @@
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
```
}];
@@ -230,14 +230,14 @@
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
}
```
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80278.265160.patch
Type: text/x-patch
Size: 2474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200520/fc7fe3c7/attachment-0001.bin>
More information about the llvm-commits
mailing list