This revision defines a Linalg contraction in general terms:
- Has 2 input and 1 output shapes.
- Has at least one reduction dimension.
- Has only projected permutation indexing maps.
- its body computes u5(u1(c) + u2(u3(a) * u4(b))) on some field (AddOpType, MulOpType), where u1, u2, u3, u4 and u5 represent scalar unary operations that may change the type (e.g. for mixed-precision).
As a consequence, when vectorization of such an op occurs, the only special
behavior is that the (unique) MulOpType is vectorized into a
vector.contract. All other ops are handled in a generic fashion.
In the future, we may wish to allow more input arguments and elementwise and
constant operations that do not involve the reduction dimension(s).
A test is added to demonstrate the proper vectorization of matmul_i8_i8_i32.
Nit: I'd use while (v != form) here instead of the infinite loop and early exit.