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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 24 03:21:12 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:

Yes, `VPUnrolledPart` should be temporary, until all recipes have been migrated to be handled explicitly during unrolling. Modeling this explicitly late has the benefit of enabling more simplification and CSE opportunities. It also removes the special extra operand.

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


More information about the llvm-commits mailing list