[llvm] [VPlan] Support tailfolded loops in multi-use-reductions (PR #214455)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 03:45:54 PDT 2026


================
@@ -6885,7 +6888,8 @@ void LoopVectorizationPlanner::addReductionResultComputation(
 
     // Remove the predicated select if the target doesn't want it.
     VPValue *V;
-    if (!CM->usePredicatedReductionSelect(RecurrenceKind) &&
+    if (!CM->usePredicatedReductionSelect(
+            RecurrenceKind, RdxDesc.hasUsesOutsideReductionChain()) &&
----------------
fhahn wrote:

can take info directly from `PhiR`

```suggestion
            RecurrenceKind, PhiR->hasUsesOutsideReductionChain() &&
```

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


More information about the llvm-commits mailing list