Add a trait to set the result type by attribute
authorFeng Liu <fengliuai@google.com>
Tue, 26 Mar 2019 22:31:15 +0000 (15:31 -0700)
committerjpienaar <jpienaar@google.com>
Sat, 30 Mar 2019 00:43:06 +0000 (17:43 -0700)
commitc489f50e6f8bf22f105f51eee8e2ea0dd6d6f30f
treece8fdeda6129f3eb832381e20ba3310db0450abe
parent9ffdc930c0441c9320c274fb74f3e542d1639478
Add a trait to set the result type by attribute

Before this CL, the result type of the pattern match results need to be as same
as the first operand type, operand broadcast type or a generic tensor type.
This CL adds a new trait to set the result type by attribute. For example, the
TFL_ConstOp can use this to set the output type to its value attribute.

PiperOrigin-RevId: 240441249
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/TableGen/Attribute.h
mlir/include/mlir/TableGen/OpTrait.h
mlir/lib/TableGen/Attribute.cpp
mlir/lib/TableGen/OpTrait.cpp
mlir/lib/TableGen/Operator.cpp
mlir/test/mlir-tblgen/op-result.td
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
mlir/tools/mlir-tblgen/RewriterGen.cpp