[Mlir-commits] [mlir] [mlir][linalg] Support subtracting accumulation in partial reduction … (PR #214033)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Aug 7 13:47:46 PDT 2026
================
@@ -562,7 +584,12 @@ struct LinalgOpPartialReductionInterface
return op->emitOpError("Failed to anaysis the reduction operation.");
Operation *reductionOp = combinerOps[0];
- std::optional<TypedAttr> identity = arith::getNeutralElement(reductionOp);
+ std::optional<TypedAttr> identity;
+ if (isSubtractingAccumulation(reductionOp,
+ linalgOp.getRegionOutputArgs()[initIdx]))
+ identity = b.getZeroAttr(reductionOp->getResult(0).getType());
+ else
+ identity = arith::getNeutralElement(reductionOp);
----------------
pstarkcdpr wrote:
This is gone after the refactor in commit 4e221308f922b304fb4d8345005674e72cd82131
https://github.com/llvm/llvm-project/pull/214033
More information about the Mlir-commits
mailing list