[llvm] [LV] Transform to handle exits in the scalar loop (PR #148626)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 12 06:36:56 PST 2025


================
@@ -561,6 +561,9 @@ void VPlanTransforms::handleEarlyExits(VPlan &Plan,
         handleUncountableEarlyExit(cast<VPBasicBlock>(Pred), EB, Plan,
                                    cast<VPBasicBlock>(HeaderVPB), LatchVPBB);
         HandledUncountableEarlyExit = true;
+        if (Plan.shouldEarlyExitContinueInScalarLoop())
+          for (VPRecipeBase &R : EB->phis())
+            cast<VPIRPhi>(&R)->removeIncomingValueFor(Pred);
----------------
MacDue wrote:

nit: You could change the `else` branch into `if (!HasUncountableEarlyExit || Plan.shouldEarlyExitContinueInScalarLoop())`.

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


More information about the llvm-commits mailing list