[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;
----------------
ayalz wrote:

This is recorded here instead of asking if BestPlan reaches the scalar loop below (next to early exiting if it doesn't), because it's relevant when vectorizing the main loop only? When also vectorizing the epilog loop, should the we check if BestEpiPlan reaches the scalar loop instead?

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


More information about the llvm-commits mailing list