[llvm] [VPlan] Introduce scalar loop header in plan, remove VPLiveOut. (PR #109975)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 13:51:36 PDT 2024


================
@@ -8973,28 +8979,30 @@ static void addLiveOutsForFirstOrderRecurrences(
     //     lo = lcssa.phi [s1, scalar.body],
     //                    [vector.recur.extract.for.phi, middle.block]
     //
-    // Extract the resume value and create a new VPLiveOut for it.
-    auto *Resume = MiddleBuilder.createNaryOp(VPInstruction::ExtractFromEnd,
-                                              {FOR->getBackedgeValue(), OneVPV},
-                                              {}, "vector.recur.extract");
-    auto *ResumePhiRecipe = ScalarPHBuilder.createNaryOp(
-        VPInstruction::ResumePhi, {Resume, FOR->getStartValue()}, {},
-        "scalar.recur.init");
-    auto *FORPhi = cast<PHINode>(FOR->getUnderlyingInstr());
-    Plan.addLiveOut(FORPhi, ResumePhiRecipe);
-
+    // Extract the resume value.
----------------
ayalz wrote:

```suggestion
```
extract is extracted from here and placed further below, but better placed in addScalarResumePhis() as it feeds scalar loop?

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


More information about the llvm-commits mailing list