[llvm] [LV] Support tail-folded epilogue loops (PR #208764)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 02:10:44 PDT 2026


================
@@ -3352,6 +3359,85 @@ static bool hasFindLastReductionPhi(VPlan &Plan) {
                              RedPhi->getRecurrenceKind());
                 });
 }
+/// Determine how to lower the epilogue for the vector epilogue loop.
+/// Check if there are any conflicts that prevent tail-folding the epilogue.
+/// \return CM_EpilogueNotNeededFoldTail if epilogue tail-folding is possible,
+/// otherwise CM_EpilogueAllowed.
+static EpilogueLowering
+getEpilogueTailLowering(const LoopVectorizationCostModel &MainCM, const Loop *L,
----------------
david-arm wrote:

It would be nice if this function move could be done in a separate commit (could be within the same PR or in a different PR) so that we can see the diff more easily. It would also reduce the overall diff in this PR.

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


More information about the llvm-commits mailing list