[llvm] [VPlan] Consistently use (Part, 0) for first lane scalar values (PR #80271)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 04:11:46 PST 2024


================
@@ -883,8 +888,11 @@ void VPlan::execute(VPTransformState *State) {
 
     for (unsigned Part = 0; Part < LastPartForNewPhi; ++Part) {
       Value *Phi = State->get(PhiR, Part);
-      Value *Val = State->get(PhiR->getBackedgeValue(),
-                              SinglePartNeeded ? State->UF - 1 : Part);
+      Value *Val =
+          isa<VPCanonicalIVPHIRecipe>(PhiR)
+              ? State->get(PhiR->getBackedgeValue(), VPIteration(Part, 0))
+              : State->get(PhiR->getBackedgeValue(),
+                           SinglePartNeeded ? State->UF - 1 : Part);
----------------
fhahn wrote:

Added, thanks

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


More information about the llvm-commits mailing list