[llvm] [LV] Transform to handle exits in the scalar loop (PR #148626)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 03:53:31 PST 2025


================
@@ -4182,6 +4182,14 @@ class VPlan {
   /// VPlan is destroyed.
   SmallVector<VPBlockBase *> CreatedBlocks;
 
+  /// The entry block in a vplan, which may be a check block that needs to
+  /// be wired up in the right place with existing check blocks.
+  std::optional<VPBasicBlock *> EarlyExitPreheader;
+
+  /// Indicates that an early exit loop will exit before the condition is
+  /// reached, and that the scalar loop must perform the last few iterations.
+  bool EarlyExitContinuesInScalarLoop = false;
----------------
huntergr-arm wrote:

Not really; we usually merge all the blocks in the loop together and combine the exits. This also affects how we process exits in the middle block, and I'd rather not mix-and-match different exit styles when we get around to supporting multiple uncountable exits.

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


More information about the llvm-commits mailing list