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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 06:04:37 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 &&
----------------
fhahn wrote:

Done, also added an assert inside `if (!UserRecipe)` to assert that `U` is a VPLiveOut in that case.

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


More information about the llvm-commits mailing list