[llvm] [VPlan] Introduce VPInstruction::InsertLastLane for start value of VPFirstOrderRecurrencePHIRecipe. (PR #171590)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 06:43:49 PDT 2026


================
@@ -4265,6 +4269,27 @@ void VPlanTransforms::adjustFirstOrderRecurrenceMiddleUsers(VPlan &Plan,
     assert(VectorRegion->getSingleSuccessor() == Plan.getMiddleBlock() &&
            "Cannot handle loops with uncountable early exits");
 
+    // Adjust start value of fixed-order recurrence phi to [poison, ... ,
+    // poison, start value] for vector VF plans.
+    if (!ScalarVFOnly) {
+      VPValue *StartV = FOR->getStartValue();
+      DebugLoc DL = FOR->getDebugLoc();
+      VPValue *Poison =
+          Plan.getOrAddLiveIn(PoisonValue::get(StartV->getScalarType()));
+      // TODO: Use the type of runtimeVF as index type.
----------------
Mel-Chen wrote:

>From https://github.com/llvm/llvm-project/pull/172009/changes#r2616869402

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


More information about the llvm-commits mailing list