[llvm] [VPlan] Verify and handle FOR legality during header phi creation (NFC). (PR #191298)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 03:04:56 PDT 2026


================
@@ -5705,30 +5473,43 @@ void VPlanTransforms::addExitUsersForFirstOrderRecurrences(VPlan &Plan,
     //     lo = lcssa.phi [s1, scalar.body],
     //                    [vector.recur.extract.for.phi, middle.block]
     //
-    // Now update VPIRInstructions modeling LCSSA phis in the exit block.
-    // Extract the penultimate value of the recurrence and use it as operand for
-    // the VPIRInstruction modeling the phi.
+    // Update extracts of the splice in the middle block: they extract the
+    // penultimate element of the recurrence.
     for (VPRecipeBase &R : make_early_inc_range(
              make_range(MiddleVPBB->getFirstNonPhi(), MiddleVPBB->end()))) {
-      if (!match(&R, m_ExtractLastLaneOfLastPart(m_Specific(FOR))))
+      // For tail-folded loops, the extract may have been converted to
----------------
Mel-Chen wrote:

I think we can drop them https://github.com/llvm/llvm-project/pull/176108 


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


More information about the llvm-commits mailing list