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

Georgios Pinitas llvmlistbot at llvm.org
Sun Sep 14 05:10:33 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)
----------------
GeorgeARM wrote:

It is already kind of guarded by OpType as this is only true when the operation is a reduce sum. We might to rework this all-together if it mandates different handling other reductions.

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


More information about the Mlir-commits mailing list