[mlir] Add elementAttr to TypedArrayAttrBase.
authorAbdurrahman Akkas <akkas@google.com>
Thu, 13 Feb 2020 08:23:37 +0000 (09:23 +0100)
committerAlex Zinenko <zinenko@google.com>
Thu, 13 Feb 2020 08:25:27 +0000 (09:25 +0100)
commit2e8c112ecf562afdd8a6b3c3467571233b9b55ae
tree9480aac67e6f4d8843063742cb2fd81bc6cbab01
parent005b720373f163b153957d35db24722b8f72ad9b
[mlir] Add elementAttr to TypedArrayAttrBase.

In code generators, one can automate the translation of typed ArrayAttrs
if element attribute translators are already implemented. However, the
type of the element attribute is lost at the construction of
TypedArrayAttrBase. With this change one can inspect the element type
and generate the translation logic automatically, which will reduce the
code repetition.

Differential Revision: https://reviews.llvm.org/D73579
mlir/include/mlir/IR/OpBase.td
mlir/test/mlir-tblgen/op-attribute.td