[llvm] [VPlan] Manage Sentinel value for FindLastIV in VPlan. (PR #142291)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 14 02:51:45 PDT 2025


================
@@ -645,16 +645,16 @@ Value *VPInstruction::generate(VPTransformState &State) {
 
     // The recipe's operands are the reduction phi, followed by one operand for
     // each part of the reduction.
-    unsigned UF = getNumOperands() - 2;
-    Value *ReducedPartRdx = State.get(getOperand(2));
+    unsigned UF = getNumOperands() - 3;
+    Value *ReducedPartRdx = State.get(getOperand(3));
     for (unsigned Part = 1; Part < UF; ++Part) {
       ReducedPartRdx = createMinMaxOp(Builder, RecurKind::SMax, ReducedPartRdx,
-                                      State.get(getOperand(2 + Part)));
+                                      State.get(getOperand(3 + Part)));
     }
 
----------------
fhahn wrote:

Done, also for Start

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


More information about the llvm-commits mailing list