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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 05:20:53 PST 2025


================
@@ -4552,7 +4555,7 @@ LoopVectorizationPlanner::selectInterleaveCount(VPlan &Plan, ElementCount VF,
   // We don't attempt to perform interleaving for loops with uncountable early
   // exits because the VPInstruction::AnyOf code cannot currently handle
   // multiple parts.
-  if (Plan.hasEarlyExit())
+  if (Plan.hasEarlyExit() || Plan.shouldEarlyExitContinueInScalarLoop())
----------------
david-arm wrote:

>From what I can see in the tests the plan does in fact have an early exit, so we shouldn't need to ask the question `shouldEarlyExitContinueInScalarLoop`. It's very confusing for a plan that has an early exit to return false from `hasEarlyExit`

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


More information about the llvm-commits mailing list