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

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 31 14:48:08 PDT 2025


================
@@ -10293,11 +10315,15 @@ bool LoopVectorizePass::processLoop(Loop *L) {
     // rarely used is not worth unrolling.
     if (!Checks.hasChecks() && !VF.Width.isScalar())
       DisableRuntimeUnroll = true;
+    LoopRemoved = BestPlan.getScalarPreheader()->getNumPredecessors() == 0;
   }
 
   assert(DT->verify(DominatorTree::VerificationLevel::Fast) &&
          "DT not preserved correctly");
 
+  if (LoopRemoved)
+    return true;
----------------
ayalz wrote:

Early-exit worth a comment - skip the end which updates the scalar loop if it's removed?

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


More information about the llvm-commits mailing list