[llvm] [LV] Vectorize conditional scalar assignments (PR #158088)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 08:55:57 PDT 2025


================
@@ -9970,6 +9987,22 @@ bool LoopVectorizePass::processLoop(Loop *L) {
   // Override IC if user provided an interleave count.
   IC = UserIC > 0 ? UserIC : IC;
 
+  // FIXME: Enable interleaving for last_active reductions.
+  if (any_of(LVL.getReductionVars(), [&](auto &Reduction) -> bool {
+        const RecurrenceDescriptor &RdxDesc = Reduction.second;
+        return RecurrenceDescriptor::isFindLastRecurrenceKind(
+            RdxDesc.getRecurrenceKind());
+      })) {
----------------
MacDue wrote:

very nit: You could simplify this to:
```suggestion
  if (any_of(make_second_range(LVL.getReductionVars()), [&](auto &RdxDesc) {
        return RecurrenceDescriptor::isFindLastRecurrenceKind(
            RdxDesc.getRecurrenceKind());
      })) {
```

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


More information about the llvm-commits mailing list