[llvm] [LoopVectorizer] Add support for partial reductions (PR #92418)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 08:18:34 PDT 2024


================
@@ -8962,8 +9103,15 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
           Legal->isInvariantAddressOfReduction(SI->getPointerOperand()))
         continue;
 
-      VPRecipeBase *Recipe =
-          RecipeBuilder.tryToCreateWidenRecipe(Instr, Operands, Range, VPBB);
+      VPRecipeBase *Recipe = nullptr;
+
+      PartialReductionChain Chain;
+      if (CM.getInstructionsPartialReduction(Instr, Chain))
+        Recipe = RecipeBuilder.tryToCreatePartialReduction(Chain, Operands);
+
+      if (!Recipe)
----------------
SamTebbs33 wrote:

Done.

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


More information about the llvm-commits mailing list