[llvm] [VPlan] Introduce ExitPhi VPInstruction, use to create phi for FOR. (PR #94760)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 13:59:26 PDT 2024


================
@@ -193,11 +193,18 @@ void VPLiveOut::fixPhi(VPlan &Plan, VPTransformState &State) {
   auto Lane = vputils::isUniformAfterVectorization(ExitValue)
                   ? VPLane::getFirstLane()
                   : VPLane::getLastLaneForVF(State.VF);
-  VPBasicBlock *MiddleVPBB =
+  VPBasicBlock *PredVPBB =
       cast<VPBasicBlock>(Plan.getVectorLoopRegion()->getSingleSuccessor());
-  BasicBlock *MiddleBB = State.CFG.VPBB2IRBB[MiddleVPBB];
-  Phi->addIncoming(State.get(ExitValue, VPIteration(State.UF - 1, Lane)),
-                   MiddleBB);
+  VPRecipeBase *DefRecipe = ExitValue->getDefiningRecipe();
----------------
ayalz wrote:

```suggestion
  auto *ExitVPBB = ExitValue->getDefiningRecipe() ? ExitValue->getDefiningRecipe()->getParent() : nullptr;
```
can ExitValue be a live in, or can we assert it has a defining recipe.

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


More information about the llvm-commits mailing list