Linalg named operations are currently limited to tensors and memrefs
composed of floating point, integer or index elements and using any
other element type triggers an assertion.
This change adds support for arbitrary element types for named
operations through a new type interface
LinalgArithmeticOperatorTypeInterface and two operation interfaces
LinalgAddOpInterface and LinalgMulOpInterface.
The type interface is used to instantiate operations that implement
arithmetic operations for a type (e.g., instantiating arith::AddFOp
for an addition on floats) transparently. The two operation interfaces
allow for the identification of instances of operations implementing
additions and multiplications, required by ContractionOpInterface.
Implementations of LinalgArithmeticOperatorTypeInterface are
provided for the builtin float and integer types and implementations
of LinalgAddOpInterface and LinalgAddOpInterface are provided for
arith::AddFOp, arith::AddIOp, arith::MulFOp, and
arith::MulIOp, respectively.
I would probably go with LinalgArithmeticOpTypeInterface or even LinalgArithOpTypeInterface? If you prefer the long name I would probably use Operation rather than Operator since add / mul are really operations in the MLIR sense. I associate operators to matmul, convolution, etc...