[llvm] [VPlan] Add transform to fold early-exit branches into loops (PR #148404)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 01:29:16 PDT 2025


================
@@ -7242,6 +7246,10 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   // Regions are dissolved after optimizing for VF and UF, which completely
   // removes unneeded loop regions first.
   VPlanTransforms::dissolveLoopRegions(BestVPlan);
+
+  if (FoldEarlyExitBranchIntoLoop)
----------------
fhahn wrote:

(we can do it now that we dissolve the hierarchical CFG before execute where we aren't tied to single-entry-single exit regions, but the backend/other CFG simplification passes may still be a better place to decide what form is best)

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


More information about the llvm-commits mailing list