[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #144908)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 08:39:01 PDT 2025


https://github.com/sdesmalen-arm commented:

> This also leads to partial reductions naturally being included in VPMulAccumulateRecipe, which is nice for hiding the cost of the extends and mul, but it does have the side effect of generating an unnecessary extend for chained partial reduction cases due to how those extends are re-generated. I don't think this can be avoided nicely, and it should be eliminated by DCE anyway.

I can confirm that this is an artifact resulting from the VPMulAccumulateRecipe, and is not an artifact of partial reductions. I tried to run one of the tests with the prefer-inloop-reductions flag, and see that we basically get the same codegen (albeit using a reduction-to-scalar rather than a partial-reduction)

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


More information about the llvm-commits mailing list