[llvm] [VPlan] Model VF as operand in VectorPointerRecipe (PR #168886)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 23 13:02:05 PST 2025


================
@@ -2651,7 +2651,12 @@ void VPVectorPointerRecipe::execute(VPTransformState &State) {
                                 /*IsUnitStride*/ true, CurrentPart, Builder);
   Value *Ptr = State.get(getOperand(0), VPLane(0));
 
-  Value *Increment = createStepForVF(Builder, IndexTy, State.VF, CurrentPart);
+  Value *RuntimeVF = State.get(getVFValue(), VPLane(0));
+  RuntimeVF = Builder.CreateZExtOrTrunc(RuntimeVF, IndexTy);
+  Value *Increment =
+      CurrentPart == 1 ? RuntimeVF
+                       : Builder.CreateNUWMul(
+                             RuntimeVF, ConstantInt::get(IndexTy, CurrentPart));
----------------
fhahn wrote:

Can we instead change the operand to `Offset/Increment`, and handle that directly during unrolling, removing VPUnrolledPart from the recipe alltogether?

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


More information about the llvm-commits mailing list