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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 1 05:54:15 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;
----------------
fhahn wrote:

It is only relevant when not vectorizing the epilogue for now, as when vectorizing the epilogue we don't materilize the check yet.

The flag is set here to still keep the assert below before exiting. It could be moved/duplicated, but eventually we also will also enable it for the epilogue vectorization case

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


More information about the llvm-commits mailing list