[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:55 PST 2025


================
@@ -3444,8 +3450,9 @@ void VPlanTransforms::handleUncountableEarlyExit(VPBasicBlock *EarlyExitingVPBB,
     // Early exit operand should always be last phi operand. If EarlyExitVPBB
     // has two predecessors and EarlyExitingVPBB is the first, swap the operands
     // of the phis.
-    for (VPRecipeBase &R : EarlyExitVPBB->phis())
-      cast<VPIRPhi>(&R)->swapOperands();
+    if (!Plan.shouldEarlyExitContinueInScalarLoop())
----------------
MacDue wrote:

Could this check be moved to the parent `if`? 

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


More information about the llvm-commits mailing list