[llvm] [LV] Allow loops with multiple early exits in legality checks. (PR #176403)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 19 00:36:23 PST 2026


================
@@ -1434,13 +1435,10 @@ bool LoopVectorizationLegality::isFixedOrderRecurrence(
 bool LoopVectorizationLegality::blockNeedsPredication(
     const BasicBlock *BB) const {
   // When vectorizing early exits, create predicates for the latch block only.
-  // The early exiting block must be a direct predecessor of the latch at the
-  // moment.
+  // For a single early exit, it must be a direct predecessor of the latch.
+  // For multiple early exits, they form a chain leading to the latch.
   BasicBlock *Latch = TheLoop->getLoopLatch();
   if (hasUncountableEarlyExit()) {
----------------
fhahn wrote:

removed thanks

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


More information about the llvm-commits mailing list