[llvm] [VPlan] Emit VPVectorEndPointerRecipe for reverse interleave pointer adjustment (PR #144864)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 02:30:30 PDT 2025


================
@@ -2489,6 +2489,22 @@ void VPlanTransforms::createInterleaveGroups(
       Addr = InBounds ? B.createInBoundsPtrAdd(InsertPos->getAddr(), OffsetVPV)
                       : B.createPtrAdd(InsertPos->getAddr(), OffsetVPV);
     }
+    // If the group is reverse, adjust the index to refer to the last vector
+    // lane instead of the first. We adjust the index from the first vector
+    // lane, rather than directly getting the pointer for lane VF - 1, because
+    // the pointer operand of the interleaved access is supposed to be uniform.
+    if (IG->isReverse()) {
+      auto *GEP = dyn_cast<GetElementPtrInst>(
+          getLoadStorePointerOperand(IRInsertPos)->stripPointerCasts());
----------------
Mel-Chen wrote:

3b1e18430853e30b8707734ad2422c4311081941

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


More information about the llvm-commits mailing list