[mlir][shape] Add shape.lib attribute
authorJacques Pienaar <jpienaar@google.com>
Thu, 31 Dec 2020 22:46:08 +0000 (14:46 -0800)
committerJacques Pienaar <jpienaar@google.com>
Thu, 31 Dec 2020 22:46:08 +0000 (14:46 -0800)
commit8d541a1fbe6d92a3fadf6d7d8e8209ed6c76e092
treef17b26c6fb776c97c098640b0002499f75cf8637
parenteaab71106b81031d272acfc6987e99e8b65cbe6c
[mlir][shape] Add shape.lib attribute

Enable querying shape function library ops from the module. Currently
supports singular or array of them (as long as array has all unique ops
in mappings). The preferred canonical form would have one library, but
given the invariant on the mapping, this can easily be achieved by a
simple merging pass.

Preferred the attribute approach vs naming convention as these could be
added in multiple different ways.
mlir/include/mlir/Dialect/Shape/IR/ShapeBase.td
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Analysis/test-shape-fn-report.mlir
mlir/test/Dialect/Shape/invalid.mlir
mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp