[Mlir-commits] [mlir] [mlir][linalg] Support subtracting accumulation in partial reduction … (PR #214033)

Federico Bruzzone llvmlistbot at llvm.org
Fri Aug 14 00:25:51 PDT 2026


FedericoBruzzone wrote:

> Oh, I see @FedericoBruzzone. You can tell that I'm not at all familiar with the LLVM community.

No worries at all @pstarkcdpr. I'm sure the community appreciates your contribution (and so do I) :D


> Not sure what you mean by blocked. Do you mean that we should try to figure out if there's an example with the existing ops (like addi) could produce incorrect results due to the current flag propagation or if subtract is possibly making things different?

I'm really sorry for not being clear from the beginning 🙏

What I mean by _blocked_ is mostly the former, i.e., I think we should first establish what the current tiling infrastructure actually does when the combiner has `nsw/nuw` flags.
In particular, I'd check whether reductions using existing combiners such as `addi/muli` with overflow flags are currently allowed to go through partial-reduction tiling, and whether the flags are propagated to the generated partial/merge operations. Now:

1. If they are, then I think we should understand why that is sound: _does the existing Linalg semantics guarantee that the no-overflow property is preserved under the regrouping introduced by tiling?_ _Or is there already a potential issue there?_ (Similar to my previous question)

2. Conversely, if tiling is already prevented for reductions whose combiner carries overflow flags, then I would expect `subi` to follow the same rule, and the bail out would simply be consistent with the existing behavior.




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


More information about the Mlir-commits mailing list