[llvm] [LV] Create in-loop sub reductions (PR #147026)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 06:40:39 PDT 2025


================
@@ -9144,6 +9144,15 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
             CurrentLinkI->getFastMathFlags());
         LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
         VecOp = FMulRecipe;
+      } else if (PhiR->isInLoop() && Kind == RecurKind::Sub &&
+                 CurrentLinkI->getOpcode() == Instruction::Sub) {
----------------
SamTebbs33 wrote:

Ah yes that's right, it needs to be checking for an Add RecurKind.

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


More information about the llvm-commits mailing list