[llvm] [VPlan] Simplify Plan's entry in removeBranchOnConst. (PR #154510)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 05:52:39 PDT 2025


================
@@ -7191,6 +7194,19 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   VPlanTransforms::optimizeForVFAndUF(BestVPlan, BestVF, BestUF, PSE);
   VPlanTransforms::simplifyRecipes(BestVPlan);
   VPlanTransforms::removeBranchOnConst(BestVPlan);
+  if (BestVPlan.getEntry()->getSingleSuccessor() ==
+      BestVPlan.getScalarPreheader()) {
+    // TODO: The vector loop would be dead, should not even try to vectorize.
+    ORE->emit([&]() {
+      return OptimizationRemarkAnalysis(DEBUG_TYPE, "VectorizationDead",
+                                        OrigLoop->getStartLoc(),
+                                        OrigLoop->getHeader())
+             << "Created vector loop never executes due insufficient trip "
----------------
ayalz wrote:

```suggestion
             << "Created vector loop never executes due to insufficient trip "
```

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


More information about the llvm-commits mailing list