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

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 08:08:29 PDT 2025


================
@@ -810,10 +810,15 @@ Value *VPInstruction::generate(VPTransformState &State) {
         Value *RdxPart = RdxParts[Part];
         if (RecurrenceDescriptor::isMinMaxRecurrenceKind(RK))
           ReducedPartRdx = createMinMaxOp(Builder, RK, ReducedPartRdx, RdxPart);
-        else
-          ReducedPartRdx = Builder.CreateBinOp(
-              (Instruction::BinaryOps)RecurrenceDescriptor::getOpcode(RK),
-              RdxPart, ReducedPartRdx, "bin.rdx");
+        else {
+          // Interleaved/unrolled sub reductions should still be added together
----------------
SamTebbs33 wrote:

That's much clearer, thank you.

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


More information about the llvm-commits mailing list