[llvm] Add LoopVectorizer support for `llvm.vector.partial.reduce.fadd` (PR #163975)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 11 07:34:33 PST 2025


================
@@ -3958,6 +3940,22 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
     Mul->setOperand(1, ExtB);
   };
 
+  // Try to match reduce.add(fmul(...)).
+  if (match(VecOp, m_FMul(m_VPValue(A), m_VPValue(B)))) {
+    auto *RecipeA = dyn_cast_if_present<VPWidenCastRecipe>(A);
----------------
sdesmalen-arm wrote:

nit: maybe add `assert(Opcode == Instruction::FAdd);` here?

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


More information about the llvm-commits mailing list