[PATCH] D76817: `shape` dialect: add some ops

Sean Silva via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 17:58:00 PDT 2020


silvas marked 3 inline comments as done.
silvas added inline comments.


================
Comment at: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td:189
+    in the tensor equals the rank of the shape, and the elements equal the
+    extents of the shape.
+  }];
----------------
jpienaar wrote:
> What happens for unranked and or dynamic tensors?
it return the shape. Notice that the return type is not static shaped. For an unranked tensor it will return a `tensor<?xi32>` (or index someday).


================
Comment at: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td:193
+  let arguments = (ins Shape_ShapeType:$input);
+  let results = (outs I32Tensor:$result);
+}
----------------
jpienaar wrote:
> With your other rev, can these now be IndexTensor? (can also be done in follow up)
Yeah, I want to do it in a follow-up. Just being consistent for now.


================
Comment at: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td:335
+    - split_at([4,5,6], index=-3) -> [], [4,5,6]
+    - split_at([4,5,6], index=-4) -> error
+
----------------
jpienaar wrote:
> Add behavior for unranked here and below
Whether something is unranked or not is a purely static concept, so it's totally orthogonal to an execution example like this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76817/new/

https://reviews.llvm.org/D76817





More information about the llvm-commits mailing list