Currently, vector.contract joins the intermediate result and the accumulator argument (of ranks K) using summation. We desire more joining operations --- such as max --- to help vector.contract express reductions. This change extends Vector_ContractionOp to take an optional attribute (called "kind", of enum type CombiningKind) specifying the joining operation to be add/mul/min/max for int/fp , and and/or/xor for int only. By default this attribute has value "add".
To implement this we also need to extend vector.outerproduct, since vector.contract gets transformed to vector.outerproduct (and that to vector.fma). The extension for vector.outerproduct is also an optional kind attribute that uses the same enum type and possible values. The default is "add". In case of max/min we transform vector.outerproduct to a combination of compare and select.
clang-tidy: error: 'mlir/Dialect/Vector/VectorOpsEnums.h.inc' file not found [clang-diagnostic-error]
not useful
clang-tidy: error: 'mlir/Dialect/Vector/VectorOpsEnums.h.inc' file not found [clang-diagnostic-error]
not useful
clang-tidy: error: 'mlir/Dialect/Vector/VectorOpsEnums.h.inc' file not found [clang-diagnostic-error]
not useful