[mlir] Generalize broadcastable trait operands
authorJacques Pienaar <jpienaar@google.com>
Sat, 11 Jan 2020 17:42:18 +0000 (09:42 -0800)
committerJacques Pienaar <jpienaar@google.com>
Mon, 20 Jan 2020 21:02:14 +0000 (13:02 -0800)
commitb70e4efb75bf1670fa335f3211c05b26b060ffde
treed35c10f605dc6bfcc5e9dc4bf4920bf9bb4e0486
parentf6418d72f572ced8e1f58fc18fb973da1c956162
[mlir] Generalize broadcastable trait operands

Summary:
Generalize broadcastable trait to variadic operands. Update the
documentation that still talked about element type as part of
broadcastable trait (that bug was already fixed). Also rename
Broadcastable to ResultBroadcastableShape to be more explicit that the
trait affects the result shape (it is possible for op to allow
broadcastable operands but not have result shape that is broadcast
compatible with operands).

Doing some intermediate work to have getBroadcastedType take an optional
elementType as input and use that if specified, instead of the common
element type of type1 and type2 in this function.

Differential Revision: https://reviews.llvm.org/D72559
mlir/docs/Traits.md
mlir/include/mlir/Dialect/Traits.h
mlir/include/mlir/IR/OpBase.td
mlir/lib/Dialect/Traits.cpp
mlir/test/Dialect/traits.mlir
mlir/test/lib/TestDialect/TestOps.td
mlir/tools/mlir-tblgen/RewriterGen.cpp