[mlir] Add a shape function library op
authorJacques Pienaar <jpienaar@google.com>
Sat, 28 Nov 2020 23:53:58 +0000 (15:53 -0800)
committerJacques Pienaar <jpienaar@google.com>
Sat, 28 Nov 2020 23:53:59 +0000 (15:53 -0800)
commit6dd9596b19d7679c562f8e866be6d0c3d7c21994
tree88cbbd5e29a758383c0a4f5ee135182ab7687088
parentd989ffd109b2b5e7fd7c577ea549f4d1c5f5492c
[mlir] Add a shape function library op

Op with mapping from ops to corresponding shape functions for those op
in the library and mechanism to associate shape functions to functions.
The mapping of operand to shape function is kept separate from the shape
functions themselves as the operation is associated to the shape
function and not vice versa, and one could have a common library of
shape functions that can be used in different contexts.

Use fully qualified names and require a name for shape fn lib ops for
now and an explicit print/parse (based around the generated one & GPU
module op ones).

Differential Revision: https://reviews.llvm.org/D91672
mlir/include/mlir/Dialect/Shape/IR/Shape.h
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Analysis/test-shape-fn-report.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/CMakeLists.txt
mlir/test/lib/Dialect/Shape/CMakeLists.txt [new file with mode: 0644]
mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp [new file with mode: 0644]
mlir/test/lib/Dialect/Test/TestOps.td
mlir/tools/mlir-opt/CMakeLists.txt
mlir/tools/mlir-opt/mlir-opt.cpp