[llvm] [VPlan] Support VPReverseVectorPointer in DataWithEVL vectorization (PR #113667)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 11:43:14 PST 2024


================
@@ -1462,15 +1462,22 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
         assert(OrigMask && "Unmasked recipe when folding tail");
         return HeaderMask == OrigMask ? nullptr : OrigMask;
       };
+      auto SetEVLForReversePointer = [&EVL](VPValue *V) -> void {
+        if (auto *R = dyn_cast_if_present<VPReverseVectorPointerRecipe>(
+                V->getDefiningRecipe()))
+          R->setOperand(1, &EVL);
+      };
 
       VPRecipeBase *NewRecipe =
           TypeSwitch<VPRecipeBase *, VPRecipeBase *>(CurRecipe)
               .Case<VPWidenLoadRecipe>([&](VPWidenLoadRecipe *L) {
                 VPValue *NewMask = GetNewMask(L->getMask());
+                SetEVLForReversePointer(L->getAddr());
----------------
fhahn wrote:

Would it be better to set EVL for all `VPReverseVectorPointerRecipe`? There could be other memory recipes in the future , e.g. interleave groups

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


More information about the llvm-commits mailing list