[llvm] [NFC][LV] Introduce enums for uncountable exit detail and style (PR #184808)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 01:58:36 PDT 2026


================
@@ -8106,14 +8181,25 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
             return !CM.requiresScalarEpilogue(VF.isVector());
           },
           Range);
-  // Update the branch in the middle block if a scalar epilogue is required.
-  VPBasicBlock *MiddleVPBB = Plan->getMiddleBlock();
-  if (!RequiresScalarEpilogueCheck && MiddleVPBB->getNumSuccessors() == 2) {
-    auto *BranchOnCond = cast<VPInstruction>(MiddleVPBB->getTerminator());
-    assert(MiddleVPBB->getSuccessors()[1] == Plan->getScalarPreheader() &&
-           "second successor must be scalar preheader");
-    BranchOnCond->setOperand(0, Plan->getFalse());
-  }
+
+  // If we're vectorizing a loop with an uncountable exit, make sure that the
+  // recipes are safe to handle.
+  // TODO: Remove this once we can properly check the vplan itself for both
----------------
fhahn wrote:

```suggestion
  // TODO: Remove this once we can properly check the VPlan itself for both
```

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


More information about the llvm-commits mailing list