[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #144908)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 08:39:02 PDT 2025


================
@@ -7050,7 +7050,8 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
       }
       // The VPlan-based cost model is more accurate for partial reduction and
       // comparing against the legacy cost isn't desirable.
-      if (isa<VPPartialReductionRecipe>(&R))
+      if (auto *VPR = dyn_cast<VPReductionRecipe>(&R);
+          VPR && VPR->isPartialReduction())
----------------
sdesmalen-arm wrote:

nit: I know it's a style thing, so feel free to ignore, but below you wrote it like this:
```suggestion
      if (isa<VPReductionRecipe>(R) &&                    
          cast<VPReductionRecipe>(R).isPartialReduction())
```

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


More information about the llvm-commits mailing list