[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #144908)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 24 07:05:16 PDT 2025
================
@@ -2861,6 +2886,12 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
VPValue *VecOp = Red->getVecOp();
VPValue *A, *B;
+ // Some chained partial reductions used for complex numbers will have a
+ // negation between the mul and reduction. This extracts the mul from that
+ // pattern to use it for further checking.
+ if (Red->isPartialReduction())
+ match(VecOp,
+ m_Binary<Instruction::Sub>(m_SpecificInt(0), m_VPValue(VecOp)));
----------------
sdesmalen-arm wrote:
It still needs to somehow encode that this operation is a sub-reduction instead of an add-reduction. At the moment, this just generates a regular add reduction, which is not correct.
https://github.com/llvm/llvm-project/pull/144908
More information about the llvm-commits
mailing list