[llvm] [VPlan] Replace ExtractLast(Elem|LanePerPart) with ExtractLast(Lane/Part) (PR #164124)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 21:20:49 PDT 2025


================
@@ -4513,10 +4508,11 @@ void VPlanTransforms::addExitUsersForFirstOrderRecurrences(VPlan &Plan,
     // 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.
-    for (VPUser *U : FOR->users()) {
-      using namespace llvm::VPlanPatternMatch;
-      if (!match(U, m_ExtractLastElement(m_Specific(FOR))))
+    for (VPRecipeBase &R : make_early_inc_range(
+             make_range(MiddleVPBB->getFirstNonPhi(), MiddleVPBB->end()))) {
----------------
fhahn wrote:

Yes, now we have `ExtractLastLane(ExtractLastPart(FOR))`, iterating and matching the 2 recipe pattern seems simpler than finding ExtractLastPart users of FOR, that itself are only used by ExtractLastLane

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


More information about the llvm-commits mailing list