[Mlir-commits] [mlir] [mlir][SPIR-V] Lower AND/OR/XOR vector reductions (PR #192293)
Igor Wodiany
llvmlistbot at llvm.org
Mon Apr 20 11:55:20 PDT 2026
================
@@ -435,22 +435,29 @@ struct VectorReductionPattern final : OpConversionPattern<vector::ReductionOp> {
result = fop::create(rewriter, loc, resultType, result, next); \
break
+#define INT_CASE(kind, iop) \
+ case vector::CombiningKind::kind: \
+ assert(isa<IntegerType>(resultType)); \
+ result = spirv::iop::create(rewriter, loc, resultType, result, next); \
+ break
+
INT_AND_FLOAT_CASE(ADD, IAddOp, FAddOp);
INT_AND_FLOAT_CASE(MUL, IMulOp, FMulOp);
INT_OR_FLOAT_CASE(MINUI, SPIRVUMinOp);
INT_OR_FLOAT_CASE(MINSI, SPIRVSMinOp);
INT_OR_FLOAT_CASE(MAXUI, SPIRVUMaxOp);
INT_OR_FLOAT_CASE(MAXSI, SPIRVSMaxOp);
----------------
IgWod wrote:
nit: Remove the new line so all the cases are together -- it's more consistent that way. Or add a new line before the first `INT_OR_FLOAT_CASE`. Either works.
https://github.com/llvm/llvm-project/pull/192293
More information about the Mlir-commits
mailing list