[llvm] [VPlan] Impl VPlan-based pattern match for ExtendedRed and MulAccRed (NFCI) (PR #113903)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 10:58:01 PST 2024


================
@@ -9611,9 +9555,30 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
       if (CM.blockNeedsPredicationForAnyReason(BB))
         CondOp = RecipeBuilder.getBlockInMask(BB);
 
-      VPReductionRecipe *RedRecipe =
-          new VPReductionRecipe(RdxDesc, CurrentLinkI, PreviousLink, VecOp,
-                                CondOp, CM.useOrderedReductions(RdxDesc));
+      VPReductionRecipe *RedRecipe;
+      VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(),
+                            CM);
+      bool IsOrderedRed = CM.useOrderedReductions(RdxDesc);
+      // TODO: Remove EVL check when we support EVL version of
+      // VPExtendedReductionRecipe and VPMulAccumulateReductionRecipe.
+      if (ForceTailFoldingStyle == TailFoldingStyle::DataWithEVL) {
+        RedRecipe = new VPReductionRecipe(RdxDesc, CurrentLinkI, PreviousLink,
+                                          VecOp, CondOp, IsOrderedRed);
+      } else {
+        if (auto *MulAcc =
----------------
alexey-bataev wrote:

```suggestion
      } else if (auto *MulAcc =
```


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


More information about the llvm-commits mailing list