[llvm-branch-commits] [llvm] Patch 5: [LV] create predicated(tail-folded) vplans. (PR #207815)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 17 02:23:32 PDT 2026


================
@@ -7267,6 +7293,19 @@ getEpilogueTailLowering(const LoopVectorizationCostModel &MainCM, const Loop *L,
     return CM_EpilogueAllowed;
   }
 
+  bool HasReductions = !LVL.getReductionVars().empty();
+  bool HasSelectCmpReductions =
+      HasReductions &&
+      any_of(LVL.getReductionVars(), [&](auto &Reduction) -> bool {
+        const RecurrenceDescriptor &RdxDesc = Reduction.second;
+        RecurKind RK = RdxDesc.getRecurrenceKind();
+        return RecurrenceDescriptor::isAnyOfRecurrenceKind(RK) ||
+               RecurrenceDescriptor::isFindIVRecurrenceKind(RK) ||
+               RecurrenceDescriptor::isMinMaxRecurrenceKind(RK);
----------------
sdesmalen-arm wrote:

What's the reason for not tail-folding here? is that for functional or performance reasons?

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


More information about the llvm-branch-commits mailing list