[llvm] [VPlan] Introduce VPSingleDefRecipe. (PR #77023)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 7 10:58:29 PST 2024


================
@@ -8937,12 +8937,12 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
            "AnyOf reductions are not allowed for in-loop reductions");
 
     // Collect the chain of "link" recipes for the reduction starting at PhiR.
-    SetVector<VPRecipeBase *> Worklist;
+    SetVector<VPSingleDefRecipe *> Worklist;
     Worklist.insert(PhiR);
     for (unsigned I = 0; I != Worklist.size(); ++I) {
-      VPRecipeBase *Cur = Worklist[I];
-      for (VPUser *U : Cur->getVPSingleValue()->users()) {
-        auto *UserRecipe = dyn_cast<VPRecipeBase>(U);
+      VPSingleDefRecipe *Cur = Worklist[I];
+      for (VPUser *U : Cur->users()) {
+        auto *UserRecipe = dyn_cast<VPSingleDefRecipe>(U);
         if (!UserRecipe)
           continue;
         assert(UserRecipe->getNumDefinedValues() == 1 &&
----------------
ayalz wrote:

The assert now coincides with the early-continue if (!UserRecipe).

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


More information about the llvm-commits mailing list