[PATCH] D76321: [mlir] Add target for Shape dialect

Jacques Pienaar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 14:02:50 PDT 2020


jpienaar created this revision.
jpienaar added a reviewer: silvas.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, rriddle, mehdi_amini, mgorny.
Herald added a project: LLVM.
silvas added a comment.

Thanks, this is a good start.



================
Comment at: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td:223
 
   let arguments = (ins Shape_ShapeType:$lhs, Shape_ShapeType:$rhs);
   let results = (outs Shape_ShapeType:$result);
----------------
Shape_SizeType?


================
Comment at: mlir/lib/Dialect/Shape/IR/Shape.cpp:26-27
+  addTypes<ComponentType, ElementType, ShapeType, SizeType, ValueShapeType>();
+  // Allow unknown operations during testing.
+  allowUnknownOperations();
+}
----------------
Can we remove this? Just use "foo.op" instead of "shape.op" during testing?


================
Comment at: mlir/test/Dialect/Shape/ops.mlir:29
+func @test_broadcastable_fixed() {
+  %0 = "shape.constant"() { value = [10, 1, 57, 92] }: () -> !shape.type
+  %1 = "shape.constant"() { value = [4, 57, 92] }: () -> !shape.type
----------------
Can we use "!shape.shape" it seems a lot more readable to me.


BEGIN_PUBLIC
[mlir] Add target for Shape dialect

Add targets and basic printing/parsing of types in Shape dialect.
END_PUBLIC


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76321

Files:
  mlir/include/mlir/Dialect/Shape/IR/CMakeLists.txt
  mlir/include/mlir/Dialect/Shape/IR/Shape.h
  mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
  mlir/include/mlir/InitAllDialects.h
  mlir/lib/Dialect/CMakeLists.txt
  mlir/lib/Dialect/Shape/CMakeLists.txt
  mlir/lib/Dialect/Shape/DialectRegistration.cpp
  mlir/lib/Dialect/Shape/IR/Shape.cpp
  mlir/test/Dialect/Shape/ops.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76321.250894.patch
Type: text/x-patch
Size: 14769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200317/b4fa54d3/attachment.bin>


More information about the llvm-commits mailing list