[llvm] [VPlan] Support VPWidenPointerInductionRecipes with EVL tail folding (PR #152110)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 09:32:40 PDT 2025


================
@@ -2177,8 +2177,18 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
   assert(all_of(Plan.getVF().users(),
                 IsaPred<VPVectorEndPointerRecipe, VPScalarIVStepsRecipe,
                         VPWidenIntOrFpInductionRecipe>) &&
+         all_of(Plan.getVFxUF().users(),
+                [&Plan](VPUser *U) {
+                  return match(U, m_c_Binary<Instruction::Add>(
+                                      m_Specific(Plan.getCanonicalIV()),
+                                      m_Specific(&Plan.getVFxUF()))) ||
+                         isa<VPWidenPointerInductionRecipe>(U);
+                }) &&
          "User of VF that we can't transform to EVL.");
   Plan.getVF().replaceAllUsesWith(&EVL);
+  Plan.getVFxUF().replaceUsesWithIf(&EVL, [](VPUser &U, unsigned Idx) {
+    return isa<VPWidenPointerInductionRecipe>(U);
----------------
lukel97 wrote:

Yeah, the assertion is handled in the existing assert above. Will add a comment

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


More information about the llvm-commits mailing list