[llvm] [LoopVectorize] Enable vectorisation of early exit loops with live-outs (PR #120567)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 02:46:23 PST 2025


================
@@ -405,9 +405,9 @@ Early Exit Vectorization
 When vectorizing a loop with a single early exit, the loop blocks following the
 early exit are predicated and the vector loop will always exit via the latch.
 If the early exit has been taken, the vector loop's successor block
-(``middle.split`` below) branches to the early exit block. Otherwise
-``middle.block`` selects between the exit block from the latch or the scalar
-remainder loop.
+(``middle.split`` below) branches to the early exit block via an intermediate
+block (``vector.early.exit`` below). Otherwise ``middle.block`` selects between
+the exit block from the latch or the scalar remainder loop.
----------------
fhahn wrote:

Might be good to also explain why the intermediate block is needed, i.e. to compute the exit value?

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


More information about the llvm-commits mailing list