[llvm] [LoopVectorizer] Allow partial reductions to be made in predicated loops (PR #124268)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 06:56:17 PST 2025


================
@@ -9703,7 +9698,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
     // beginning of the dedicated latch block.
     auto *OrigExitingVPV = PhiR->getBackedgeValue();
     auto *NewExitingVPV = PhiR->getBackedgeValue();
-    if (!PhiR->isInLoop() && CM.foldTailByMasking()) {
+    if (!PhiR->isInLoop() && CM.foldTailByMasking() &&
----------------
SamTebbs33 wrote:

A comment here explaining why partial reductions have a special case would be good.

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


More information about the llvm-commits mailing list