[Mlir-commits] [mlir] [MLIR][XeGPU] Use all ones as the neutral value of an AND reduction (PR #232828)
Md Abdullah Shahneous Bari
llvmlistbot at llvm.org
Mon Oct 19 13:52:28 PDT 2026
================
----------------
mshahneo wrote:
The helper is used without a cross-subgroup reduction too. WG-to-SG starts every subgroup's local reduction from createReductionNeutralValue, and combines the original accumulator only afterwards. The cross-subgroup path also uses it for the final reduction. So the old test did fail without the fix: the local reduction started from dense<1>.
But you are right that the test was hard to read. Its accumulator was -1, the same value as the neutral. So the CHECKs could not show which constant the reduction starts from, and `andi %x, -1` folded the accumulator combine away. In the new version the accumulator is 7. The CHECKs now show the reduction starting from -1, then arith.andi with the accumulator. I also added a cross-subgroup case. Both cases fail without the fix.
https://github.com/llvm/llvm-project/pull/232828
More information about the Mlir-commits
mailing list