[Mlir-commits] [mlir] [mlir][tosa] Introduce accumulator type for `reduce_sum` on bf16 (PR #158389)

Suraj Sudhir llvmlistbot at llvm.org
Sat Sep 13 20:02:05 PDT 2025


================
@@ -1231,8 +1237,14 @@ static LogicalResult reduceMatchAndRewriteHelper(OpTy op, uint64_t axis,
       [&](OpBuilder &nestedBuilder, Location nestedLoc, ValueRange blockArgs) {
         std::array<Value, 2> binaryArgs{
             blockArgs[0], isNanIgnoreMode ? blockArgs[2] : blockArgs[1]};
-        auto result = createLinalgBodyCalculationForReduceOp(
-            op, binaryArgs, elementTy, rewriter);
+
+        // If reduction type differs then extend (applicable to reduce_sum)
----------------
sjarus wrote:

Do you need an opType guard here if anything later mandates different handling of other reductions ?

https://github.com/llvm/llvm-project/pull/158389


More information about the Mlir-commits mailing list