[llvm] [VPlan] Use pointer to member 0 as VPInterleaveRecipe's pointer arg. (PR #106431)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 10:01:21 PDT 2024


================
@@ -1539,9 +1543,39 @@ void VPlanTransforms::createInterleaveGroups(
 
     bool NeedsMaskForGaps =
         IG->requiresScalarEpilogue() && !ScalarEpilogueAllowed;
-    auto *VPIG = new VPInterleaveRecipe(IG, Recipe->getAddr(), StoredValues,
-                                        Recipe->getMask(), NeedsMaskForGaps);
-    VPIG->insertBefore(Recipe);
+
+    Instruction *IRInsertPos = IG->getInsertPos();
+    auto *InsertPos =
+        cast<VPWidenMemoryRecipe>(RecipeBuilder.getRecipe(IRInsertPos));
+    VPRecipeBase *IP = InsertPos;
----------------
ayalz wrote:

Probably to keep `InsertPos` as the original WidenMemory recipe corresponding to first-load or last-store, while setting `IP` to either its location or that of the PtrAdd introduced below, placed after it.
Perhaps this PtrAdd should be placed before this `InsertPos` recipe, and so should VPIG, instead of after it?
It should be fine either way, given that `InsertPos` is discarded afterwards.

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


More information about the llvm-commits mailing list