[llvm] [VPlan] Model FOR resume value extraction in VPlan. (PR #93396)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 06:56:10 PDT 2024


================
@@ -855,6 +904,13 @@ bool VPlanTransforms::adjustFixedOrderRecurrences(VPlan &Plan,
         {}, "vector.recur.extract.for.phi"));
     RecurSplice->replaceUsesWithIf(
         Result, [](VPUser &U, unsigned) { return isa<VPLiveOut>(&U); });
+    auto *Resume = MiddleBuilder.createNaryOp(
+        VPInstruction::ExtractFromEnd,
+        {FOR->getBackedgeValue(),
+         Plan.getOrAddLiveIn(ConstantInt::get(IntTy, 1))},
+        {}, "vector.recur.extract");
----------------
ayalz wrote:

These two names `vector.recur.extract.for.phi` and `vector.recur.extract` should also be improved - both are extracting from the same vector - the former extracts the final value of the recurrence for uses outside the loop while the latter extract a value for the next iteration to continue the recurrence.

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


More information about the llvm-commits mailing list